Writing an MCP server in Rust is the fun part. Packaging it so someone else can actually install, verify, and run it without cloning your repo or blindly trusting a curl | sh script is where most of the real friction lives.

Over the past few releases of xgbtxy/ap — starting with the v2.96.2 milestone (361/361 tests passing and 0 bundle validation findings) and continuing through v2.98.0 — I wired up four distribution surfaces from the same single-binary Rust codebase:

  1. The Official MCP Registry (io.github.xgbtxy/ap) with five per-platform .mcpb bundles and GitHub OIDC publishing.
  2. Glama (glama.json) + a minimal non-root Docker image (Dockerfile).
  3. A strict Antigravity plugin bundle (.antigravity-plugin/plugin.json + plugin/).
  4. Pinned GitHub Release binaries with SHA256SUMS.

Here is how the pieces fit together, the trade-offs I ran into, and the parts I am still unsure about.

1. Official MCP Registry (io.github.xgbtxy/ap) without long-lived secrets

You can query the live registry entry directly right now:

curl -s https://registry.modelcontextprotocol.io/v0.1/servers/io.github.xgbtxy%2Fap/versions/latest 

The registry manifest (server.json) targets schema https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json and declares five mcpb packages over stdio transport:

  • ap-mcp-windows-x64.mcpb
  • ap-mcp-darwin-arm64.mcpb
  • ap-mcp-darwin-x64.mcpb
  • ap-mcp-linux-x64.mcpb
  • ap-mcp-linux-arm64.mcpb

One detail that tripped me up early is the hash chicken-and-egg problem: server.json requires a fileSha256 for every .mcpb archive, but you do not know the final archive hashes until CI finishes building the release artifacts.

The cleanest pattern I landed on in .github/workflows/release.yml was to keep placeholder zeros in the checked-in server.json, build all five .mcpb bundles via scripts/make-mcpb.sh, generate SHA256SUMS, and then have the publish-mcp-registry job stamp each real fileSha256 into server.json right before publishing.

Publishing itself uses zero static registry API keys:

  1. Download mcp-publisher and verify its provenance against the GitHub Actions OIDC issuer (https://token.actions.githubusercontent.com).
  2. Run ./mcp-publisher validate.
  3. Authenticate via ./mcp-publisher login github-oidc.
  4. Run ./mcp-publisher publish.

That means a GitHub tag release either produces verifiable checksums and publishes atomically, or fails closed before anything hits the registry.

2. Glama + minimal non-root Docker packaging

For Glama indexing and containerized MCP runners, the repo ships two small files:

  • glama.json pointing to https://glama.ai/mcp/schemas/server.json with maintainers: ["xgbtxy"].
  • Dockerfile using a two-stage build:
    • Stage 1 (rust:1-slim-bookworm): cargo build --release --locked --bin ap.
    • Stage 2 (debian:bookworm-slim): installs only ca-certificates, creates a non-root appuser (uid 10001), attaches io.modelcontextprotocol.server.name="io.github.xgbtxy/ap" plus standard OCI source/license labels, copies /usr/local/bin/ap, and sets ENTRYPOINT ["/usr/local/bin/ap", "mcp"].

Locking --locked in the builder stage and running as appuser in a slim runtime image is boring, which is exactly what you want for a tool that touches someone else's workspace.

3. Strict Antigravity plugin bundle (.antigravity-plugin/ + plugin/)

An MCP server binary alone does not teach a coding agent when to reach for AST reads or log compression instead of dumping a 2,000-line file into context. That is why the repo also ships a plugin bundle:

  • .antigravity-plugin/plugin.json and plugin/plugin.json: metadata, suggested prompts, and version alignment (agent-primitives).
  • plugin/mcp_config.json: launches ap mcp --profile core.
  • plugin/hooks.json: a lightweight SessionStart hook (node ./scripts/session-boot.mjs, 5s timeout).
  • plugin/rules/ and plugin/skills/: concise usage guidance so the agent prefers structured primitives over raw full-file dumps.

Notice --profile core in plugin/mcp_config.json. Even though ap implements 37 MCP tools across its 7 Rust crates (atlas, splice, probe, sieve, guard, recall, baton), exposing every single tool schema on every session wastes context tokens before the user even asks a question. Defaulting the plugin to core keeps the initial tool surface tight while letting users opt into the full set when they need it.

At v2.96.2, the full Rust suite ran 361/361 passing tests with 0 manifest/security findings across the bundle checks.

Architectural trade-offs I actually felt

  • Single-binary Rust (stdio) vs. Node/Python MCP servers: Users get zero runtime dependencies and fast startup, and cargo build --locked makes builds reproducible. The tax is mine: maintaining a 5-target cross-compile matrix and .mcpb packaging scripts in CI.
  • Dynamic fileSha256 stamping in CI vs. committed hashes: Avoids double-tagging releases, but anyone inspecting server.json directly on main sees placeholder zeros instead of the live release hashes (the live hashes live on the MCP Registry endpoint and in SHA256SUMS on GitHub Releases).
  • Minimal Docker image vs. batteries-included container: Keeping the runtime image on debian:bookworm-slim with only ca-certificates keeps the image small and auditable, at the cost that headless browser (CDP) commands require a host or sidecar browser rather than a bundled Chromium inside the container.
  • Profile-scoped tools (--profile core) vs. exposing all 37 tools: Better default token hygiene for agents, but a user who installs the plugin expecting every niche sub-tool immediately visible has to know profiles exist.

What I am unsure about

  • Registry presence is not adoption. Getting io.github.xgbtxy/ap live on the Official MCP Registry and Glama makes installation cleaner and more verifiable, but xgbtxy/ap still has a tiny star count (2 stars right now). Packaging removes friction; it does not create demand on its own.
  • Four packaging surfaces create real maintenance drag. Keeping server.json, glama.json, Dockerfile, and .antigravity-plugin/ + plugin/ aligned across releases is fine when CI catches drift, and annoying whenever an upstream schema changes (2025-12-11 will not be the last MCP schema revision).
  • 361/361 tests and 0 findings only validate what I thought to test. Cross-platform stdio quirks, corporate proxies, and Windows path edge cases still tend to show up only when someone outside my own setup tries the binary.

If you are packaging an MCP server in Rust, Go, or TypeScript and have found a cleaner way to keep Registry manifests, Docker, and IDE plugin bundles in sync without duplicating metadata, I would genuinely love to compare notes.