Connect an MCP client
Give an AI agent (Claude Desktop, Claude Code, any MCP client) access to your Stav workspace over the Model Context Protocol.
Stav runs an MCP server. An agent connected to it can read your models, keys, Routers, usage and billing, and act on them with your permissions — the same things you can do in Your workspace.
1. Enable MCP for the workspace
An Owner or Admin opens Your workspace → Connect → MCP Server and enables MCP. The page then shows the Connection URL:
https://stav.ai/mcp
The same page shows how many tool calls the workspace has made.
2. Add the server to your client
Paste the URL into your client as a remote (Streamable HTTP) MCP server. For Claude Code:
claude mcp add --transport http stav https://stav.ai/mcp
3. Sign in
The client opens a browser to sign in to Stav. You do not paste a secret: the server supports OAuth dynamic client registration, authorization code with PKCE (S256), and refresh tokens. Discovery is at https://stav.ai/.well-known/oauth-authorization-server.
The agent acts as you. Anything your role cannot do in Your workspace, the tool call cannot do either. If you belong to several workspaces, a client can send an X-Team-Id header to pick one.
Tools that call the inference API
Most tools use your sign-in. The inference tools — inference_chat, inference_models_list, inference_models_get, messages_create, messages_count_tokens — call api.stav.ai and need a Stav API key, because inference is billed per key. Give it one of two ways:
- once per connection, as an
X-Stav-Api-Keyheader on the MCP server URL, or - per call, as the tool's
api_keyargument.
Without a key these tools return an error that says so.
Turn MCP off, or make it Read-only
Two workspace settings on the same page control what agents may do. Stav checks both before every tool call. Only an Owner or Admin can change them.
- MCP off: every tool call is refused. Nothing runs. Turning it on again restores your settings.
- Read-only (under Tool Access Level): agents can call read tools only. Every tool that changes something, such as
apikeys_create, is refused. - Read & Write: agents can call every tool your role allows.
A change reaches every connected agent within about 15 seconds. You do not need to reconnect.
A refused call comes back as a tool error with the reason in plain text, for example:
This workspace's MCP access is Read-only, so 'apikeys_create' cannot run.
The refused call never reaches the rest of the platform.
Limits
The server allows 100 requests a minute per workspace by default. Over the limit it returns 429 rate_limit_exceeded, with X-RateLimit-Remaining and X-RateLimit-Reset headers.
Where calls show up
Tool calls that change something land in Your workspace → Govern → Audit log with origin mcp.