Skip to main content

Admin MCP server

The admin MCP server turns the gateway's own management API into MCP tools, so an agent can create keys, add model deployments, manage teams, budgets and members, and inspect spend and request logs on your behalf. It is a reviewed catalogue of 65 operations with stable tool names such as create_key, add_model, list_teams and update_budget, plus two read only helpers, describe_admin_tool and read_admin_result. Request schemas are discovered from the gateway's /openapi.json, so only operations present on your gateway are exposed, and the gateway enforces every caller's permissions and licence as usual. Nothing an agent does through it goes beyond what the signed-in person could do in the Admin UI.

A real-world scenario​

A platform engineer is paged because a team's budget ran out on a Friday evening. From the desktop assistant already connected to the admin MCP server, they ask it to show the team's spend for the week, raise the budget by 20 percent and create a temporary key for the on-call developer. The assistant calls get_team_spend_report, update_budget and create_key. Each call runs as the engineer, with their proxy admin role, and each one writes an audit row that names them, the hash of the key they used and the address they called from, so Monday's review shows exactly who changed what and from where.

Turn on the hosted server​

The hosted server is an enterprise feature. With SPANWAY_ENABLE_ADMIN_MCP=true and a licence without the admin_mcp feature, the whole gateway stops at startup with the licence error, so add the feature before you set the variable. It runs on Python 3.12 or newer and needs the admin MCP dependency group, which the Spanway image bundles.

  1. Set SPANWAY_ENABLE_ADMIN_MCP=true on every instance and restart. The whole /admin prefix is reserved for it, so rename any MCP server alias called admin first.

  2. In the Admin UI, open MCP Servers and the Connect tab. The Hosted admin MCP server card now reads On, shows the URL to point a client at, whether clients can sign in with OAuth and whether only read tools are exposed. The card reads GET /v1/mcp/admin_server:

    curl http://localhost:4000/v1/mcp/admin_server -H "Authorization: Bearer $SPANWAY_MASTER_KEY"

    Expected result:

    {"enabled": true, "licensed": true, "oauth_sign_in": true, "read_only": false, "path": "/admin/mcp", "min_role": "proxy_admin"}
  3. Add the server to your MCP client with a proxy admin key, or let the client sign in with OAuth as described below:

    {
    "mcpServers": {
    "spanway-admin": {
    "url": "https://gateway.example.com/admin/mcp",
    "headers": {"Authorization": "Bearer sk-admin-key"}
    }
    }
    }
  4. Ask the assistant to list the gateway's teams. It calls list_teams and the result matches Teams in the Admin UI. On Logs, on the Audit Logs tab, filter the table to Admin MCP tools. A row with the action Invoked names the tool and you.

Each client sends its own bearer credential, the hosted server never holds one. The call is replayed against the management API inside the same process with the caller's identity headers and client address and the gateway's spanway_key_header_name, user_header_mappings and mcp_client_id_header settings respected, so audit logs name the person behind the agent and the allowed_ips of the caller's key, team and organization apply exactly as they do to direct management calls.

Every setting below is an environment variable read when the gateway starts, so a change needs a restart. The person who runs the gateway changes them, usually after a proxy admin decides who may manage the gateway from an assistant. A value the gateway does not accept stops it from starting, see Startup errors.

