Skip to content

MCP setup

PatchMesh exposes an MCP server over Streamable HTTP (hosted, recommended — zero install) and a local stdio wrapper. Protocol messages go to stdout; logs go to stderr.

Hosted (Streamable HTTP) — recommended

Nothing to install. One command in Claude Code:

claude mcp add --transport http patchmesh \
  https://patchmesh-mcp-production.up.railway.app/mcp \
  --header "Authorization: Bearer pmk_your_key_here"

…or paste this config (Cursor & other MCP clients):

{
  "mcpServers": {
    "patchmesh": {
      "transport": "streamable-http",
      "url": "https://patchmesh-mcp-production.up.railway.app/mcp",
      "headers": { "Authorization": "Bearer pmk_your_key_here" }
    }
  }
}

Local stdio (self-hosted / offline dev)

Runs the MCP server on your machine via the Python CLI. Run patchmesh mcp install to print this, then add it to your client config (Claude Code: ~/.claude.json; Codex: ~/.codex/config).

{
  "mcpServers": {
    "patchmesh": {
      "command": "patchmesh",
      "args": ["mcp", "serve-stdio"],
      "env": {
        "PATCHMESH_API_URL": "https://patchmesh-api-production.up.railway.app",
        "PATCHMESH_API_KEY": "pmk_your_key_here"
      }
    }
  }
}

Available tools

The record tools turn an estimated saving into a measured one by accepting real, provider-reported token usage — including the cache hit/miss split. PatchMesh never infers a cache hit. The library tools (powered by Context7) ground new code in current, version-specific docs for the part no verified capsule covers — reuse first, then fetch live docs for the rest. Those docs are reference material, not verified capsules: still review and test code written from them.

  • patchmesh_search_solutions
  • patchmesh_get_solution
  • patchmesh_compare_environment
  • patchmesh_validate_outcome
  • patchmesh_record_outcome
  • patchmesh_record_usage_and_calculate_savings
  • patchmesh_record_provider_cache_usage
  • patchmesh_resolve_library
  • patchmesh_get_library_docs
  • patchmesh_create_private_capsule
  • patchmesh_request_publication