Skip to content

feat(glama): standalone nyxid-mcp-demo crate (refs #593)#615

Merged
kaiweijw merged 3 commits intomainfrom
fix/glama-tiny-mcp-demo-crate
May 4, 2026
Merged

feat(glama): standalone nyxid-mcp-demo crate (refs #593)#615
kaiweijw merged 3 commits intomainfrom
fix/glama-tiny-mcp-demo-crate

Conversation

@kaiweijw
Copy link
Copy Markdown
Collaborator

@kaiweijw kaiweijw commented May 4, 2026

Summary

  • New mcp-demo/ workspace crate producing nyxid-mcp-demo — a tiny standalone stdio MCP server for directory-listing introspection (Glama).
  • Single dependency: serde_json. Cold cargo build: ~4 seconds (vs. 10-15+ min for the full backend, which was timing out on Glama's runners).
  • Stripped binary size: ~530 KB.
  • Mirrors the same four curated gateway tools the backend already exposes via nyxid mcp-demo: nyx_proxy_request, nyx_list_services, nyx_request_approval, nyx_exchange_identity. No duplication of intent — the same surface, shipped two ways.
  • Updates Dockerfile.glama as the reference for what to paste into Glama's admin Dockerfile UI (Glama does not auto-read it from the repo).

Why a separate crate

Glama runners are timing out trying to build nyxid from scratch — the backend pulls 400+ transitive crates (mongodb, axum, jsonwebtoken with aws_lc_rs requiring cmake/clang, etc.). The directory's scoring pipeline only needs tools/list over stdio, so we don't need any of that machinery to be on the same compile path.

The standalone crate has just serde_json as a direct dep (~5 transitive crates total). Builds in seconds, runs from a 530K binary, doesn't share state or build deps with the production backend.

The backend's nyxid mcp-demo subcommand is left in place — useful for production self-discovery on real installs and harmless to keep.

Verification

$ cargo build --release -p nyxid-mcp-demo
   Compiling serde_core v1.0.228
   Compiling serde_json v1.0.149
   Compiling memchr v2.8.0
   Compiling itoa v1.0.18
   Compiling nyxid-mcp-demo v0.1.0
    Finished `release` profile [optimized] target(s) in 3.83s

$ printf '{"jsonrpc":"2.0","id":1,"method":"tools/list"}\n' \
    | ./target/release/nyxid-mcp-demo \
    | jq '.result.tools | length'
4

Full workspace still builds clean (cargo build --release -p nyxid -p nyxid-cli -p nyxid-mcp-demo finished in 2m 54s on M2). Pre-commit hooks (cargo fmt + clippy) passed locally.

Post-merge steps

  1. Update Glama's admin UI build steps and CMD (single entry, references main post-merge).
  2. Trigger Glama re-evaluation; verify tools/list introspection lands a real score.
  3. Update punkpeye/awesome-mcp-servers#5485 entry with the inline badge per @punkpeye's format.

Test plan

  • CI: cargo build, cargo test, cargo clippy, cargo fmt --check (pre-commit hooks already passed locally)
  • Manual: nyxid-mcp-demo responds to initialize, tools/list, ping, and unknown methods (-32601)
  • Manual: docker build -f Dockerfile.glama . reproduces the Glama config and the resulting image speaks stdio MCP
  • After merge: Glama build completes within timeout, listing scored

kaiweijw added 3 commits May 4, 2026 15:38
Glama's scoring runners time out on `cargo build -p nyxid` because the
full backend has 400+ deps (mongodb, axum, JWT crates with C build
dependencies). Cold compile is 10-15 min on constrained CI.

Adds a tiny `mcp-demo` workspace crate with serde_json + std as the
only dependency. Cold build: ~4s. Stripped binary: ~530K. Mirrors the
same four curated gateway tools the backend's mcp_demo module exposes
(nyx_proxy_request, nyx_list_services, nyx_request_approval,
nyx_exchange_identity), so the public surface stays consistent.

Also updates Dockerfile.glama as the reference for the Glama admin UI
(Glama does not auto-read this file from the repo; paste the build
step + CMD into their admin Dockerfile page).

Refs #593.
…ne crate

The `nyxid mcp-demo` subcommand introduced in PR #609 only existed for
Glama's directory listing, which now uses the dedicated `nyxid-mcp-demo`
binary from the new `mcp-demo` workspace crate. Removing the duplicate
keeps a single source of truth for the curated tool definitions and
shrinks the backend binary's argv surface.
…e member

backend/Dockerfile and cli/Dockerfile.node copy the workspace
manifests selectively, so adding mcp-demo to the workspace's members
list without copying its Cargo.toml and source breaks `cargo build`
on workspace resolution. The publish-images workflow runs on every
push to main, so this would land as a regression.

Both Dockerfiles now copy mcp-demo alongside backend/ and cli/. The
backend image still excludes the mcp-demo binary -- only nyxid-cli
and nyxid (backend) get installed at runtime.

Verified with `docker build -f backend/Dockerfile .` and
`docker build -f cli/Dockerfile.node .` locally; both produce
working images.
@kaiweijw kaiweijw merged commit 9455578 into main May 4, 2026
10 checks passed
@kaiweijw kaiweijw deleted the fix/glama-tiny-mcp-demo-crate branch May 4, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant