Other endpoints API
This page documents the 33 gateway endpoints tagged untagged in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| GET | / | Check that the gateway is up |
| GET | /routes | List every route the gateway serves |
| GET | /debug/asyncio-tasks | Count the background tasks on this worker |
| GET | /spanway/.well-known/spanway-ui-config | Read the settings the Admin UI needs before sign-in |
| GET | /.well-known/spanway-ui-config | Read the settings the Admin UI needs before sign-in |
| GET | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| POST | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| PUT | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| PATCH | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| DELETE | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| HEAD | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| OPTIONS | /mcp/proxy | Connect to the MCP proxy with three fixed tools |
| GET | /mcp | Connect to every MCP server the key may use |
| POST | /mcp | Connect to every MCP server the key may use |
| PUT | /mcp | Connect to every MCP server the key may use |
| PATCH | /mcp | Connect to every MCP server the key may use |
| DELETE | /mcp | Connect to every MCP server the key may use |
| HEAD | /mcp | Connect to every MCP server the key may use |
| OPTIONS | /mcp | Connect to every MCP server the key may use |
| GET | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| POST | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| PUT | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| PATCH | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| DELETE | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| HEAD | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| OPTIONS | /toolset/{toolset_name}/mcp | Connect to one MCP toolset |
| GET | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
| POST | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
| PUT | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
| PATCH | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
| DELETE | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
| HEAD | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
| OPTIONS | /{mcp_server_name}/mcp | Connect to one MCP server, toolset or access group by name |
Endpoints
GET /
Check that the gateway is up
Answer with a short fixed text when the gateway process is running, for a quick manual check or a simple load balancer probe. It needs no key, reads nothing and changes nothing. Use GET /health/readiness to check the database and cache as well.
Example request:
curl -X GET "http://localhost:4000/"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The gateway is running. | application/json string |
GET /routes
List every route the gateway serves
List the path, methods and handler name of every route this gateway serves, including routes of mounted apps such as MCP, so an operator can confirm a feature is switched on. A caller without the key or Admin UI session of a signed-in user gets 404 as if the route did not exist, because the full route map helps an attacker. It changes nothing.
Example request:
curl -X GET "http://localhost:4000/routes" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Every route with its methods. | application/json _RoutesResponse |
| 404 | Not Found | application/json ErrorDetail |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
routes | array of RouteInfo | Yes | Routes |
GET /debug/asyncio-tasks
Count the background tasks on this worker
A snapshot of the coroutines running on the worker that answered, counted by name, for spotting a background job that keeps piling up tasks. It covers one worker only, so call it several times behind a load balancer. Any valid key may call it, and the answer holds no request content.
Docs (https://docs.spanway.ai/docs/proxy/diagnostics)
Example request:
curl -X GET "http://localhost:4000/debug/asyncio-tasks" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The task counts of the worker that answered | application/json ActiveTasksStats |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
total_active_tasks | integer | Yes | Tasks on this worker's event loop that have not finished |
by_name | object | Yes | Active task count per coroutine name, at most 5000 tasks counted |
GET /spanway/.well-known/spanway-ui-config
Read the settings the Admin UI needs before sign-in
Tell the Admin UI how this gateway is set up before anyone signs in: the path it is served under, its public URL, whether single sign-on is configured and should open at once, whether the Admin UI is turned off, whether the login page may show the default credentials hint, whether MCP servers may run as local commands, and, on a control plane, the worker gateways it manages. Anyone may call it without a key, and it never returns secrets. Nothing is changed. The /spanway/ form serves the same answer when the gateway is mounted under that prefix.
Example request:
curl -X GET "http://localhost:4000/spanway/.well-known/spanway-ui-config"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The Admin UI settings of this gateway, or of a control plane with its workers | application/json UiDiscoveryEndpoints |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
server_root_path | string | Yes | The path prefix the gateway is served under, / at the root |
proxy_base_url | string or null | Yes | PROXY_BASE_URL when it is set, the public URL of the gateway |
auto_redirect_to_sso | boolean | Yes | True when the login page sends people straight to single sign-on |
admin_ui_disabled | boolean | Yes | True when DISABLE_ADMIN_UI turned the Admin UI off |
sso_configured | boolean | Yes | True when a single sign-on provider is set up for the gateway |
org_sso_configured | boolean | No | True when an organization has its own sign-on |
hide_default_credentials_hint | boolean | No | True when the login page must not show the default admin sign-in hint |
is_control_plane | boolean | No | True when this gateway manages worker gateways |
mcp_stdio_enabled | boolean | No | True when MCP servers may run as local commands |
workers | array of WorkerRegistryEntry | No | The worker gateways a control plane manages, empty otherwise |
GET /.well-known/spanway-ui-config
Read the settings the Admin UI needs before sign-in
Tell the Admin UI how this gateway is set up before anyone signs in: the path it is served under, its public URL, whether single sign-on is configured and should open at once, whether the Admin UI is turned off, whether the login page may show the default credentials hint, whether MCP servers may run as local commands, and, on a control plane, the worker gateways it manages. Anyone may call it without a key, and it never returns secrets. Nothing is changed. The /spanway/ form serves the same answer when the gateway is mounted under that prefix.
Example request:
curl -X GET "http://localhost:4000/.well-known/spanway-ui-config"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The Admin UI settings of this gateway, or of a control plane with its workers | application/json UiDiscoveryEndpoints |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
server_root_path | string | Yes | The path prefix the gateway is served under, / at the root |
proxy_base_url | string or null | Yes | PROXY_BASE_URL when it is set, the public URL of the gateway |
auto_redirect_to_sso | boolean | Yes | True when the login page sends people straight to single sign-on |
admin_ui_disabled | boolean | Yes | True when DISABLE_ADMIN_UI turned the Admin UI off |
sso_configured | boolean | Yes | True when a single sign-on provider is set up for the gateway |
org_sso_configured | boolean | No | True when an organization has its own sign-on |
hide_default_credentials_hint | boolean | No | True when the login page must not show the default admin sign-in hint |
is_control_plane | boolean | No | True when this gateway manages worker gateways |
mcp_stdio_enabled | boolean | No | True when MCP servers may run as local commands |
workers | array of WorkerRegistryEntry | No | The worker gateways a control plane manages, empty otherwise |
GET /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X GET "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
POST /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Request body (application/json, object or any):
Example request:
curl -X POST "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
PUT /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X PUT "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
PATCH /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X PATCH "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
DELETE /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X DELETE "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
HEAD /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -I "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
OPTIONS /mcp/proxy
Connect to the MCP proxy with three fixed tools
One MCP endpoint that always offers the same three tools, search_tools, get_tool_schema and call_tool, which find, describe and call the tools of every MCP server the key may use, so a client with a small tool budget can still reach all of them. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X OPTIONS "http://localhost:4000/mcp/proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
GET /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X GET "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
POST /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Request body (application/json, object or any):
Example request:
curl -X POST "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
PUT /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X PUT "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
PATCH /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X PATCH "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
DELETE /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X DELETE "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
HEAD /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -I "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
OPTIONS /mcp
Connect to every MCP server the key may use
One MCP endpoint that combines the tools of every MCP server the key may use, with each tool name prefixed by its server. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Example request:
curl -X OPTIONS "http://localhost:4000/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | MCP is not available on this gateway | application/json ErrorDetail |
GET /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
POST /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Request body (application/json, object or any):
Example request:
curl -X POST "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
PUT /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Example request:
curl -X PUT "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
PATCH /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Example request:
curl -X PATCH "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
DELETE /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Example request:
curl -X DELETE "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
HEAD /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Example request:
curl -I "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
OPTIONS /toolset/{toolset_name}/mcp
Connect to one MCP toolset
An MCP endpoint that offers exactly the tools of the named toolset, a hand picked set of tools from one or more MCP servers. Keys that are not proxy admins need the toolset in their object_permission.mcp_toolsets list. A server that still needs the caller's own OAuth sign-in or personal key lists one {server}-connect tool instead of failing the listing, and the spanway.ai/server_outcomes entry in the result's _meta gives its connect_url. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
toolset_name | path | string | Yes |
Example request:
curl -X OPTIONS "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 403 | The key is not granted this toolset | application/json ErrorDetail |
| 404 | No toolset has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the toolset | application/json ErrorDetail |
| 503 | The gateway has no database connected | application/json ErrorDetail |
GET /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Example request:
curl -X GET "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |
POST /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Request body (application/json, object or any):
Example request:
curl -X POST "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |
PUT /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Example request:
curl -X PUT "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |
PATCH /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Example request:
curl -X PATCH "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |
DELETE /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Example request:
curl -X DELETE "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |
HEAD /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Example request:
curl -I "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |
OPTIONS /{mcp_server_name}/mcp
Connect to one MCP server, toolset or access group by name
An MCP endpoint for one name or a comma separated list of names. Each name is looked up as a registered MCP server, then a toolset, then an MCP access group, and the client sees only the tools of what matched. It speaks the MCP streamable HTTP transport: POST one JSON-RPC message such as initialize, tools/list or tools/call, GET to open the server event stream, and DELETE to end the session. Connect an MCP client such as an IDE or agent with a virtual key in the Authorization or x-spanway-api-key header. The key only sees the MCP servers, toolsets and tools its team and key permissions grant, and every tool call is logged and checked by any MCP guardrails that apply.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
mcp_server_name | path | string | Yes |
Example request:
curl -X OPTIONS "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them. | application/json object |
| 401 | No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header) | application/json ErrorDetail |
| 404 | No MCP server, toolset or access group has that name | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
| 500 | The gateway failed while serving the MCP server | application/json ErrorDetail |