VariableDefaultWhat it does, in plain wordsOn or setOff or unset
SPANWAY_ENABLE_ADMIN_MCPfalseTurns the hosted admin MCP server on, so an assistant can manage the gateway for the person who signed it in. Accepts true or false.The server answers at /admin/mcp, licence permitting, and the whole /admin prefix is reserved for it.Nothing is served at /admin, and a request there gets 404.
SPANWAY_ADMIN_MCP_MIN_ROLEproxy_adminThe lowest role that may connect at all: proxy_admin, org_admin, team_admin or internal_user. Lower it when team leads or developers should use their own assistant, for example to settle their team's access requests.People at or above the role connect and see only the tools their role reaches.Only proxy admins connect.
SPANWAY_MCP_PUBLIC_URLPROXY_BASE_URLThe public HTTPS address clients use to reach the server. Requests that name another host are refused, which protects against DNS rebinding attacks.Requests for that origin and for localhost are accepted.Only PROXY_BASE_URL and localhost are accepted.
SPANWAY_ADMIN_READ_ONLYfalseShows only the tools that read, so an assistant can look things up but never change anything. Accepts true, false, 1 or 0.Every write tool, the decision tools included, is hidden and refused.Write tools are offered to the roles that reach them.
SPANWAY_ADMIN_TOOLSallA comma separated allow list of tool names, including the Spanway tools listed below, for when an assistant should reach only a few tools. An unknown name stops the gateway from starting.Only the listed tools are offered.Every tool the caller's role reaches is offered.
SPANWAY_ADMIN_RESPONSE_VIEWfull on the hosted server, compact in the standalone connectorHow results come back, full or compact. full returns them whole. compact returns results over 16 KB as an index the assistant pages through with read_admin_result, which keeps its context small.compact saves tokens on big lists.full returns every result in one piece.
SPANWAY_ADMIN_SCHEMA_MODEfullHow much of each tool's input schema the assistant is shown: full or discovery, which advertises a short schema and lets the assistant call describe_admin_tool for the rest.discovery makes the tool list smaller.full advertises every field up front.

GET /admin/healthz reports the server version without a bearer credential, which makes it a cheap probe for load balancers. It still needs the admin_mcp licence feature. In componentized deployments route /admin to the backend service, since the gateway component does not serve it.

Roles​

Every tool has a minimum role, and a caller only sees and can only call the tools its role reaches. The ladder is proxy_admin, then org_admin, then team admin, which is an internal user who is an admin of at least one team, then internal_user. Below the minimum role a call is refused before it reaches the management API, and above it the management API still decides what the caller can see and change, so an internal user listing keys gets its own keys and a team admin adding a member can only add to a team it administers. Viewer roles get the read tools of their level and never a write. A proxy_admin_viewer caller is admitted when SPANWAY_ADMIN_MCP_MIN_ROLE is below proxy_admin, and an internal_user_viewer caller only when it is internal_user. Tools nobody has ranked yet default to proxy_admin.

Minimum roleTools
internal_userReading models, keys, the caller's own user record, activity, teams and team membership, creating, updating, regenerating and deleting the caller's own keys, checking key health, the agent and MCP server read tools, the reviewer tools for queues the caller is assigned to, reading access requests the caller may see, and reading routing presets.
team adminTeam member and key changes inside a team, single team permission updates, reading team callbacks, team activity, spend by user and request logs, approving and rejecting access requests that target a team the caller administers, and rolling back that team's routing presets.
org_adminCreating, deleting, blocking and unblocking teams, adding and deleting team callbacks and other team logging changes, bulk team permission updates, organizations, organization activity and the user list.
proxy_adminModel deployments, service account keys, bulk key updates, spend resets, team model access, spend reports, budgets, evals, guardrails, review queue management and calibration, and guardrail policy attachments.

Spanway tools​

Alongside the reviewed catalogue the hosted server adds tools for Spanway features. They are merged into the catalogue when the mount starts and appear only when the matching route is served. The read tools are list_eval_datasets, get_eval_dataset, list_eval_runs, get_eval_run, list_eval_results, list_eval_scorers, list_eval_schedules, list_red_team_runs, get_red_team_run and list_red_team_results for evals, list_guardrails, get_guardrail and get_guardrails_usage for guardrails, list_agents and get_agent for agents, and list_mcp_servers, get_mcp_server and check_mcp_server_health for MCP servers.

The decision tools let an agent work a queue or settle a request on the caller's behalf. Each write is marked with destructiveHint, carries a body with the same fields as the route, is refused below its minimum role before it reaches the management API, and is hidden entirely when SPANWAY_ADMIN_READ_ONLY is on.

