Agent Mesh — Claude Code MCP server: remote MCP tools over a mesh
Agent Mesh is an Claude Code MCP server that enrolls the agent as a member of a mesh and exposes five tools for locating and calling remote MCP tools.
Apache-2.0 ★ 1,209 updated 2026-11-16
claude mcp add --env AGENTMESH_CONTROL_PLANE_URL=<AGENTMESH_CONTROL_PLANE_URL> --env AGENTMESH_BOOTSTRAP_TOKEN_PATH=<AGENTMESH_BOOTSTRAP_TOKEN_PATH> --env AGENTMESH_JWT_PATH=<AGENTMESH_JWT_PATH> --env AGENTMESH_STATE_DIR=<AGENTMESH_STATE_DIR> --env AGENTMESH_INSECURE_CONTROL_PLANE=<AGENTMESH_INSECURE_CONTROL_PLANE> --transport stdio js -- npx -y @agentmesh-p2p/sdkWhat Agent Mesh does
The agentmesh executable shipped in @agentmesh-p2p/sdk enrolls with the control plane on its first run and keeps that identity in a state directory; later runs pick up from there. Joined through a router, the member locates services and calls them, and it answers A2A requests under its own name. Five tools come with it: get_mesh_info, discover_remote_services, find_remote_tools, describe_remote_tool, call_remote_tool.
Node.js 22.18 or newer is required. AGENTMESH_CONTROL_PLANE_URL names the mesh, a token arrives as a file path through AGENTMESH_BOOTSTRAP_TOKEN_PATH or AGENTMESH_JWT_PATH (not both), and credentials are read from those files only. Identity sits in AGENTMESH_STATE_DIR, ~/.config/agentmesh/mcp unless changed. Plain http passes on loopback alone; elsewhere it takes AGENTMESH_INSECURE_CONTROL_PLANE=true.
This member publishes nothing, so no list_local_services tool exists, and a tool others should find by name belongs behind agentmesh-node. There is no HTTP proxy, /v1 endpoint or local socket either. Each request has a 10-second deadline and a search is bounded by providers, services and results, so a wide query gets narrowed by peer or service.
What it helps with
- find a service on the mesh by name and call its tool
- list the remote tools a provider exposes
- read a single tool's description before calling it
- join a mesh from the agent process without a node daemon
- check mesh info and the session peer ID
Example prompts for the agent
- Find the service
mcp://everythingon the mesh and call itsechotool with{"message": "hi"}. - List the remote tools that the provider
mcp://everythingexposes. - Describe the
echotool ofmcp://everything, then call it.
How to install Agent Mesh
Platform CLI
claude mcp add --env AGENTMESH_CONTROL_PLANE_URL=<AGENTMESH_CONTROL_PLANE_URL> --env AGENTMESH_BOOTSTRAP_TOKEN_PATH=<AGENTMESH_BOOTSTRAP_TOKEN_PATH> --env AGENTMESH_JWT_PATH=<AGENTMESH_JWT_PATH> --env AGENTMESH_STATE_DIR=<AGENTMESH_STATE_DIR> --env AGENTMESH_INSECURE_CONTROL_PLANE=<AGENTMESH_INSECURE_CONTROL_PLANE> --transport stdio js -- npx -y @agentmesh-p2p/sdkReplace <…> with your own values
Platform CLI
codex mcp add js --env AGENTMESH_CONTROL_PLANE_URL=<AGENTMESH_CONTROL_PLANE_URL> --env AGENTMESH_BOOTSTRAP_TOKEN_PATH=<AGENTMESH_BOOTSTRAP_TOKEN_PATH> --env AGENTMESH_JWT_PATH=<AGENTMESH_JWT_PATH> --env AGENTMESH_STATE_DIR=<AGENTMESH_STATE_DIR> --env AGENTMESH_INSECURE_CONTROL_PLANE=<AGENTMESH_INSECURE_CONTROL_PLANE> -- npx -y @agentmesh-p2p/sdkReplace <…> with your own values
Config file
{
"mcpServers": {
"js": {
"command": "npx",
"args": [
"-y",
"@agentmesh-p2p/sdk"
],
"env": {
"AGENTMESH_CONTROL_PLANE_URL": "<AGENTMESH_CONTROL_PLANE_URL>",
"AGENTMESH_BOOTSTRAP_TOKEN_PATH": "<AGENTMESH_BOOTSTRAP_TOKEN_PATH>",
"AGENTMESH_JWT_PATH": "<AGENTMESH_JWT_PATH>",
"AGENTMESH_STATE_DIR": "<AGENTMESH_STATE_DIR>",
"AGENTMESH_INSECURE_CONTROL_PLANE": "<AGENTMESH_INSECURE_CONTROL_PLANE>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"js": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@agentmesh-p2p/sdk"
],
"env": {
"AGENTMESH_CONTROL_PLANE_URL": "<AGENTMESH_CONTROL_PLANE_URL>",
"AGENTMESH_BOOTSTRAP_TOKEN_PATH": "<AGENTMESH_BOOTSTRAP_TOKEN_PATH>",
"AGENTMESH_JWT_PATH": "<AGENTMESH_JWT_PATH>",
"AGENTMESH_STATE_DIR": "<AGENTMESH_STATE_DIR>",
"AGENTMESH_INSECURE_CONTROL_PLANE": "<AGENTMESH_INSECURE_CONTROL_PLANE>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e AGENTMESH_CONTROL_PLANE_URL=<AGENTMESH_CONTROL_PLANE_URL> -e AGENTMESH_BOOTSTRAP_TOKEN_PATH=<AGENTMESH_BOOTSTRAP_TOKEN_PATH> -e AGENTMESH_JWT_PATH=<AGENTMESH_JWT_PATH> -e AGENTMESH_STATE_DIR=<AGENTMESH_STATE_DIR> -e AGENTMESH_INSECURE_CONTROL_PLANE=<AGENTMESH_INSECURE_CONTROL_PLANE> js npx -y @agentmesh-p2p/sdkReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Agent Mesh
How to install Agent Mesh in Claude Code?
With one command: `claude mcp add agentmesh -e AGENTMESH_CONTROL_PLANE_URL=<AGENTMESH_CONTROL_PLANE_URL> -e AGENTMESH_BOOTSTRAP_TOKEN_PATH=<AGENTMESH_BOOTSTRAP_TOKEN_PATH> -e AGENTMESH_JWT_PATH=<AGENTMESH_JWT_PATH> -- npx -y @agentmesh-p2p/sdk`. The mesh operator supplies the values.
What does Agent Mesh do?
It enrolls the agent with the control plane as a mesh member and gives it five tools for finding and calling remote MCP tools. It publishes no services of its own.
What do I need to run Agent Mesh?
Node.js 22.18 or newer, the control plane address in AGENTMESH_CONTROL_PLANE_URL, and a token file — bootstrap or JWT. Identity is kept in AGENTMESH_STATE_DIR.