Starholder API
Operation Reference

Mcp

1 operation tagged mcp.

mcp_jsonrpc_post

POST /api/v1/mcp

MCP endpoint (protocol 2026-07-28, stateless, JSON responses). Model Context Protocol server for Starholder: every operation an API key can call is a tool here, generated from this contract (AGENT_EXECUTION_STACK.md §9). Send one JSON-RPC 2.0 request per POST with the credential in X-Api-Key or Authorization: Bearer (an API key or an OAuth access token). There is no initialize handshake and no session: every request carries params._meta with io.modelcontextprotocol/protocolVersion 2026-07-28 and io.modelcontextprotocol/clientCapabilities, and the headers MCP-Protocol-Version (equal to the _meta version), Mcp-Method (equal to method) and, for tools/call, resources/read and prompts/get, Mcp-Name (equal to params.name or params.uri; =?base64?…?= for non-ASCII). Methods: server/discover, tools/list, tools/call, resources/list, resources/templates/list, resources/read, prompts/list, prompts/get. Each tools/call runs the tool's /api/v1 operation with the caller's credential, so a tool can do exactly what that route allows; the route's data is the result's structuredContent, and a route error is an isError result carrying the route's code, message and correlationId. A delete that needs confirmation answers resultType input_required with an elicitation, or returns a confirmationId to send back. Notifications receive 202 with no body. Batches, initialize, GET and DELETE are not supported.

Credentials. Any one of: X-Api-Key: <apiKey>; Authorization: Bearer <apiKey>. Accepts an API key (X-Api-Key, or Authorization: Bearer; when both are sent, Authorization is used). A room-link token is not accepted: sent in Authorization it is checked as an API key and answers 401 ERR_AUTH_INVALID, even with X-Api-Key beside it.

Authorization (ROUTE_AUTH_POLICIES; GET /api/v1/account lists the operations your credential passes):

  • mcp_jsonrpc_post: callers external_agent; mutation class none.

Parameters

NameInRequiredTypeDescription
MCP-Protocol-Versionheaderyes"2026-07-28"Equal to params._meta's io.modelcontextprotocol/protocolVersion.
Mcp-MethodheaderyesstringEqual to the JSON-RPC method.
Mcp-NameheadernostringRequired for external_agent callers (every MCP caller is one) on tools/call, resources/read and prompts/get: equal to params.name or params.uri; =?base64?<base64>?= when it is not plain ASCII.

Request body (application/json, required)

{
  "type": "object",
  "required": [
    "jsonrpc",
    "method"
  ],
  "properties": {
    "jsonrpc": {
      "const": "2.0"
    },
    "id": {
      "type": [
        "string",
        "integer"
      ],
      "description": "Absent for a notification."
    },
    "method": {
      "type": "string",
      "examples": [
        "server/discover",
        "tools/list",
        "tools/call",
        "resources/read",
        "prompts/get"
      ]
    },
    "params": {
      "type": "object",
      "required": [
        "_meta"
      ],
      "properties": {
        "_meta": {
          "type": "object",
          "required": [
            "io.modelcontextprotocol/protocolVersion",
            "io.modelcontextprotocol/clientCapabilities"
          ],
          "properties": {
            "io.modelcontextprotocol/protocolVersion": {
              "const": "2026-07-28"
            },
            "io.modelcontextprotocol/clientCapabilities": {
              "type": "object",
              "description": "The client capabilities relevant to this request, such as elicitation."
            },
            "io.modelcontextprotocol/clientInfo": {
              "type": "object",
              "description": "Optional: { name, version }."
            }
          }
        },
        "name": {
          "type": "string",
          "description": "tools/call and prompts/get."
        },
        "arguments": {
          "type": "object",
          "description": "tools/call: the tool's inputSchema; prompts/get: string arguments."
        },
        "uri": {
          "type": "string",
          "description": "resources/read."
        },
        "inputResponses": {
          "type": "object",
          "description": "tools/call retry after input_required: the answers keyed as the server asked."
        },
        "requestState": {
          "type": "string",
          "description": "tools/call retry after input_required: echoed unchanged."
        }
      }
    }
  }
}

Responses

  • 200: JSON-RPC response. Every result has resultType (complete or input_required) and _meta["io.modelcontextprotocol/serverInfo"]. tools/call results: {content:[{type:"text",text}], structuredContent, isError}.

    application/json

    {
      "type": "object",
      "required": [
        "jsonrpc",
        "id"
      ],
      "properties": {
        "jsonrpc": {
          "const": "2.0"
        },
        "id": {
          "type": [
            "string",
            "integer",
            "null"
          ]
        },
        "result": {
          "type": "object"
        },
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "integer",
              "description": "-32602 invalid params, unknown tool, resource or prompt; -32603 internal"
            },
            "message": {
              "type": "string"
            },
            "data": {}
          }
        }
      }
    }
  • 202: The message was a notification; no body.

  • 400: Not JSON (-32700); a batch, a non-request or a malformed request (-32600); a missing _meta field (-32602); a missing or mismatched MCP-Protocol-Version, Mcp-Method or Mcp-Name header (-32020); initialize or an unsupported version (-32022, data.supported lists 2026-07-28).

    application/json

    {
      "type": "object"
    }
  • 401: No credential: { "error": "unauthorized" } with WWW-Authenticate naming the OAuth protected resource metadata. A credential that fails validation: ERR_AUTH_INVALID in the AES error envelope, with error="invalid_token" in the challenge.

    application/json

    {
      "oneOf": [
        {
          "$ref": "#/components/schemas/AesErrorEnvelope"
        },
        {
          "type": "object",
          "required": [
            "error"
          ],
          "properties": {
            "error": {
              "const": "unauthorized"
            }
          }
        }
      ]
    }
  • 403: Credential is valid but the policy denies this request. ERR_PERMISSION_INTERSECTION_DENIED: a missing scope or capability, world role, risk tier, or ownership. ERR_AUTH_FORBIDDEN: the actor kind is not allowed on this operation. A human session also receives world-policy and world-membership denials here; an external agent receives them as 404. error.details.reason names the denial.

    application/json

    {
      "$ref": "#/components/schemas/AesErrorEnvelope"
    }
  • 404: Unknown method (-32601).

    application/json

    {
      "type": "object"
    }

Schemas used: #/components/responses/Forbidden, #/components/responses/Unauthenticated

Contract authored from app/api/v1/mcp/route.ts (confidence: high).

On this page