Connect an MCP client with a workspace key

CloudSurf speaks MCP (the Model Context Protocol) over Streamable HTTP. Every workspace has its own endpoint:

https://app.cloudsurf.com/mcp/<workspace-id>

The bare address https://app.cloudsurf.com/mcp also answers; it follows the workspace the credential was minted for. There are two ways to sign a client in:

  • OAuth, in a click — the connect page has the one-command installs for Claude, Codex, Cursor and VS Code. Use it when your client can open a browser.
  • A workspace key — a scoped sk_live_… key you mint yourself and send as a bearer token. Use it for clients that take a token instead of a sign-in window, for servers, and for scripts. This guide covers that path.

Every connection reaches exactly one workspace — the one its address or its key names. To reach another workspace, add a second connection.

1. Mint a workspace key

  1. Sign in at app.cloudsurf.com and open the workspace you want to connect.
  2. Open Settings → Connected agents.
  3. Mint a key with the scopes you want (read, write, mako, admin) and copy it. It starts with sk_live_ and is shown once.

A key is pinned to the workspace it was minted in. Nothing a client does — and no workspace switch in the web app or the Terminal — repoints it.

2. Point the client at the endpoint

Give your MCP client the workspace address and the key as a bearer header. Most clients take a server entry of this shape:

{
  "url": "https://app.cloudsurf.com/mcp/<workspace-id>",
  "headers": { "Authorization": "Bearer sk_live_…" }
}

Name the server whatever your client expects; the OAuth installs on the connect page register it as cloudsurf-<workspace>, and an older surfspace-<workspace> entry keeps working.

Raw sign-in tokens from the web app are not accepted on /mcp — only a workspace key or an OAuth grant. A client that sends anything else gets a 401 whose body says to mint a key or connect through OAuth.

3. Check the connection

Ask the client to call whoami. The answer names the workspace, its plan and the key's scopes. The server's own instructions, sent on the handshake, say the same thing — if a doc or task you expect is missing, check the workspace before concluding it does not exist.

What the key can do

  • Scopes. tools/list only advertises the tools the key's scopes allow; a call outside them answers a tool error the agent can read, never a crash.
  • Free workspaces are read-only over MCP. Write tools are not advertised on the Free plan even when the key carries write. Move the workspace to a paid plan to connect it read-write.
  • One workspace. A key never reads or writes another workspace, and it never sees your CloudSurf password.
  • Metered. Requests are metered per key, which is why the key — not a sign-in token — is the credential for agents.

Revoke a key

Delete it under Settings → Connected agents. Access ends immediately; the client's next request gets a 401. What data flows to a connected app is described in the privacy policy.

The Terminal mints one for you

Signing in with the CloudSurf Terminal mints a workspace key and stores it on your device, so the Terminal's own tools and any agent it runs connect without this page.