MCP connections
10 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.
The remote MCP servers kosa8 connects in one click#
/v1/mcp/connectorsscope sandboxes:readEach publisher's own hosted server, checked live. kosa8 is the OAuth client: it discovers the server's authorization server (RFC 9728, RFC 8414), registers itself (RFC 7591), a Client ID Metadata Document, or uses a client the kosa8 team registered, signs in with PKCE S256 and the resource parameter (RFC 8707), and keeps the tokens sealed per organization. No route returns a token. Agents and sandboxes reach the server through the gateway, POST /v1/mcp/gw/{id}, which adds the token and records every tools/call in the audit log (mcp.call).
Responsescurl -s -X GET https://api.kosa8.com/v1/mcp/connectors \ -H "Authorization: Bearer $KOSA8_API_KEY"
This organization's connected MCP servers#
/v1/mcp/connectionsscope sandboxes:readcurl -s -X GET https://api.kosa8.com/v1/mcp/connections \ -H "Authorization: Bearer $KOSA8_API_KEY"
Connect a remote MCP server by its URL#
/v1/mcp/connectionsscope adminLike a custom connector. The URL must be public https on port 443 (no IP address, private address or kosa8 host); discovery follows at most one redirect. Its id is custom-<name>.
JSON bodyurlrequiredstringnamestringkeystringcurl -s -X POST https://api.kosa8.com/v1/mcp/connections \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Connect a catalog MCP server: sign in, or a key#
/v1/mcp/connections/{id}/connectscope adminFrom the dashboard this also sets a short-lived, HttpOnly cookie that binds the sign-in to this browser and person; the provider redirects to https://app.kosa8.com/oauth/mcp/callback, which checks it, swaps the code, checks the token's audience and that it works, and returns to Integrations with ?result=connected or an error code (denied, expired, state_mismatch, invalid_grant, audience_mismatch, token_rejected, needs_client, …).
Parametersidrequiredpath · stringkeystringcurl -s -X POST https://api.kosa8.com/v1/mcp/connections/$SBX/connect \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
Refresh a connected server's token now#
/v1/mcp/connections/{id}/refreshscope sandboxes:writekosa8 also refreshes on its own a minute before expiry and on a 401. A refused refresh sets status reconnect (409 reconnect). Audited as mcp.refresh.
Parametersidrequiredpath · stringcurl -s -X POST https://api.kosa8.com/v1/mcp/connections/$SBX/refresh \ -H "Authorization: Bearer $KOSA8_API_KEY"
Check a connected server: initialize and list its tools#
/v1/mcp/connections/{id}/testscope sandboxes:writeidrequiredpath · stringcurl -s -X POST https://api.kosa8.com/v1/mcp/connections/$SBX/test \ -H "Authorization: Bearer $KOSA8_API_KEY"
Disconnect a server: revoke at the provider and forget the tokens#
/v1/mcp/connections/{id}scope adminAudited as mcp.disconnect.
Parametersidrequiredpath · stringcurl -s -X DELETE https://api.kosa8.com/v1/mcp/connections/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"
The kosa8 MCP gateway: send MCP messages to a connected server#
/v1/mcp/gw/{id}scope sandboxes:writeMCP Streamable HTTP, proxied: point any MCP client at https://api.kosa8.com/v1/mcp/gw/{id} with Authorization: Bearer <a kosa8 API key with sandboxes:write>, or, inside a sandbox created with mcp, $KOSA8_MCP_URL/{id} with $KOSA8_MCP_TOKEN (its egress broker swaps in the real token). kosa8 adds the server's token, refreshes it when needed, passes Mcp-Session-Id both ways and streams the answer. Every tools/call is an audit event (mcp.call: server and tool, never arguments). Errors are JSON-RPC errors whose data.code is reconnect, not_connected, forbidden, …. Example: claude mcp add --transport http linear https://api.kosa8.com/v1/mcp/gw/linear --header "Authorization: Bearer $KOSA8_API_KEY"
Parametersidrequiredpath · stringcurl -s -X POST https://api.kosa8.com/v1/mcp/gw/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
The gateway: the server's event stream#
/v1/mcp/gw/{id}scope sandboxes:writeMCP Streamable HTTP, proxied: point any MCP client at https://api.kosa8.com/v1/mcp/gw/{id} with Authorization: Bearer <a kosa8 API key with sandboxes:write>, or, inside a sandbox created with mcp, $KOSA8_MCP_URL/{id} with $KOSA8_MCP_TOKEN (its egress broker swaps in the real token). kosa8 adds the server's token, refreshes it when needed, passes Mcp-Session-Id both ways and streams the answer. Every tools/call is an audit event (mcp.call: server and tool, never arguments). Errors are JSON-RPC errors whose data.code is reconnect, not_connected, forbidden, …. Example: claude mcp add --transport http linear https://api.kosa8.com/v1/mcp/gw/linear --header "Authorization: Bearer $KOSA8_API_KEY"
Parametersidrequiredpath · stringcurl -s -X GET https://api.kosa8.com/v1/mcp/gw/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"
The gateway: end the MCP session#
/v1/mcp/gw/{id}scope sandboxes:writeMCP Streamable HTTP, proxied: point any MCP client at https://api.kosa8.com/v1/mcp/gw/{id} with Authorization: Bearer <a kosa8 API key with sandboxes:write>, or, inside a sandbox created with mcp, $KOSA8_MCP_URL/{id} with $KOSA8_MCP_TOKEN (its egress broker swaps in the real token). kosa8 adds the server's token, refreshes it when needed, passes Mcp-Session-Id both ways and streams the answer. Every tools/call is an audit event (mcp.call: server and tool, never arguments). Errors are JSON-RPC errors whose data.code is reconnect, not_connected, forbidden, …. Example: claude mcp add --transport http linear https://api.kosa8.com/v1/mcp/gw/linear --header "Authorization: Bearer $KOSA8_API_KEY"
Parametersidrequiredpath · stringcurl -s -X DELETE https://api.kosa8.com/v1/mcp/gw/$SBX \ -H "Authorization: Bearer $KOSA8_API_KEY"