MCP setup
Connect an MCP client (e.g. Claude Code, OpenAI Codex) to Stairway over MCP. One MCP server covers your whole account: agents list or create browsers, then drive them with a session_id.
Prerequisites
- A Stairway account.
- An API token — create one under Account → API & MCP (Tokens tab), or Settings → API credentials.
- An MCP client that supports either:
- Direct Streamable HTTP (
url+Authorizationheader) — preferred when your client supports it, or - stdio only — use the Supergateway bridge described below.
- Direct Streamable HTTP (
1. Create an API token
Open Account → API & MCP, stay on the Tokens tab, create a named token (optional expiration), and copy the secret once. The web UI also stores that secret in this browser so the MCP tab can reuse it.
Treat the token like a password. It authenticates as you for consumer REST and MCP. It cannot call system-admin APIs.
After you create a token, Stairway switches you to the MCP tab so you can copy client config immediately.
2. Copy MCP config
On the same API & MCP page, open the MCP tab:
- Pick an active token from the dropdown (or paste the secret if it was created in another browser).
- Copy the generated client JSON (Direct Streamable HTTP or Supergateway).
The config always points at the universal endpoint (/api/mcp/), not a per-browser URL. Agents pass a session_id into browser tools when they need a specific session.
Alternate shortcuts
You can also open Configure MCP from a session row on the Dashboard, session detail page, or the noVNC toolbar. Those dialogs mint a drive token for that browser only — not your account API token. Settings → Configure MCP deep-links to the account MCP tab (account token, for orchestrators).
3. Direct Streamable HTTP (recommended)
{
"mcpServers": {
"stairway": {
"url": "https://your-host/api/mcp/",
"headers": {
"Authorization": "Bearer stw_<prefix>_<secret>"
}
}
}
}
Paste into your client’s MCP settings and reload MCP servers.
4. Supergateway (stdio clients)
{
"mcpServers": {
"stairway": {
"command": "npx",
"args": [
"-y",
"supergateway",
"--streamableHttp",
"https://your-host/api/mcp/",
"--header",
"authorization:Bearer stw_<prefix>_<secret>"
]
}
}
}
5. What agents typically do
browsers_list/browsers_recommend— prefer a matching running sessionbrowsers_create— only if needed; passcountry/cityand leave UA/locale unset so stealth matching applies. Optionalidle_timeout_secsfor known-slow tasks.- Pass
session_idinto everybrowser_*tool - Navigate → snapshot → click/type → optional login / captcha / HAR
- During long human-in-the-loop waits, call
browsers_keepalive(interaction tools already refresh the idle clock) - Stop,
browsers_delete(for stuck pending/error sessions), or leave the session running as needed
You can still open the streamed browser yourself while the agent works — same session.
If agent tools fail
Stay on Stairway MCP: browsers_info → browsers_start / browsers_restart → wait until ready → retry. Agents must not fall back to a local IDE browser harness (e.g. Cursor’s built-in browser) to drive noVNC as a substitute. If recovery fails, report the error and stop.
Regional stealth
When creating a browser for a region, pass the egress country (and optional city). With match_stealth=true (default), Stairway picks locale and User-Agent to match that exit so the browser looks like a local visitor.
Capabilities
| Category | Tools |
|---|---|
| Account | account_info, account_usage |
| Browsers | browsers_list, browsers_recommend, browsers_create, browsers_info, browsers_start / stop / delete / restart / keepalive |
| Navigation & grounding | browser_navigate, snapshot, screenshot, wait, … (all require session_id) |
| Interaction | click, type, keys, scroll, overlays |
| Auth / captcha / HAR | same as before, with session_id |
Consumer REST
The same API token works as Authorization: Bearer stw_… on user /api/* routes (browsers, analytics, credentials you own, etc.). Admin routes require a normal login session.