# Agent Mesh MCP server

> Enables AI agents to discover and call remote MCP tools and services through an authenticated peer-to-peer mesh.

- Repository: https://github.com/google/agentmesh
- Page: https://hostedmcp.org/servers/google/agentmesh
- Transport: stdio
- Stars: 1198
- License: Apache-2.0
- Latest version: 0.2.0

## Install

### Claude Code

```sh
claude mcp add --env AGENTMESH_CONTROL_PLANE_URL=<AGENTMESH_CONTROL_PLANE_URL> --env AGENTMESH_BOOTSTRAP_TOKEN_PATH=<YOUR_AGENTMESH_BOOTSTRAP_TOKEN_PATH> --env AGENTMESH_JWT_PATH=<YOUR_AGENTMESH_JWT_PATH> agentmesh -- npx -y @agentmesh-p2p/sdk
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "agentmesh": {
      "command": "npx",
      "args": [
        "-y",
        "@agentmesh-p2p/sdk"
      ],
      "env": {
        "AGENTMESH_CONTROL_PLANE_URL": "<AGENTMESH_CONTROL_PLANE_URL>",
        "AGENTMESH_BOOTSTRAP_TOKEN_PATH": "<YOUR_AGENTMESH_BOOTSTRAP_TOKEN_PATH>",
        "AGENTMESH_JWT_PATH": "<YOUR_AGENTMESH_JWT_PATH>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "agentmesh": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@agentmesh-p2p/sdk"
      ],
      "env": {
        "AGENTMESH_CONTROL_PLANE_URL": "<AGENTMESH_CONTROL_PLANE_URL>",
        "AGENTMESH_BOOTSTRAP_TOKEN_PATH": "<YOUR_AGENTMESH_BOOTSTRAP_TOKEN_PATH>",
        "AGENTMESH_JWT_PATH": "<YOUR_AGENTMESH_JWT_PATH>"
      }
    }
  }
}
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "agentmesh": {
      "command": "npx",
      "args": [
        "-y",
        "@agentmesh-p2p/sdk"
      ],
      "env": {
        "AGENTMESH_CONTROL_PLANE_URL": "<AGENTMESH_CONTROL_PLANE_URL>",
        "AGENTMESH_BOOTSTRAP_TOKEN_PATH": "<YOUR_AGENTMESH_BOOTSTRAP_TOKEN_PATH>",
        "AGENTMESH_JWT_PATH": "<YOUR_AGENTMESH_JWT_PATH>"
      }
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.agentmesh]
command = "npx"
args = ["-y", "@agentmesh-p2p/sdk"]

[mcp_servers.agentmesh.env]
AGENTMESH_CONTROL_PLANE_URL = "<AGENTMESH_CONTROL_PLANE_URL>"
AGENTMESH_BOOTSTRAP_TOKEN_PATH = "<YOUR_AGENTMESH_BOOTSTRAP_TOKEN_PATH>"
AGENTMESH_JWT_PATH = "<YOUR_AGENTMESH_JWT_PATH>"
```

### Gemini CLI (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "agentmesh": {
      "command": "npx",
      "args": [
        "-y",
        "@agentmesh-p2p/sdk"
      ],
      "env": {
        "AGENTMESH_CONTROL_PLANE_URL": "<AGENTMESH_CONTROL_PLANE_URL>",
        "AGENTMESH_BOOTSTRAP_TOKEN_PATH": "<YOUR_AGENTMESH_BOOTSTRAP_TOKEN_PATH>",
        "AGENTMESH_JWT_PATH": "<YOUR_AGENTMESH_JWT_PATH>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `AGENTMESH_CONTROL_PLANE_URL` | yes | no | Control plane URL supplied by your mesh operator. HTTPS is required beyond loopback unless explicitly permitted below. |
| `AGENTMESH_BOOTSTRAP_TOKEN_PATH` | no | yes | Absolute path to a bootstrap token file for first enrollment. Set this OR AGENTMESH_JWT_PATH; leave both empty only when resuming saved credentials. |
| `AGENTMESH_JWT_PATH` | no | yes | Absolute path to an OIDC/workload token file. Alternative to the bootstrap token; reread during credential refresh. |
| `AGENTMESH_INSECURE_CONTROL_PLANE` | no | no | Allow plaintext HTTP beyond loopback. Development only: exposes enrollment traffic to the network. |
| `AGENTMESH_STATE_DIR` | no | no | Absolute directory for this client identity. Use a distinct directory per client and mesh. If omitted, uses ~/.config/agentmesh/mcp. |

## FAQ

### How can I use Agent Mesh with an MCP client?

You can use the `agentmesh` executable which joins as a mesh member and exposes five MCP tools: get_mesh_info, discover_remote_services, find_remote_tools, describe_remote_tool, and call_remote_tool.

### Does the Agent Mesh executable publish any local services?

No, the executable does not publish any services; it is designed to discover and call remote tools. To publish services, you should use `agentmesh-node`.

### Can I use a plain HTTP control plane?

Plain HTTP is only permitted on the loopback address unless you explicitly enable it using the `AGENTMESH_INSECURE_CONTROL_PLANE=true` environment variable.
