# Agent 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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1209 repo stars
- Author: google · official Google repository
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/google/agentmesh/tree/HEAD/sdk/js
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/agent-mesh

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `AGENTMESH_CONTROL_PLANE_URL`, `AGENTMESH_BOOTSTRAP_TOKEN_PATH`, `AGENTMESH_JWT_PATH`, `AGENTMESH_STATE_DIR`, `AGENTMESH_INSECURE_CONTROL_PLANE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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/sdk
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
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/sdk
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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/sdk
```
Replace <…> with your own values

## When to use it
- 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
- Find the service `mcp://everything` on the mesh and call its `echo` tool with `{"message": "hi"}`.
- List the remote tools that the provider `mcp://everything` exposes.
- Describe the `echo` tool of `mcp://everything`, then call it.

## Similar
- [cline-sdk](https://affpapa.org/en/nevibecode/skills/cline-sdk.md) — skill · 5700 installs
- [pi-agent](https://affpapa.org/en/nevibecode/skills/pi-agent.md) — skill · 1500 installs
- [linear-sdk-scripting](https://affpapa.org/en/nevibecode/skills/linear-sdk-scripting.md) — skill · 1400 installs
- [catalyst-sdk](https://affpapa.org/en/nevibecode/skills/catalyst-sdk.md) — skill · 1200 installs
- [web-search](https://affpapa.org/en/nevibecode/skills/answerzhao-web-search.md) — skill · 101 installs
- [siwa](https://affpapa.org/en/nevibecode/skills/siwa.md) — skill · 100 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
