← Back to Pull requests

sdk/js: publish an agentmesh MCP stdio server to the MCP registry #837

Closed
unknown closed this pull request without merging on Nov 01, 2026 14:48 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 18:35 UTC
Author

Fixes #544

This implements the tasks in #544 as written. The issue predates the SAM → agentmesh rename, so the code uses today's names: the agentmesh bin, AGENTMESH_ variables and @agentmesh-p2p/sdk.

Tasks

1. agentmesh executable (sdk/js/src/cli.ts, mcp-server.ts): McpServer + StdioServerTransport over MeshSession.
- It exposes get_mesh_info, discover_remote_services, find_remote_tools, describe_remote_tool and call_remote_tool, with the node's parameter contracts and failure behaviour. Mesh-wide fan-out has a per-provider deadline, and a failing provider becomes an error row.
- No list_local_services. Inference is left out: inference services are discoverable but not callable, because there is no /v1 endpoint here.
- Configuration comes from AGENTMESH_CONTROL_PLANE_URL, AGENTMESH_BOOTSTRAP_TOKEN_PATH or AGENTMESH_JWT_PATH, AGENTMESH_STATE_DIR and AGENTMESH_INSECURE_CONTROL_PLANE. The first run enrolls; later runs resume as the same peer. No secret is passed on the command line.
- Logs go to stderr only.
2. mcpName: io.github.google/agentmesh.
3. sdk/js/server.json: one npm package with stdio transport. The token paths are marked isSecret, and the version is stamped by hack/sdk-version.sh.
4. Auth: GitHub OIDC from release.yml. The registry grants io.github.google/
to workflows in google/agentmesh, so no DNS record or secret is needed.
5. release.yml: after npm publish, it runs mcp-publisher login github-oidc and mcp-publisher publish, and skips a version that is already listed. The publisher is downloaded at a pinned version, and its SHA-256 is checked.
6. Tests:
- Unit tests for the tool mapping in sdk/js/src/mcp-server.test.ts.
- TestNativeSDKMCPStdio drives the executable with a stdio MCP client against agentmesh-one. It checks parameter contracts against the node's own registrations, discovery and calls, that policy and label refusals never reach the backend, and identity reuse after a restart.
7. Docs: Connecting agents stays node-first. A new section, "Without a node: the MCP registry server", covers the stdio server as a lighter, complementary caller.

Validation


  • CI passes on GitHub-hosted runners, from a PR inside my fork: Test, SDK, bats, kind-mesh-e2e, Test Flutter App, Deployment to GitHub Pages, Govulncheck and console-ui (all 8 workflows green on this commit).

  • Locally:

  • - make sdk-js passes (154 tests).
    - TestNativeSDKMCPStdio passes with -race.
    - mcp-publisher validate accepts server.json.
    - actionlint is clean.
    - sdk-version.sh stamps server.json together with package.json.
  • Live check: Claude Code used the executable as its MCP server against agentmesh-one and an agentmesh-node provider. It discovered, described and called tools. A policy-denied call was refused, and a relaunch resumed the same peer ID.
  • 🤖 Generated with Claude Code

    Diff: 374 lines (+280 / -94) across 4 files Reviewer: aojea Review duration: 2653m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 374 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.355
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #837"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.9% (MEDIUM) · Higher = larger blast radius
    42.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%