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

# MCP Server

> Drive Skia from Claude, Cursor, or any MCP client — JSON-RPC 2.0 over Streamable HTTP, 16 tools including the five-tool invoice family.

# MCP Server

Skia exposes its full surface to agents over **MCP** (JSON-RPC 2.0). One law,
two mounts:

| Mount | Where | Notes |
| - | - | - |
| Same-origin | `POST /api/mcp` on the API host | served by the Next.js engine itself |
| Hosted | `https://mcp.skia.money` (Streamable HTTP, port 3020) | the standalone Bun mini-service (`mini-services/mcp-server/`), protocol `2025-06-18` |

Both mounts are **thin honest proxies**: the MCP surface never forks
settlement logic — it forwards to the same handlers the REST routes use, with
bearer forwarding (the quote-plane discipline).

## The tool set

Sixteen tools across the family:

* **Layer + market data**: `skia_layer_info`, `skia_registry`, portfolio and
  tier reads (`skia_portfolio`, `skia_tier_status`, `skia_order_status`).
* **Settlement**: quote, commit, reveal, and the one-shot swap
  (`skia_get_quote`, `skia_commit`, `skia_reveal`, `skia_swap`).
* **The invoice family** (five tools, the locked names):
  `issue_invoice`, `acknowledge_invoice`, `pay_invoice`,
  `dispute_invoice`, `get_receivable`.

The `initialize` handshake instructions carry the invoice-family flow — an
agent that connects gets the lifecycle order (issue → acknowledge → pay →
read) without reading this site.

## Discovery

The hosted server is self-describing:

* `GET /` — human-readable discovery (transport, versions, schema pointer).
* `GET /schema` — the machine-readable tools schema (versioned snapshots of
  published versions live in the repo under `docs/mcp-schema-*.json`).
* `GET /health` — liveness.

## Connect an MCP client

Point any Streamable-HTTP MCP client at the host. For Claude Desktop /
Cursor-style configuration:

```json theme={null}
{
  "mcpServers": {
    "skia": {
      "url": "https://mcp.skia.money/mcp",
      "headers": { "Authorization": "Bearer 0x<wallet-address>" }
    }
  }
}
```

> [!NOTE]
>
> On testnet the bearer is the caller's wallet address (simulated
> ethSigAuth) — the same posture as REST. Invoice tools enforce role law
> server-side: only the issuer issues, only the debtor acknowledges, disputes,
> and pays.

## A session in three calls

```bash theme={null}
# 1. Handshake
curl -s https://mcp.skia.money/mcp -X POST \
  -H 'Content-Type: application/json' -H 'Accept: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'

# 2. List the sixteen tools
curl -s https://mcp.skia.money/mcp -X POST \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

# 3. Read a receivable (the pure fold view)
curl -s https://mcp.skia.money/mcp -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 0x<address>' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_receivable","arguments":{"invoiceId":"INV-2026-001"}}}'
```

The full agent session — initialize → tools/list → issue → acknowledge → pay
→ read — is walked through in the [agent session example](https://docs.skia.money/examples/agent-session.md).

## Where to next

* The lifecycle the invoice tools drive: [Invoices](https://docs.skia.money/concepts/invoices.md).
* The REST equivalent of every tool: [API Reference](https://docs.skia.money/api-reference/overview.md).
* SDK-side MCP client: [TypeScript SDK](https://docs.skia.money/sdk/typescript.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.