> ## Documentation Index
> Fetch the complete documentation index at: https://magicblock-42-supermarioblock-patch-3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP

> Stateless Streamable HTTP MCP endpoint.

Implementation details:
- Each `POST /mcp` request creates a fresh `McpServer`, handles the JSON-RPC exchange, then closes it.
- The transport runs with `sessionIdGenerator: undefined` and `enableJsonResponse: true`, so this server does not issue or require `mcp-session-id` headers.
- `GET /mcp` returns the info document and `GET /.well-known/mcp.json` returns the discovery document.
- Clients can use `Accept: application/json` with `Content-Type: application/json`.

Typical flow:
1. `initialize`
2. `notifications/initialized`
3. `tools/list` or `tools/call`

Initialize request example:
```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-11-25",
    "capabilities": {},
    "clientInfo": {
      "name": "curl-example",
      "version": "1.0.0"
    }
  }
}
```

Initialize response example:
```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-11-25",
    "capabilities": {
      "tools": {
        "listChanged": true
      }
    },
    "serverInfo": {
      "name": "spl-private-payments-api",
      "version": "0.1.0"
    }
  }
}
```

Tool call request example:
```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "spl.deposit",
    "arguments": {
      "owner": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
      "amount": 1,
      "initIfMissing": true,
      "initAtasIfMissing": true,
      "initVaultIfMissing": true,
      "idempotent": true
    }
  }
}
```



## OpenAPI

````yaml /privacy-openapi.json POST /mcp
openapi: 3.1.0
info:
  title: SPL Private Payments API
  version: 0.1.0
  description: >-
    REST API for building private SPL token transactions on Solana and
    MagicBlock ephemeral rollups.


    Documentation:
    https://docs.magicblock.gg/pages/private-ephemeral-rollups-pers/how-to-guide/quickstart
servers:
  - url: https://payments.magicblock.app
    description: Mainnet - SPL Private Payments API
security: []
paths:
  /mcp:
    post:
      tags:
        - MCP
      description: >-
        Stateless Streamable HTTP MCP endpoint.


        Implementation details:

        - Each `POST /mcp` request creates a fresh `McpServer`, handles the
        JSON-RPC exchange, then closes it.

        - The transport runs with `sessionIdGenerator: undefined` and
        `enableJsonResponse: true`, so this server does not issue or require
        `mcp-session-id` headers.

        - `GET /mcp` returns the info document and `GET /.well-known/mcp.json`
        returns the discovery document.

        - Clients can use `Accept: application/json` with `Content-Type:
        application/json`.


        Typical flow:

        1. `initialize`

        2. `notifications/initialized`

        3. `tools/list` or `tools/call`


        Initialize request example:

        ```json

        {
          "jsonrpc": "2.0",
          "id": 1,
          "method": "initialize",
          "params": {
            "protocolVersion": "2025-11-25",
            "capabilities": {},
            "clientInfo": {
              "name": "curl-example",
              "version": "1.0.0"
            }
          }
        }

        ```


        Initialize response example:

        ```json

        {
          "jsonrpc": "2.0",
          "id": 1,
          "result": {
            "protocolVersion": "2025-11-25",
            "capabilities": {
              "tools": {
                "listChanged": true
              }
            },
            "serverInfo": {
              "name": "spl-private-payments-api",
              "version": "0.1.0"
            }
          }
        }

        ```


        Tool call request example:

        ```json

        {
          "jsonrpc": "2.0",
          "id": 3,
          "method": "tools/call",
          "params": {
            "name": "spl.deposit",
            "arguments": {
              "owner": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
              "amount": 1,
              "initIfMissing": true,
              "initAtasIfMissing": true,
              "initVaultIfMissing": true,
              "idempotent": true
            }
          }
        }

        ```
      requestBody:
        required: true
        description: MCP JSON-RPC request
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                id:
                  anyOf:
                    - type: string
                    - type: number
                    - type: 'null'
                method:
                  type: string
                params: {}
              required:
                - jsonrpc
                - method
            example:
              jsonrpc: '2.0'
              id: 1
              method: initialize
              params:
                protocolVersion: '2025-11-25'
                capabilities: {}
                clientInfo:
                  name: curl-example
                  version: 1.0.0
      responses:
        '200':
          description: MCP JSON-RPC response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpResponse'
              example:
                jsonrpc: '2.0'
                id: 3
                result:
                  content:
                    - type: text
                      text: Built an unsigned SPL deposit transaction.
                  structuredContent:
                    kind: deposit
                    version: legacy
                    transactionBase64: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIDKmcfsS5XfSOLaLlaBHJry50iH2Ufk2TMz4STC2fHzIcFKkerg3q2DD3Yn8TISmGeKoxSLz+BiP7iQ4pYqXYXsgu8D8C7R8ovdMQRLpSrE8+jxjTl3BfqywPNGiPNfnh8eS+smowIxqKDcCjw5liNXQkkCbBSDCBDFwtrgCKqoQ0DAgEBBAECAwQCAQEEAgIDBAIBAQQDAgME
                    sendTo: base
                    recentBlockhash: 9A4VhP8M8fQZxP4h7rB6mP6eM8w2pJkYh7QdZk7V4r2x
                    lastValidBlockHeight: 284512337
                    instructionCount: 3
                    requiredSigners:
                      - 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
                    validator: MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57
        '202':
          description: Notification accepted; no response body is returned.
        '400':
          description: Invalid JSON or invalid JSON-RPC request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32700
                  message: Parse error
                id: null
        '415':
          description: Content-Type must be application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32000
                  message: >-
                    Unsupported Media Type: Content-Type must be
                    application/json
                id: null
        '500':
          description: MCP JSON-RPC error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal server error
                id: null
components:
  schemas:
    McpResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        id:
          anyOf:
            - type: string
            - type: number
            - type: 'null'
        result: {}
        error:
          type: object
          properties:
            code:
              type: number
            message:
              type: string
          required:
            - code
            - message
          additionalProperties: {}
      required:
        - jsonrpc
      additionalProperties: {}
      example:
        jsonrpc: '2.0'
        id: 3
        result:
          content:
            - type: text
              text: Built an unsigned SPL deposit transaction.
          structuredContent:
            kind: deposit
            version: legacy
            transactionBase64: >-
              AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIDKmcfsS5XfSOLaLlaBHJry50iH2Ufk2TMz4STC2fHzIcFKkerg3q2DD3Yn8TISmGeKoxSLz+BiP7iQ4pYqXYXsgu8D8C7R8ovdMQRLpSrE8+jxjTl3BfqywPNGiPNfnh8eS+smowIxqKDcCjw5liNXQkkCbBSDCBDFwtrgCKqoQ0DAgEBBAECAwQCAQEEAgIDBAIBAQQDAgME
            sendTo: base
            recentBlockhash: 9A4VhP8M8fQZxP4h7rB6mP6eM8w2pJkYh7QdZk7V4r2x
            lastValidBlockHeight: 284512337
            instructionCount: 3
            requiredSigners:
              - 3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE
            validator: MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57

````