AreaToolsWhat they do
Human reviewlist_assigned_review_queues, claim_review_item, get_review_item, label_review_item, skip_review_itemA reviewer lists the queues assigned to them, claims the next item for 30 minutes, reads it, labels it pass or fail with an optional score and comment, or skips it. Only users named on the queue can use them, as in the Review page.
Review queue managementlist_review_queues, get_review_queue, list_review_items, get_review_calibration, get_review_board, get_reviewer_agreement, assign_review_items, unassign_review_itemsProxy admins and admin viewers read queues, their items with the consensus, the calibration report that compares human labels with each judge, the assignment board and the reviewer agreement report. Proxy admins also share pending items out to reviewers and take them back, and each of those writes an audit row.
Access requestslist_access_requests, get_access_request, approve_access_request, reject_access_requestAnyone lists and reads the requests they may see. A team admin approves or rejects requests that target a team they administer, a proxy admin any request. Approval applies the change at once, exactly as the Access Requests page does.
Guardrail policy attachmentslist_policies, list_policy_attachments, get_policy_attachment, attach_policy, detach_policyA proxy admin attaches a named policy to teams, keys, models or tags and removes an attachment.
Routing presetslist_routing_presets, get_routing_preset, list_routing_preset_versions, rollback_routing_presetAn agent lists the presets a caller may use and reads one with its versions. To let a key use a preset, its models must allow the preset's models, which update_key can set, and the caller then sends @preset/<slug> as the model. A @preset/<slug> entry in a key's models grants nothing. A team admin rolls a team preset back to an earlier version, a proxy admin any preset.

Settling access requests and review items from an agent​

A team lead has a coding agent connected to the gateway and wants to clear the team's pending access requests and label a few review items without opening the Admin UI. The gateway runs with SPANWAY_ADMIN_MCP_MIN_ROLE=team_admin so team admins may connect.

  1. In the Admin UI open MCP Servers in the AI Gateway group, choose the Connect tab and copy the URL from the Hosted admin MCP server card. The card is shown to proxy admins and admin viewers. A team lead asks an admin for the URL, which is always https://<gateway>/admin/mcp.
  2. Add the server to the agent's MCP configuration with the team lead's own virtual key as the bearer token, or let the client sign in with OAuth. When general_settings.mcp_client_id_header is set, send that header too, for example X-MCP-Client: coding-agent, so the audit log names the client.
  3. Ask the agent to list the pending requests for the team. It calls list_access_requests with query.status pending and query.team_id, and shows the requester, type and justification of each.
  4. Ask it to approve one. It calls approve_access_request with body.request_id and an optional body.review_note. The same call from the command line is one JSON-RPC request:
curl -X POST "$SPANWAY_URL/admin/mcp" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-H "X-MCP-Client: coding-agent" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "approve_access_request",
"arguments": {"body": {"request_id": "req_6a1f", "review_note": "Nightly evals, approved"}}
}
}'
  1. Ask it to label the next review item in a queue the team lead is assigned to. It calls claim_review_item with path.queue_id, shows the input and response, then label_review_item with path.review_item_id and body.passed, body.score and body.comment.
  2. In the Admin UI open Logs in the OBSERVABILITY group, choose the Audit Logs tab and filter the table to Admin MCP tools. Filter it to Access requests to see the row for the approved request itself.

Expected result. The approve call answers with the request now approved and the applied outcome, the same body POST /access_request/approve returns, and the requester gets the usual email when email is configured. A request that targets another team is refused with "Gateway returned HTTP 403. Check gateway state before retrying this change." and nothing changes. The audit log shows one row per call with the tool name as the object, the team lead as the actor, succeeded, failed or denied as the outcome, coding-agent as the client, and the team lead's key hash and address. The requester sees the approved request and the new key or access on the Access Requests page.

Secrets and audit​

