Space-pinned MCP Streamable HTTP endpoint

Model Context Protocol server (Streamable HTTP, stateless) for one space of an organization: the organization's endpoint pinned to {space} by its URL, usable by any client. Every call acts in {space}, and tools take no space_id. Accepts JSON-RPC 2.0 messages (initialize, tools/list, tools/call). The tools it declares follow the caller's permissions: the read-only set (search_operations, describe_operation, read_file, read_skill, validate_package_file, get_runtime_capabilities, and get_me unless the client injects its own caller context) is always present, while the acting tools — invoke_operation (mcp:invoke), run_and_wait (mcp:invoke plus agents:run and a run-read permission), list_files (whatever guards the listFiles operation's own route), import_package_file, and list_connections with api_call (mcp:invoke plus credential-proxy:call-own or credential-proxy:call, on a bearer credential the credential proxy accepts) — are declared only to a caller whose grants make them usable, so tools/list differs by role. Together they let an MCP client discover and call platform API operations, launch and wait for agent runs, and call third-party APIs through the caller's own connections (and those shared into the space, for a caller holding credential-proxy:call), with the caller's own credentials. api_call is the only MCP path to the credential proxy: /api/credential-proxy/proxy is not an operation invoke_operation serves. The endpoint is its own OAuth protected resource, <APP_URL>/api/mcp/o/{org}/s/{space} (RFC 8707, RFC 9728). It accepts a token bound to that URI or to the organization's resource <APP_URL>/api/mcp/o/{org}. A token bound to the space reaches neither another space nor the organization's endpoint, and it is capped like a space API key: no organization-level permission (member management, organization settings) is in its reach. A space-bound credential (API key or token) naming another space is a 403. Requires the mcp:read permission (and mcp:invoke to call operations). A refused tool call (missing, unknown or invalid argument, unknown operation or space, missing grant) is a tools/call result with isError: true whose text is { code, error, … }; an operation the route answered with an HTTP error is returned as { status, body } with isError: true, except a 403 the caller's permissions explain, which is a not_granted refusal. Only an unknown tool name is a JSON-RPC -32602.

POST/api/mcp/o/{org}/s/{space}

Authorization

AuthorizationBearer <token>

OIDC-issued JWT (device-flow access token for the interactive CLI, or authorization-code access token for dashboard second-party apps). X-Org-Id is required for org-scoped routes when the token is instance-level.

In: header

Path Parameters

org*string

Organization id (uuid). Identifies the organization this MCP endpoint is bound to.

space*string

Space id (spc_…) of the organization, where the caller holds a role.

Match^spc_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Request Body

application/json

curl -X POST "https://your-instance/api/mcp/o/string/s/string" \  -H "Content-Type: application/json" \  -d '{    "jsonrpc": "2.0",    "method": "string"  }'
{
  "result": {
    "structuredContent": {}
  }
}
{
  "jsonrpc": "2.0",
  "id": null,
  "error": {
    "code": 0,
    "message": "string",
    "data": null
  }
}
{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "jsonrpc": "2.0",
  "id": null,
  "error": {
    "code": 0,
    "message": "string",
    "data": null
  }
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "param": "string",
  "retry_after": 0,
  "errors": [
    {
      "field": "string",
      "code": "string",
      "message": "string",
      "title": "string",
      "line": 1,
      "column": 1,
      "candidate_connections": [
        {
          "id": "string",
          "label": "string",
          "account_id": "string",
          "owned_by_actor": true,
          "needs_reconnection": true,
          "scopes_granted": [
            "string"
          ],
          "missing_scopes": [
            "string"
          ]
        }
      ],
      "connection_id": "string",
      "missing_scopes": [
        "string"
      ],
      "remedy": "new_connection",
      "owned_by_actor": true,
      "required_scopes": [
        "string"
      ],
      "auth_key": "string",
      "required_auth_key": "string",
      "available_auth_keys": [
        "string"
      ],
      "source": "admin_pin",
      "connect_url": "http://example.com",
      "expiresAt": "2019-08-24T14:15:22Z",
      "packageId": "string"
    }
  ]
}
{
  "jsonrpc": "2.0",
  "id": null,
  "error": {
    "code": 0,
    "message": "string",
    "data": null
  }
}