Skip to main content
The Door Opened: Packaging Anvil Scribe and Anvil Agent for Anyone's Stack
wearablesmemomindvoiceself-hostingmcpanvil

The Door Opened: Packaging Anvil Scribe and Anvil Agent for Anyone's Stack

MemoMind opened Developer Workspace access, both plugins worked live on real glasses, and turning two homelab prototypes into self-hostable public releases took a harder kind of engineering.

Sekou M. Doumbouya

Sekou M. Doumbouya

· 13 min read

Listen to this article

The views expressed here are my own and do not represent those of any current or former employer.

Four days after Built to Be Open, Behind a Waitlist ended with “The door is still closed. The room behind it is finished,” the MemoMind Developer Workspace door actually opened. I sideloaded Anvil Scribe and Anvil Agent onto my iPhone, paired my MemoMind One glasses, and spoke a test memo into the frame. Both apps worked live over Tailscale. Even while I was traveling and an optional voice-model route hosted on a MacBook was shut down, the explicit primary Scribe and Agent routes on my home server stayed up and kept answering.

Real hardware also settled the origin question I had been guessing at. Inside the MemoMind iPhone app, the plugin WebView sends memo-plugin://<32-hex>.plugin.invalid instead of a local simulator origin. Adding that origin pattern and Authorization CORS preflight handling made both plugins connect cleanly from the phone.

Then came the less flattering discovery. The room behind the door was finished only if you lived inside my homelab. Turning two personal prototypes into public, self-hostable releases that run on someone else’s machine took a completely different kind of engineering.

What Works on My Box Breaks on Yours

When you build for yourself, your infrastructure leaks into every file. My first working plugins hardcoded personal hostnames, ports, and assumptions tied to one home server and one Tailscale setup. That gets you to a working demo fast. For a public repository, it breaks the moment someone else clones it.

I rebuilt both MemoMind plugins to start offline by default, with zero background network calls until you configure an endpoint. Setup now lives on a dedicated Settings screen that accepts an HTTPS URL, or loopback http://127.0.0.1 for local Plugin Studio testing. Bearer API keys are optional, stay in memory for the session by default, and wipe on pagehide or whenever the configured server origin changes. If you want persistence across restarts, you opt in using MemoMind’s isolated gm.storage. In Anvil Agent, where voice transcription can point to a separate Scribe or speech server, keys stay isolated per origin so one server’s credential never crosses to another. A live “Test connection” button lets you verify the endpoint before saving.

Anvil Agent Settings screen showing server URL, configured API key badge, optional voice server URL, and the Remember API keys in app storage toggle using synthetic demo values

The portable Settings screen in Anvil Agent, captured with synthetic demo values. Both plugins start offline and include a live connection test before you save.

While refactoring the clients, I also brought the Anvil Scribe MemoMind plugin, version 0.7.0, into layout parity with the Rust and gpui desktop studio: Source and Ruled Notebook, History with profile badges, Profiles, and Settings, while keeping glasses output inside MemoMind’s six hundred by three hundred fifty pixel GRAY_4 heads-up display rules.

Shipping the Whole Stack

A portable phone plugin only solves half the problem. Shipping the desktop app and plugins alone would have stranded anyone who does not run Anvil Serving.

So I extracted and bundled the full runtime inside both public repositories: a standalone, standard-library-only Python 3.11 or newer backend with ffmpeg as the only external runtime binary, a serving-engine-agnostic real-time speech-to-text and language model capability router, and a hardened Docker Compose stack. Each Python application container runs as a non-root user on a read-only root filesystem with all Linux capabilities dropped, and an optional read-only Caddy HTTPS reverse proxy (retaining only NET_BIND_SERVICE) strips Tailscale-User-Login headers at the edge so untrusted callers cannot spoof identity.

Anvil Scribe (documentation, published source-visible under All Rights Reserved while Anvil Agent is MIT-licensed) bundles the Rust and gpui desktop studio, the Scribe v3 API server on port 8790, the real-time router on port 8000, the version 0.7.0 MemoMind One plugin, and a provenance firewall built on .evaluation-excluded markers and excluded_device_terms so glasses audio stays out of model training or evaluation sets.

Anvil Agent (documentation, MIT License) bundles the stateless voice and text agent gateway on port 8792, the real-time router on port 8000, and the version 0.3.0 MemoMind One plugin. It includes pluggable backends for openai-chat, hermes-api, and pi-web, an ephemeral /v1/memos/preview endpoint for live captions, and a Streamable HTTP MCP server at POST /mcp exposing memomind_glasses with seven actions covering notifications, teleprompter pages, live captions, memo or meeting-minutes recording, quick questions, and status checks.

ReleaseLicensePortsPluginCore Surface
Anvil ScribeAll Rights Reserved8790 API, 8000 router0.7.0Rust + gpui studio, Scribe v3 API, provenance firewall
Anvil AgentMIT8792 gateway, 8000 router0.3.0Stateless gateway, Streamable HTTP MCP (POST /mcp), 3 backends

Anvil Scribe MemoMind plugin showing Source and Ruled Notebook views with Email and Summary tabs using synthetic demo text

Anvil Scribe 0.7.0 showing the Source and Ruled Notebook layout, rendered with synthetic demo data.

Anvil Agent MemoMind plugin showing Assistant, Hermes, and Pi backend switcher, conversation view, and MCP task notification card using synthetic demo data

Anvil Agent 0.3.0 with the backend switcher and an MCP notification card, rendered with synthetic demo data.