Tool results never carry stored secrets. Provider parameters, API keys, tokens, passwords and client secrets are redacted by the connector, and the hosted server additionally redacts credentials, static_headers, extra_headers, env, auth_value, private keys and cloud credentials at any depth. A newly created or rotated virtual key is still returned once, inline, to the caller that asked for it. When audit logging is on, every catalogue tool call, including reads and refused calls, writes an audit row with action invoked, table_name Spanway_AdminMCPTool, the tool name as object_id and the caller as changed_by, and the row records whether the call succeeded, failed or was refused, never its arguments or result. The row also records which MCP client made the call as client. When general_settings.mcp_client_id_header is set, the label is that header's value, replaced by the alias from mcp_allowed_clients when the value is listed there. Otherwise it is the client's User-Agent. Control characters are removed and the label is cut at 120 characters, and the field is left out when the client sent neither header. The row also carries the caller's address as ip, the X-Request-ID header as request_id when the client sent one, and the SHA-256 hash of the bearer credential as changed_by_api_key, never the credential itself. A signed-in user whose role is below SPANWAY_ADMIN_MCP_MIN_ROLE is refused before any tool runs, and each of those requests writes a refused row with connector as object_id. An OAuth session refused before the call reaches a tool, because the address is outside a team or organization allowed_ips, the user is no longer active or the gateway cannot read those allow lists, writes a refused row with oauth_session as object_id, the status and the reason. A token that names no user, such as a malformed or expired one, writes no row, so anonymous callers cannot fill the audit log.

A write also produces the usual row for the object it changed when that route writes one: access request approvals and rejections on Spanway_AccessRequestTable, policy attachments on Spanway_PolicyAttachmentTable, and routing preset rollbacks on Spanway_RoutingPresetTable with the version that was live before and the version restored. Claiming, labelling and skipping a review item write no object row, because a label is stored with the reviewer and the time on the review item itself, so the invoked row is their audit record. In the Admin UI audit log the tool rows show the action Invoked and are filtered by the Admin MCP tools table. Invoked also marks policy replays and inspector dry runs, so filter by table, not by action.

Signing in with OAuth​

MCP clients that support OAuth can connect without a pasted key.

  1. Add https://gateway.example.com/admin/mcp to the client with no credential. The client receives a 401 with a WWW-Authenticate header naming /.well-known/oauth-protected-resource/admin/mcp, whose authorization server is the gateway itself.
  2. The client registers, sends you through Spanway sign-in and a consent page with PKCE, and redeems the code with resource set to https://gateway.example.com/admin/mcp.
  3. The access token it receives lives one hour, is accepted only at /admin/mcp and is refused by every other route and by the aggregate /mcp endpoint. The refresh token renews it for up to 14 days while the user stays active. The client ends the session early by sending the refresh token to /revoke. Each request re-reads the user, so a role change or a deactivation applies on the next call.

OAuth sessions act as the user with no key or team attached, so there is no key level allowed_ips to check. Instead every request checks the caller's address against the allowed_ips of every team the user belongs to and every organization of the user and of those teams, and it is refused with 403 unless all of them allow it. This applies to proxy admins too. If those lists cannot be read the request is refused with 503.

The authorization server only issues and renews admin connector tokens while SPANWAY_ENABLE_ADMIN_MCP is on, the licence includes admin_mcp and UI login is on. Because the connector turns each OAuth session into the same encrypted session credential the Admin UI uses, setting EXPERIMENTAL_UI_LOGIN=false turns OAuth sign-in off, and a request with an admin connector token then gets a 503 that says so. Pasted virtual keys keep working either way.

Standalone connector​

The same server ships as a standalone connector inside the published spanway-admin-agent image, so an MCP client can run it locally with Docker. It reads SPANWAY_BASE_URL and SPANWAY_API_KEY from its environment and calls the gateway over HTTPS with that personal proxy admin key, which keeps the credential in the client's secret storage rather than in chat. The standalone connector requires a proxy admin identity for every tool, and the same SPANWAY_ADMIN_READ_ONLY, SPANWAY_ADMIN_TOOLS and SPANWAY_ADMIN_SCHEMA_MODE variables apply. Its SPANWAY_ADMIN_RESPONSE_VIEW defaults to compact, not full, because a desktop assistant benefits most from small results. The registry address and pull credentials are in your onboarding pack.

