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

# MCP Server

> Connect an AI agent to Alterscope through the Model Context Protocol server.

The Alterscope MCP server exposes risk data to MCP-compatible AI clients (Claude Code, Claude Desktop, and other MCP hosts) as a set of tools and resources. It runs over the standard MCP **stdio** transport.

## Connect (Claude Code)

Build the server, then register it:

```bash theme={null}
claude mcp add --transport stdio alterscope -- node /path/to/alterscope-mcp/dist/index.js
```

Set `ALTERSCOPE_API_URL` to the API base it should read through, and pass your API key via the server's configured authorization.

## Connect (Claude Desktop)

Add an entry to `claude_desktop_config.json`:

```json theme={null}
{
  "mcpServers": {
    "alterscope": {
      "command": "node",
      "args": ["/path/to/alterscope-mcp/dist/index.js"]
    }
  }
}
```

## Tools

The server registers these tools:

| Tool                       | What it does                                                                                                                                     |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `alterscope_ping`          | Connectivity smoke check.                                                                                                                        |
| `query_risk_graph`         | Query the knowledge graph.                                                                                                                       |
| `get_regime`               | Read the current market regime.                                                                                                                  |
| `analyze_pool_risk`        | Risk decomposition for a lending pool.                                                                                                           |
| `score_strategy`           | Score a strategy.                                                                                                                                |
| `backtest_strategy`        | Backtest a strategy.                                                                                                                             |
| `simulate_strategy`        | Simulate a strategy.                                                                                                                             |
| `replay_cascade_event`     | Replay a cascade/contagion event.                                                                                                                |
| `list_yield_opportunities` | List yield opportunities.                                                                                                                        |
| `audit_position`           | Audit a position.                                                                                                                                |
| `get_rwa_rating`           | Fetch a tokenized real-world asset's [risk grade](/develop/concepts/rwa-risk-grades) — grade, score, scored/total factor counts, 30-day history. |
| `explain_rwa_rating`       | Explain a risk grade: nine-factor breakdown, plain-language drivers, and a scored/total/not-rated data-status summary.                           |

## Resources

Four Risk Graph resources are exposed under the `alterscope://graph/` URI scheme:

| Resource     | URI                                    |
| ------------ | -------------------------------------- |
| Graph node   | `alterscope://graph/node/{id}`         |
| Cascade      | `alterscope://graph/cascade/{origin}`  |
| Dependencies | `alterscope://graph/dependencies/{id}` |
| Subgraph     | `alterscope://graph/subgraph`          |

## Scopes

MCP tools are gated by `mcp:*` scopes on your API key (see [Scopes](/develop/get-started/scopes)): `mcp:read` for the read-only graph/regime/risk tools, `mcp:backtest` for `backtest_strategy` + `replay_cascade_event`, and `mcp:simulate` for `simulate_strategy`.
