Per-organization MCP Streamable HTTP endpoint
Model Context Protocol server (Streamable HTTP, stateless) for a single organization. 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. Each organization has its own endpoint: a token obtained for this endpoint is audience-bound (RFC 8707) to the per-org resource URI <APP_URL>/api/mcp/o/{org} and cannot drive any other organization. To use several organizations, configure one MCP server entry per organization. Without a pinned space (no space-bound credential, no /s/{space} in the URL) the connection reaches every space where the caller holds a role, and every tool that acts in a space requires a space_id argument whose schema lists them. 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.
/api/mcp/o/{org}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
Organization id (uuid). Identifies the organization this MCP endpoint is bound to.
Request Body
application/json
curl -X POST "https://your-instance/api/mcp/o/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
}
}