To run it for one desktop MCP client over stdio, point the client at docker run -i with the connector as the entrypoint:

{
"mcpServers": {
"spanway-admin": {
"command": "docker",
"args": ["run", "-i", "--rm", "--entrypoint", "/opt/admin-assistant/bin/spanway-admin-mcp",
"-e", "SPANWAY_BASE_URL", "-e", "SPANWAY_API_KEY", "registry.spanway.ai/spanway/spanway-admin-agent:<tag>"],
"env": {"SPANWAY_BASE_URL": "https://gateway.example.com", "SPANWAY_API_KEY": "<your-personal-proxy-admin-key>"}
}
}
}

The client starts a fresh container each time it starts the server, so changing <tag> to a newer release and restarting the client is the whole upgrade. To serve the connector to remote clients over Streamable HTTP, run the same image with the HTTP transport:

docker run --rm -p 127.0.0.1:8080:8080 \
--entrypoint /opt/admin-assistant/bin/spanway-admin-mcp \
-e SPANWAY_BASE_URL=https://gateway.example.com \
-e SPANWAY_MCP_PUBLIC_URL=https://admin-mcp.example.com \
registry.spanway.ai/spanway/spanway-admin-agent:<tag> \
--transport streamable-http --host 0.0.0.0 --port 8080

Put an HTTPS reverse proxy in front of port 8080. The standalone MCP endpoint is /mcp and its health endpoint is /healthz, and each client sends its own proxy admin key as a bearer token.

Results​

With SPANWAY_ADMIN_RESPONSE_VIEW=full, the hosted server's default, every result comes back whole. With compact, the standalone connector's default, results up to 16 KB of compact JSON are returned whole and larger results come back as an index with complete small values, record previews, unread field counts and exact read and next arguments for read_admin_result, which pages through the saved result without repeating the operation. A newly created or rotated key is always delivered inline and never cached. Reading a write's result never repeats the write, so an agent should not re-run a create, rotate or delete just to see a different view.

Errors​

Tool and connector errors​

Tool errors come back as an MCP result with isError true and one line of text, inside an HTTP 200. Transport errors use the HTTP status. Every gateway error on a write ends with "Check gateway state before retrying this change.", because the connector cannot know whether the write happened.

Tool result errors​

MessageMeaningFix
Your Spanway role cannot use approve_access_request.The caller's role is below the tool's minimum role. The call was refused before it reached the management API and an audit row with outcome denied and status 403 was written.Use an identity with the required role, or ask an admin to lower SPANWAY_ADMIN_MCP_MIN_ROLE and check the tool's row in the roles table.
Arguments do not match the complete tool schema at <location>. Use describe_admin_tool for all accepted fields.The arguments failed the tool's schema before any request was sent, for example a missing body.request_id. Nothing changed.Call describe_admin_tool for the exact fields, for example body.request_id for the access request decisions and body.passed for a label.
Gateway returned HTTP 403. Check gateway state before retrying this change.The management API refused the write, for example a team admin approving a request for another team, a reviewer labelling an item without a claim (409) or a route without the licence. The audit row records outcome failed with the status.Read the request or item first, then retry only when the state shows the change did not happen.
Gateway returned HTTP 422.The arguments matched the tool schema but the route still rejected a value, for example an unknown enum value.Fix the value the gateway names and retry.
This tool is not enabled for this connector.The tool is a write and SPANWAY_ADMIN_READ_ONLY is on, or SPANWAY_ADMIN_TOOLS leaves it out.Turn read only off or add the tool name to the allow list and restart.
Invalid resource identifier.A path argument such as queue_id or review_item_id was empty or contained a path separator.Pass the plain id as the Admin UI shows it.
Admin identity changed during the request. Inspect gateway state before retrying.The credential resolved to a different person between tool discovery and the call, for example after a key was reassigned. The call was not run.Check who the key belongs to, then retry.
Gateway request could not be completed.The management API did not answer, reported as 504.Check the gateway's health and retry a read. For a write, read the object first.
Gateway returned an invalid JSON response.The management API answered with something that is not JSON, reported as 502.Check the gateway log for the route's error.
Result exceeds the upstream byte limit; use pagination or a narrower query.The answer is larger than the connector accepts.Ask for a page, a filter or a narrower query.
Gateway operation changed for <tool>; update the connector before using it.The gateway serves a different operation at a catalogue path, reported as 503.Upgrade the gateway and connector together.
Gateway schema is unsupported for <tool>.The gateway's schema for that route cannot be turned into a tool, reported as 503.Upgrade the gateway and connector together.
Gateway OpenAPI schema is unavailable.The connector could not read the gateway's /openapi.json, reported as 503.Check that the gateway is up and serves its schema.
No compatible, enabled admin tools were found on this gateway.Every tool was filtered out, reported as 503.Check SPANWAY_ADMIN_TOOLS and SPANWAY_ADMIN_READ_ONLY.