Both routers stay explicit and direct-only. Point them at any OpenAI-compatible speech-to-text server (Parakeet, Whisper, Faster-Whisper, or Speaches) and any OpenAI-compatible language model server (Ollama, vLLM, SGLang, llama.cpp, or OpenAI), or swap in an existing Anvil Serving gateway. Unknown routes return HTTP 404. Unavailable backends return HTTP 502 or 504 with zero hidden fallback. Here is the example router config shipped in Anvil Scribe’s deploy/router.example.toml:

[router]
listen_host = "0.0.0.0"
allow_container_bind = true
listen_port = 8000
client_token_env = "SCRIBE_ROUTER_TOKEN"
default_audio_route = "stt-fast"
timeout_seconds = 60

[router.audio_routes.stt-fast]
upstream_url = "http://host.docker.internal:30110"
model = "whisper-1"
protocol = "openai-multipart"

[router.chat_routes.llm-fast]
upstream_url = "http://host.docker.internal:11434"
model = "qwen2.5:7b-instruct"

[router.chat_routes.llm-heavy]
upstream_url = "http://host.docker.internal:11434"
model = "qwen2.5:14b-instruct"

Every upstream is declared, and credentials live only in environment references. If a backend goes down, you see the error immediately instead of silently routing traffic somewhere you never approved.

Respecting the SDK Boundary Without Breaking CI

MemoMind’s Open Platform Terms prohibit redistributing the proprietary Web SDK, gm-plugin-web-sdk.esm.js. Neither public repository commits it. Each repo ships memomind/setup-sdk.mjs to copy the bundle from a developer’s own local MemoMind PhoneSDK checkout into git-ignored memomind/vendor/, and --pack builds a clean .mmpkg archive from a runtime-only temporary staging directory.

To keep testing real without vendoring closed code, both repos pair Node and Python unit tests (covering URL validation, key handling, and origin isolation) with a clean-room Playwright end-to-end test shim against the bundled Python server to exercise settings storage, API traffic, HUD updates, and UI flows, and Anvil Agent runs the Playwright suite on every commit in CI. For the SDK quirks those shims model, see my technical notes on building for MemoMind glasses.

What Adversarial Review Actually Caught Before Push

Before merging to main, both releases went through three independent adversarial reviews: security and the public boundary, backend plus MCP plus router, and docs plus packaging. That gate caught five bugs before a single external user could hit them.

The first one earned a long pause at my desk. Scribe and Agent post normalized JSON speech-to-text envelopes containing audio_b64 and route to /v1/audio/transcriptions. OpenAI-compatible Whisper and Parakeet upstreams expect multipart/form-data. My first bundled router also expected multipart, which meant my own server and my own router would have returned HTTP 502 on every real recording (yes, I managed to ship a server and a router in the same repo speaking two different dialects). Upgrading the router to convert JSON envelopes to OpenAI multipart by default, and adding an end-to-end test from transcribe_segment through the router to a mock OpenAI-compatible multipart speech-to-text upstream, closed that gap for good.

The second bug was an unauthenticated crash inside Bearer authentication. Python’s hmac.compare_digest raises a TypeError on non-ASCII strings. Because http.server decodes raw header bytes as Latin-1, a single non-ASCII byte in Authorization: Bearer crashed the handler before the error wrapper ran. Comparing UTF-8 encoded bytes and rejecting duplicate Authorization headers fixed both servers, and Anvil Agent rejects duplicate Origin headers as well.

The third bug sat in Docker Compose’s parse order. The optional Caddy TLS service marked SCRIBE_DOMAIN as a required environment variable inside a --profile tls block. Compose evaluates required variable interpolations across every service before filtering profiles, so plain non-TLS docker compose up failed at parse time until I fixed the variable contract.

The last review pass caught two edge-case leaks. In the MCP server, an explicit "id": null was treated as a JSON-RPC notification instead of returning JSON-RPC error code -32600 for an invalid request. And in setup-sdk.mjs, calling process.exit() inside a try block skipped the finally cleanup of the temporary staging directory. The first and third bugs would have broken a first-time operator on day one; the rest were auth, protocol, and cleanup bugs waiting for the first malformed request or failed pack.

What Doesn’t Work Yet

I want to be blunt about what is still unfinished.

Live captions still use rolling-window re-transcription over /v1/memos/preview rather than true WebSocket audio streaming. It works for short captions, with latency tied to the polling window rather than each spoken word.

iOS still suspends MemoMind Web plugins in the background, so push-to-talk and MCP polling pause when the phone screen locks. Server code cannot bypass that platform rule.

Running on physical MemoMind One glasses still requires MemoMind Developer Workspace approval and your own local MemoMind PhoneSDK bundle loaded through setup-sdk.mjs. The backends and desktop studio run without glasses, while the on-face plugin remains behind MemoMind’s access gate.

Finally, neither repository has broad multi-operator mileage yet. Everything passes hermetic CI and runs on my setup, and real-world edge cases on other machines will surface once people deploy Anvil Agent or test the stack on different hosts.

Build for the Stranger Who Clones Your Repo

The difference between a homelab prototype and a public release is not extra features. It is removed assumptions.

When you build only for yourself, your habits hide as invisible dependencies: the hostname you remember, the header your proxy injects, the wire format two services happen to expect because you wrote them on the same afternoon. Treat the stranger who clones your repository as an adversarial test of your defaults. Start offline, isolate keys by origin, declare every upstream explicitly, and verify the real contract between your own components before you call the room finished.

0 claps

Enjoyed this? Tap to applaud, hold to really applaud.

Share this post
LinkedInXHacker NewsBluesky

Co-authored with AI, based on the author's working sessions, dictations, and notes.

Explore the source

fakoli/anvil-agent

This article discusses an open-source project. Star it, fork it, or open an issue.