Skip to main content

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.

MethodPathSummary
GET/Check that the gateway is up
GET/routesList every route the gateway serves
GET/debug/asyncio-tasksCount the background tasks on this worker
GET/spanway/.well-known/spanway-ui-configRead the settings the Admin UI needs before sign-in
GET/.well-known/spanway-ui-configRead the settings the Admin UI needs before sign-in
GET/mcp/proxyConnect to the MCP proxy with three fixed tools
POST/mcp/proxyConnect to the MCP proxy with three fixed tools
PUT/mcp/proxyConnect to the MCP proxy with three fixed tools
PATCH/mcp/proxyConnect to the MCP proxy with three fixed tools
DELETE/mcp/proxyConnect to the MCP proxy with three fixed tools
HEAD/mcp/proxyConnect to the MCP proxy with three fixed tools
OPTIONS/mcp/proxyConnect to the MCP proxy with three fixed tools
GET/mcpConnect to every MCP server the key may use
POST/mcpConnect to every MCP server the key may use
PUT/mcpConnect to every MCP server the key may use
PATCH/mcpConnect to every MCP server the key may use
DELETE/mcpConnect to every MCP server the key may use
HEAD/mcpConnect to every MCP server the key may use
OPTIONS/mcpConnect to every MCP server the key may use
GET/toolset/{toolset_name}/mcpConnect to one MCP toolset
POST/toolset/{toolset_name}/mcpConnect to one MCP toolset
PUT/toolset/{toolset_name}/mcpConnect to one MCP toolset
PATCH/toolset/{toolset_name}/mcpConnect to one MCP toolset
DELETE/toolset/{toolset_name}/mcpConnect to one MCP toolset
HEAD/toolset/{toolset_name}/mcpConnect to one MCP toolset
OPTIONS/toolset/{toolset_name}/mcpConnect to one MCP toolset
GET/{mcp_server_name}/mcpConnect to one MCP server, toolset or access group by name
POST/{mcp_server_name}/mcpConnect to one MCP server, toolset or access group by name
PUT/{mcp_server_name}/mcpConnect to one MCP server, toolset or access group by name
PATCH/{mcp_server_name}/mcpConnect to one MCP server, toolset or access group by name
DELETE/{mcp_server_name}/mcpConnect to one MCP server, toolset or access group by name
HEAD/{mcp_server_name}/mcpConnect to one MCP server, toolset or access group by name
OPTIONS/{mcp_server_name}/mcpConnect 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:

StatusDescriptionBody
200The 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:

StatusDescriptionBody
200Every route with its methods.application/json _RoutesResponse
404Not Foundapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
routesarray of RouteInfoYesRoutes

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:

StatusDescriptionBody
200The task counts of the worker that answeredapplication/json ActiveTasksStats
401No valid key or Admin UI session was presentedapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
total_active_tasksintegerYesTasks on this worker's event loop that have not finished
by_nameobjectYesActive 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:

StatusDescriptionBody
200The Admin UI settings of this gateway, or of a control plane with its workersapplication/json UiDiscoveryEndpoints

Response fields (200):

FieldTypeRequiredDescription
server_root_pathstringYesThe path prefix the gateway is served under, / at the root
proxy_base_urlstring or nullYesPROXY_BASE_URL when it is set, the public URL of the gateway
auto_redirect_to_ssobooleanYesTrue when the login page sends people straight to single sign-on
admin_ui_disabledbooleanYesTrue when DISABLE_ADMIN_UI turned the Admin UI off
sso_configuredbooleanYesTrue when a single sign-on provider is set up for the gateway
org_sso_configuredbooleanNoTrue when an organization has its own sign-on
hide_default_credentials_hintbooleanNoTrue when the login page must not show the default admin sign-in hint
is_control_planebooleanNoTrue when this gateway manages worker gateways
mcp_stdio_enabledbooleanNoTrue when MCP servers may run as local commands
workersarray of WorkerRegistryEntryNoThe 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:

StatusDescriptionBody
200The Admin UI settings of this gateway, or of a control plane with its workersapplication/json UiDiscoveryEndpoints

Response fields (200):

FieldTypeRequiredDescription
server_root_pathstringYesThe path prefix the gateway is served under, / at the root
proxy_base_urlstring or nullYesPROXY_BASE_URL when it is set, the public URL of the gateway
auto_redirect_to_ssobooleanYesTrue when the login page sends people straight to single sign-on
admin_ui_disabledbooleanYesTrue when DISABLE_ADMIN_UI turned the Admin UI off
sso_configuredbooleanYesTrue when a single sign-on provider is set up for the gateway
org_sso_configuredbooleanNoTrue when an organization has its own sign-on
hide_default_credentials_hintbooleanNoTrue when the login page must not show the default admin sign-in hint
is_control_planebooleanNoTrue when this gateway manages worker gateways
mcp_stdio_enabledbooleanNoTrue when MCP servers may run as local commands
workersarray of WorkerRegistryEntryNoThe 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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404MCP is not available on this gatewayapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

Example request:

curl -X GET "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

Example request:

curl -X PUT "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

Example request:

curl -X PATCH "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

Example request:

curl -X DELETE "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

Example request:

curl -I "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
toolset_namepathstringYes

Example request:

curl -X OPTIONS "http://localhost:4000/toolset/toolset_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
403The key is not granted this toolsetapplication/json ErrorDetail
404No toolset has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the toolsetapplication/json ErrorDetail
503The gateway has no database connectedapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

Example request:

curl -X GET "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

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:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

Example request:

curl -X PUT "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

Example request:

curl -X PATCH "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

Example request:

curl -X DELETE "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

Example request:

curl -I "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/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:

NameInTypeRequiredDescription
mcp_server_namepathstringYes

Example request:

curl -X OPTIONS "http://localhost:4000/mcp_server_name-123/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The JSON-RPC answer, as one JSON body or as server-sent events when the client accepts them.application/json object
401No valid key was sent, or an OAuth server needs the user to sign in first (see the WWW-Authenticate header)application/json ErrorDetail
404No MCP server, toolset or access group has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The gateway failed while serving the MCP serverapplication/json ErrorDetail