HTTP errors​

StatusMessage or whereMeaningFix
401A personal Spanway admin bearer credential is required. with WWW-Authenticate: Bearer resource_metadata=...No usable bearer credential, or an expired session token.Send a virtual key or sign in with OAuth.
403This Spanway identity may not use the admin connector.The signed in user is below SPANWAY_ADMIN_MCP_MIN_ROLE, blocked, deleted or inactive, or the key belongs to no user. A denied row with connector as the object is written, with the user id, or unknown when the gateway could not tell who it was.Raise the user's role, unblock or reactivate the user, or lower the minimum role.
401{"error": "A refresh token is not accepted here"}The client sent its OAuth refresh token as the bearer credential.Let the client exchange the refresh token for an access token first.
401{"error": "The session token is invalid, expired or issued for another resource"}The OAuth session token failed its check, ran out, or was issued for another audience.Sign in again from the client.
401 or 503{"error": "The user is not active"}The signed in user no longer exists or is inactive (401), or the user record could not be read (503).Reactivate the user, or check the database and retry.
403Your Spanway license does not include the 'admin_mcp' feature. Contact sales@spanway.ai to add it.The licence lacks the feature. The Connect tab card says so first.Ask sales@spanway.ai for the feature.
403This address is not allowed by the allowed_ips of one of your teams or organizationsThe OAuth session's address is outside a team or organization allowed_ips.Widen the allow list or connect from an allowed address.
403Only proxy admins and admin viewers can read this. on GET /v1/mcp/admin_serverOther roles cannot read the server's state.Use an admin or admin viewer key.
404/admin/mcpSPANWAY_ENABLE_ADMIN_MCP is not set, or the request reached the gateway component of a componentized deployment.Set the variable and restart, and route /admin to the backend.
503OAuth sign-in to the admin connector needs UI login, which EXPERIMENTAL_UI_LOGIN=false turns off. Send a virtual key insteadOAuth sign-in to the connector needs UI login.Turn UI login back on, or connect with a pasted key.
503The gateway cannot read the allowed_ips of your teams and organizationsThe team or organization allow lists could not be read.Check the database connection.
503The gateway cannot verify session tokensNo master key or session signing key is configured, so session tokens cannot be checked.Set the master key and restart.
noneTool missing from the client's listThe caller's role does not reach it, SPANWAY_ADMIN_READ_ONLY is on, or SPANWAY_ADMIN_TOOLS leaves it out.Call describe_admin_tool for the tool's minimum role and check the variables.

Startup errors​

The gateway refuses to start when an admin MCP setting is wrong, and prints the message below.

