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

# Call the hosted MCP endpoint



## OpenAPI

````yaml /openapi.json post /mcp
openapi: 3.1.0
info:
  title: Peel API
  version: '2026-03-21'
  description: >-
    Public Peel API for creating APIs from URLs, inspecting them, calling
    generated endpoints, revising builds, and exporting OpenAPI or MCP
    definitions.
servers:
  - url: https://api.peel.sh
security: []
tags:
  - name: APIs
    description: Create, list, inspect, revise, rebuild, and export APIs.
  - name: Account
    description: Credits and account usage surfaces used by CLI, REST, and MCP clients.
  - name: Device Auth
    description: CLI browser-login device flow helpers.
  - name: Endpoint Execution
    description: Execute generated endpoints through a stable API resource.
  - name: OAuth
    description: OAuth discovery and token flows for hosted MCP clients.
  - name: MCP
    description: Hosted MCP transport and discovery surface.
paths:
  /mcp:
    post:
      tags:
        - MCP
      summary: Call the hosted MCP endpoint
      operationId: postMcpJsonRpcPublic
      parameters:
        - in: header
          name: Accept
          schema:
            type: string
          description: Should include "application/json" and "text/event-stream".
        - in: header
          name: MCP-Protocol-Version
          schema:
            type: string
            enum:
              - '2025-11-25'
              - '2025-03-26'
          description: >-
            Use the negotiated MCP protocol version on requests after
            initialize. If omitted, the server falls back to 2025-03-26 for
            backward compatibility.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/McpRequest'
            examples:
              initialize:
                summary: Initialize an MCP session
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: initialize
                  params:
                    protocolVersion: '2025-11-25'
                    capabilities: {}
                    clientInfo:
                      name: example-client
                      version: 1.0.0
              listTools:
                summary: List available tools
                value:
                  jsonrpc: '2.0'
                  id: 2
                  method: tools/list
                  params: {}
              callEndpoint:
                summary: Call a Peel endpoint through MCP
                value:
                  jsonrpc: '2.0'
                  id: 3
                  method: tools/call
                  params:
                    name: call_endpoint
                    arguments:
                      api_id: 11111111-1111-4111-8111-111111111111
                      endpoint_name: list_items
                      params: {}
              callSessionEndpoint:
                summary: Call a session-backed Peel endpoint through MCP
                value:
                  jsonrpc: '2.0'
                  id: 4
                  method: tools/call
                  params:
                    name: call_endpoint
                    arguments:
                      api_id: 11111111-1111-4111-8111-111111111111
                      endpoint_name: list_orders
                      params:
                        status: open
                      session_id: sess_example
                      encryption_key: enc_example
      responses:
        '200':
          description: JSON-RPC result or error envelope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpJsonRpcResponse'
        '202':
          description: >-
            Accepted notification or notification-only request with no response
            body.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          description: The client did not advertise a compatible Accept header.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - OAuthBearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    McpRequest:
      anyOf:
        - $ref: '#/components/schemas/McpInitializeRequest'
        - $ref: '#/components/schemas/McpToolsListRequest'
        - $ref: '#/components/schemas/McpToolsCallRequest'
        - $ref: '#/components/schemas/McpPingRequest'
        - $ref: '#/components/schemas/McpInitializedNotification'
        - $ref: '#/components/schemas/McpGenericRequest'
    McpJsonRpcResponse:
      oneOf:
        - $ref: '#/components/schemas/McpJsonRpcSuccess'
        - $ref: '#/components/schemas/McpJsonRpcError'
    McpInitializeRequest:
      type: object
      required:
        - jsonrpc
        - method
        - params
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        method:
          type: string
          const: initialize
        params:
          type: object
          required:
            - protocolVersion
            - capabilities
            - clientInfo
          properties:
            protocolVersion:
              type: string
              enum:
                - '2025-11-25'
                - '2025-03-26'
            capabilities:
              type: object
              additionalProperties: true
            clientInfo:
              type: object
              required:
                - name
                - version
              properties:
                name:
                  type: string
                version:
                  type: string
              additionalProperties: true
          additionalProperties: true
      additionalProperties: true
    McpToolsListRequest:
      type: object
      required:
        - jsonrpc
        - method
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        method:
          type: string
          const: tools/list
        params:
          type: object
          properties:
            cursor:
              type: string
          additionalProperties: true
      additionalProperties: true
    McpToolsCallRequest:
      type: object
      required:
        - jsonrpc
        - method
        - params
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        method:
          type: string
          const: tools/call
        params:
          type: object
          required:
            - name
          properties:
            name:
              type: string
            arguments:
              type: object
              additionalProperties: true
          additionalProperties: true
      additionalProperties: true
    McpPingRequest:
      type: object
      required:
        - jsonrpc
        - method
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        method:
          type: string
          const: ping
      additionalProperties: true
    McpInitializedNotification:
      type: object
      required:
        - jsonrpc
        - method
      properties:
        jsonrpc:
          type: string
          const: '2.0'
        method:
          type: string
          const: notifications/initialized
      additionalProperties: true
    McpGenericRequest:
      type: object
      required:
        - jsonrpc
        - method
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        method:
          type: string
        params:
          oneOf:
            - type: array
            - type: object
            - type: 'null'
      additionalProperties: true
    McpJsonRpcSuccess:
      type: object
      required:
        - jsonrpc
        - result
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        result:
          $ref: '#/components/schemas/McpJsonValue'
      additionalProperties: false
    McpJsonRpcError:
      type: object
      required:
        - jsonrpc
        - error
      properties:
        id:
          oneOf:
            - type: string
            - type: number
            - type: 'null'
        jsonrpc:
          type: string
          const: '2.0'
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: integer
            message:
              type: string
            data:
              $ref: '#/components/schemas/McpJsonValue'
          additionalProperties: true
      additionalProperties: false
    McpJsonValue:
      oneOf:
        - type: object
          additionalProperties: true
        - type: array
          items: {}
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            additionalProperties: true
    Unauthorized:
      description: Missing or invalid auth.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: OAuth bearer challenge with MCP resource metadata when available.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            additionalProperties: true
  securitySchemes:
    OAuthBearerAuth:
      type: http
      scheme: bearer
      description: OAuth bearer token issued by Peel for hosted MCP clients.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````