> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prysm1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> @prysmai/mcp — give Claude Desktop, Cursor, Windsurf, or any MCP client cost-aware routing as a native tool.

The PRYSM **Model Context Protocol** server lets any MCP client — Claude Desktop, Cursor,
Windsurf, and others — route prompts to the best-value model among 30+, preview costs,
estimate savings, validate a BRAIN.md, and read usage. Your agent shouldn't burn a frontier
model on a one-line task; point it at PRYSM and it can pick the cheapest model that does
the job well — no provider keys to juggle, one bill, one receipt per call.

## Install

No global install needed — your MCP client launches it on demand with `npx`.

<Tabs>
  <Tab title="Claude Desktop">
    Add to `claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "prysm": {
          "command": "npx",
          "args": ["-y", "@prysmai/mcp"],
          "env": {
            "PRYSM_API_KEY": "prysm_sk_your_key",
            "PRYSM_BASE_URL": "https://api.prysm1.com/v1"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Cursor">
    Add to `~/.cursor/mcp.json` (or **Settings → MCP → Add**):

    ```json theme={null}
    {
      "mcpServers": {
        "prysm": {
          "command": "npx",
          "args": ["-y", "@prysmai/mcp"],
          "env": { "PRYSM_API_KEY": "prysm_sk_your_key" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windsurf">
    Add to `~/.codeium/windsurf/mcp_config.json` — same `mcpServers` shape:

    ```json theme={null}
    {
      "mcpServers": {
        "prysm": {
          "command": "npx",
          "args": ["-y", "@prysmai/mcp"],
          "env": { "PRYSM_API_KEY": "prysm_sk_your_key" }
        }
      }
    }
    ```
  </Tab>
</Tabs>

Restart your client after editing the config; "prysm" then appears as a tool provider.

## Tools

| Tool                       | What it does                                                                                                                                                                                                                                        |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prysm_route`              | Preview which model PRYSM would pick + estimated cost — **no model call**.                                                                                                                                                                          |
| `prysm_chat`               | Route a prompt to the best model and return the answer (+ model, cost, proof).                                                                                                                                                                      |
| `prysm_orchestrate`        | Cross **several** models ([cascade / ensemble / debate](/concepts/orchestration)) for one robust answer + agreement score and PrysmProof. Accepts a `compliance` spec to confine the run to approved providers.                                     |
| `prysm_code`               | Generate code with a self-correcting [coder + critic loop](/concepts/code-mode) — returns reviewed, repaired files + PrysmProof.                                                                                                                    |
| `prysm_agent`              | Run a GOAL as a cost-bounded, autonomous multi-step agent (hard `max_cost_usd` ceiling enforced by [AgentGuard](/concepts/agentguard)). Returns the result + a verifiable [PrysmProof v2 trajectory](/concepts/prysmproof#trajectory-proof-v2).     |
| `prysm_compliance_preview` | Dry-run the [Policy-as-Code compliance gate](/concepts/compliance) — **no model call**. Shows the data classes a prompt triggers, which models are allowed vs excluded under the org policy, the Compliance Cost Premium, and a sample attestation. |
| `prysm_estimate_savings`   | Estimate how much you save by routing through PRYSM vs. always using a single reference model. Returns per-query breakdown + monthly projection at configurable query volume.                                                                       |
| `prysm_verify_proof`       | Verify a [PrysmProof](/concepts/prysmproof) receipt by hash or request ID. Returns validity, model, provider, mode, and timestamp.                                                                                                                  |
| `prysm_models`             | List the full model catalog with live pricing, tier, and context window.                                                                                                                                                                            |
| `prysm_brain_validate`     | Validate a `BRAIN.md` routing config against the catalog + schema.                                                                                                                                                                                  |
| `prysm_usage`              | Usage stats for the configured key: requests, tokens, cost.                                                                                                                                                                                         |

<Tip>
  A great agent pattern: call `prysm_route` first to see the cost, then `prysm_chat` to
  execute — so the agent reasons about spend before committing to a model.
</Tip>

## Configuration

| Env var          | Default                     | Description                                                        |
| ---------------- | --------------------------- | ------------------------------------------------------------------ |
| `PRYSM_API_KEY`  | —                           | Your `prysm_sk_*` key (required for `prysm_chat` / `prysm_usage`). |
| `PRYSM_BASE_URL` | `https://api.prysm1.com/v1` | API base URL (point at a self-hosted instance if needed).          |

<Note>
  The server communicates over stdio — the standard MCP transport. All diagnostics go to
  stderr, keeping the protocol channel clean.
</Note>

## What your agent gains

<CardGroup cols={2}>
  <Card title="Cost-aware by default" icon="piggy-bank">
    The agent previews the price of a task and routes to the cheapest capable model.
  </Card>

  <Card title="One key, every model" icon="key">
    27 models across 12 providers behind a single PRYSM key — no per-provider setup.
  </Card>

  <Card title="Governed by BRAIN.md" icon="file-code">
    The same [BRAIN.md](/concepts/brain-md) rules and guardrails apply to agent calls.
  </Card>

  <Card title="Verifiable" icon="fingerprint">
    Every `prysm_chat` returns a [PrysmProof](/concepts/prysmproof) of what ran.
  </Card>
</CardGroup>