MessageCauseFix
SPANWAY_ENABLE_ADMIN_MCP must be true or falseThe variable has another value, such as yes.Set it to true or false.
SPANWAY_ADMIN_MCP_MIN_ROLE must be one of internal_user, team_admin, org_admin, proxy_adminThe minimum role is misspelled.Use one of the four names.
SPANWAY_ADMIN_TOOLS contains unknown tool names; inspect the published tool catalog.The allow list names a tool that does not exist.Fix the name, using the tool names on this page.
SPANWAY_ADMIN_READ_ONLY must be true or falseThe variable is not true, false, 1 or 0.Set one of those values.
SPANWAY_ADMIN_RESPONSE_VIEW must be full or compactAnother value was set.Set full or compact.
SPANWAY_ADMIN_SCHEMA_MODE must be full or discoveryAnother value was set.Set full or discovery.
SPANWAY_MCP_PUBLIC_URL must be an HTTPS originThe public URL is not https:// or carries a path.Set only the HTTPS origin, for example https://gateway.example.com.
Admin MCP requires Python 3.12+ and the admin-mcp dependency group.The gateway was started without the admin MCP components.Use a Spanway image, which bundles them.
Hosted admin MCP requires a valid spanway_key_header_namegeneral_settings.spanway_key_header_name is not a valid HTTP header name.Remove the setting or set a valid header name.
Hosted admin MCP cannot overwrite configured identity headersuser_header_name, mcp_client_id_header, a user_header_mappings entry or an oauth2_config_mappings header names a header the server sets itself when it forwards a call, such as Authorization.Rename the header in the setting that collides.
Hosted admin MCP spanway_key_header_name cannot replace a transport, audit, or policy headerspanway_key_header_name names a header the server needs for the MCP transport, the audit row or the role policy, or an X-Forwarded- header.Pick another header name.

Mount and route errors​

StatusWhereMeaningFix
404 on /admin/mcpAny clientSPANWAY_ENABLE_ADMIN_MCP is not set, or the request reached the gateway component of a componentized deployment.Set the variable and restart, and route /admin to the backend.
403 Your Spanway license does not include the 'admin_mcp' feature. Contact sales@spanway.ai to add it./admin/mcpThe licence lacks the feature. The Connect tab card says so first.Ask sales@spanway.ai for the feature.
403 before any tool runs/admin/mcpThe OAuth session's address is outside a team or organization allowed_ips. A role below SPANWAY_ADMIN_MCP_MIN_ROLE is the HTTP 403 row in the table above.Widen the allow list. A refused row with object_id oauth_session and the reason is written to the audit log for the signed-in user.
403 Only proxy admins and admin viewers can read this.GET /v1/mcp/admin_serverOther roles cannot read the server's state.Use an admin or admin viewer key.
503 after EXPERIMENTAL_UI_LOGIN=false/admin/mcp with an OAuth tokenOAuth sign-in to the connector needs UI login.Turn UI login back on, or connect with a pasted proxy admin key.
503 on every OAuth request/admin/mcpThe team or organization allow lists could not be read.Check the database connection.
Tool missing from the client's listAny clientThe caller's role does not reach it, SPANWAY_ADMIN_READ_ONLY is on, or SPANWAY_ADMIN_TOOLS leaves it out.Call describe_admin_tool for the tool's minimum role and check the variables.

Logs​

The hosted server writes no line per tool call. The audit row is the record of each call. The operator log carries these lines.

LevelLineMeaningAction
ERRORHosted admin MCP audit row was not written: <ExceptionType>The audit sink failed, usually because the database was unavailable. The tool call itself completed.Check the database. The row is lost, so treat the gap in the audit log as such.
ERRORHosted admin MCP could not read team or organization allowlists: <ExceptionType>An OAuth session could not be checked against allowed_ips and was refused with 503.Check the database and retry.
WARNINGmcp_client_id_header is not a string (...); ignoring itThe setting that names the client header is malformed, so audit rows fall back to the User-Agent.Set general_settings.mcp_client_id_header to a header name.
WARNINGmcp_allowed_clients is not a list of {alias, value} entries (...)The alias list is malformed. Audit rows keep the raw header value and the aggregate /mcp endpoint rejects every client until it is fixed.Fix the list.