# xMesh over MCP — invoke the mesh from Claude, Codex, or any MCP client

xMesh's cognition is exposed as **MCP servers** so any agent that speaks the Model Context
Protocol can invoke it — Claude Code, OpenAI Codex, Cursor, or your own. Bring your agent;
xMesh is how a mesh of them thinks together. Protocol-native and model-agnostic.

## `xmesh` — the mesh as a tool (`mcp/xmesh-mcp-server.mjs`)

Wraps the running xMesh API. Tools:

| Tool | What it does |
|---|---|
| `mesh_ask` | Ask the mesh; get a synthesized answer, every claim cited to the agent + CMB that grounded it. |
| `mesh_mission` | Hand the mesh WORK; agents self-select, work with proof, dissolve. Completes or pauses for a human. |
| `mesh_missions` | List live / awaiting-verdict missions and their status. |
| `mesh_recall` | Search the mesh's content-addressed memory along a CAT7 axis (match or semantic). |
| `mesh_canon` | Read the validated, grounded cognition (Canon) — the mesh's reality-tested knowledge. |

Env: `XMESH_URL` (default `http://localhost:8787`), `XMESH_PASSCODE` (else `~/.xmesh/passcode`).

## `camel-dryrun` — an integration capability as a tool (`skills/camel-dryrun/mcp-server.mjs`)

| Tool | What it does |
|---|---|
| `dryrun` | Execute an Apache Camel route in a secretless sandbox against mock endpoints; return a REAL pass/fail. Proves wiring+syntax+the transform; NOT idempotency/ordering/exactly-once. |

Prereq: `brew install openjdk jbang; jbang trust add https://github.com/apache/camel/; jbang app install camel@apache/camel`.

## Wiring

**Claude Code** (`.mcp.json` / `--mcp-config`):
```json
{ "mcpServers": {
  "xmesh":        { "command": "node", "args": ["<repo>/mcp/xmesh-mcp-server.mjs"] },
  "camel-dryrun": { "command": "node", "args": ["<repo>/skills/camel-dryrun/mcp-server.mjs"] }
} }
```

**Codex** (`config.toml`):
```
codex mcp add xmesh        --command "node <repo>/mcp/xmesh-mcp-server.mjs"
codex mcp add camel-dryrun --command "node <repo>/skills/camel-dryrun/mcp-server.mjs"
```

The mesh's own workers already get `camel-dryrun` as a sibling MCP server (opt-in via
`XMESH_CAMEL_TOOL=1`) — so a mission's critic invokes the dry-run through MCP, not raw Bash.
Both servers are stdio, which Claude Code and Codex both support.
