Repository navigation
sdk/js: publish an agentmesh MCP stdio server to the MCP registry - #837
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a native JavaScript SDK implementation for running an Agent Mesh MCP client over stdio, including a CLI entry point, local MCP server, registry configuration, and updated documentation. Feedback on the changes suggests using fileURLToPath instead of .pathname in Node.js tests to ensure cross-platform compatibility on Windows. Additionally, several assertions in the Go integration tests should be updated to comply with the Repository Style Guide (§ 3.8) by explicitly stating both the observed and expected values in failure messages.
c814167 to
e933be6
Compare
@mrunalpendem123 yeah, the rename was very painful, the goal is to have it in the official registry, so do you know if there is anything else to do for using |
| echo "00b21004149a4ce66f0782508ae4a2bce67d1bea395a8da0bd8028159fb59579 $RUNNER_TEMP/mcp-publisher.tar.gz" | sha256sum -c - | ||
| tar -xzf "$RUNNER_TEMP/mcp-publisher.tar.gz" -C "$RUNNER_TEMP" mcp-publisher | ||
| echo "$RUNNER_TEMP" >> "$GITHUB_PATH" | ||
| - name: Publish dev.sam-mesh/mesh to the MCP registry |
There was a problem hiding this comment.
I can see in https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/quickstart.mdx we can use the github url directly and avoid the legacy sam-mesh domain so we can remove this
There was a problem hiding this comment.
Done in b1e9891. release.yml now uses mcp-publisher login github-oidc (the job already has id-token: write), and the server is published as io.github.google/agentmesh. The DNS step and the MCP_REGISTRY_PRIVATE_KEY secret are gone.
| need an `agentmesh-node` process beside it. | ||
|
|
||
| ## What every client needs | ||
| ## Install from the MCP registry |
There was a problem hiding this comment.
this is not here, so there is the agentmesh-node that provides a lot of functionality and this is just a simple way to have access to the mesh via an mcp without having the node, those are complementary
There was a problem hiding this comment.
Oh, I see you added a section later, I need to read it , sorry
There was a problem hiding this comment.
Agreed, they are complementary. In ece3e28 I kept Connecting agents as it is on main, node-first, and added one section, "Without a node: the MCP registry server", for the stdio server as the lighter option. The separate deploying-node-mcp page is gone, so the docs change is now just that section.
7d96751 to
23ed382
Compare
Add an agentmesh stdio executable to @agentmesh-p2p/sdk with the node's five caller tools and their parameter contracts, configured through AGENTMESH_* variables and logging only to stderr. Discovery fans out like agentmesh-node: bounded concurrency, a deadline per provider, and failed providers reported or dropped instead of failing the call. List it in the official MCP registry as dev.sam-mesh/mesh: mcpName, server.json stamped by hack/sdk-version.sh, and a release step that runs mcp-publisher login dns and publish after npm publish, skipping a version that is already listed. Move the agentmesh-node HTTP setup to its own guide and base Connecting agents on the registry entry. Fixes google#544
Resolve the CLI path with fileURLToPath so the tests also run on Windows, and state both the observed and the expected value in the integration test's assertions.
The registry grants io.github.<repository_owner>/* to GitHub Actions OIDC tokens, so the release workflow in google/agentmesh can publish io.github.google/agentmesh without a DNS record or a stored key. The publish-sdk-js job already has id-token: write for npm trusted publishing. Rename mcpName and the server.json entry, log in with mcp-publisher login github-oidc, and drop MCP_REGISTRY_PRIVATE_KEY. Remove a README paragraph that predates the registry release step.
agentmesh-node stays the way to connect agents. Restore the guide and add one section for the io.github.google/agentmesh stdio server, a lighter caller for clients that do not run a node. Drop the separate deploying-node-mcp page.
23ed382 to
ece3e28
Compare
|
It works out of the box. The registry grants I have switched the PR to it (b1e9891), and the docs keep the node first, with the stdio server as one complementary section (ece3e28). There is nothing to set up on your side. |
|
Thanks |
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
agentmeshbin,AGENTMESH_*variables and@agentmesh-p2p/sdk.Tasks
agentmeshexecutable (sdk/js/src/cli.ts,mcp-server.ts): McpServer + StdioServerTransport over MeshSession.get_mesh_info,discover_remote_services,find_remote_tools,describe_remote_toolandcall_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.list_local_services. Inference is left out: inference services are discoverable but not callable, because there is no/v1endpoint here.AGENTMESH_CONTROL_PLANE_URL,AGENTMESH_BOOTSTRAP_TOKEN_PATHorAGENTMESH_JWT_PATH,AGENTMESH_STATE_DIRandAGENTMESH_INSECURE_CONTROL_PLANE. The first run enrolls; later runs resume as the same peer. No secret is passed on the command line.mcpName:io.github.google/agentmesh.sdk/js/server.json: one npm package with stdio transport. The token paths are markedisSecret, and the version is stamped byhack/sdk-version.sh.release.yml. The registry grantsio.github.google/*to workflows ingoogle/agentmesh, so no DNS record or secret is needed.release.yml: afternpm publish, it runsmcp-publisher login github-oidcandmcp-publisher publish, and skips a version that is already listed. The publisher is downloaded at a pinned version, and its SHA-256 is checked.sdk/js/src/mcp-server.test.ts.TestNativeSDKMCPStdiodrives the executable with a stdio MCP client againstagentmesh-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.Validation
make sdk-jspasses (154 tests).TestNativeSDKMCPStdiopasses with-race.mcp-publisher validateacceptsserver.json.sdk-version.shstampsserver.jsontogether withpackage.json.agentmesh-oneand anagentmesh-nodeprovider. It discovered, described and called tools. A policy-denied call was refused, and a relaunch resumed the same peer ID.🤖 Generated with Claude Code