MCP server not connecting in your AI tool
Fix the SupaHost MCP server failing to connect in Claude Code, Cursor, VS Code and others: wrong URL, missing Bearer header, 401 invalid token, 403 scope errors and missing tools.
What you see
Your AI tool lists the supahost MCP server as failed, disconnected or "needs authentication", or it connects but shows fewer tools than you expected. If you look at the raw response, you'll see one of these:
{"jsonrpc":"2.0","error":{"code":-32001,"message":"Missing or invalid SupaHost access token. Create one in the dashboard: https://supahost.app/dashboard/tokens"},"id":null}
{"error":"This token is scoped to project app-one, not app-two."}
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Method not allowed"},"id":null}
Why it happens
The SupaHost MCP server is a remote server at https://mcp.supahost.space/mcp that speaks Streamable HTTP. Every request must carry your SupaHost access token in a header:
Authorization: Bearer shp_<48 hex characters>
Common mistakes:
- No header, or the wrong format. The token goes after
Bearerwith a space. Leaving outBearer, or putting the token in the URL, gets a 401. - The environment variable isn't set where the tool runs. A config with
${SUPAHOST_TOKEN}sends an empty token if your editor was started before you exported it. - The token was revoked, or copied with a missing character. Tokens are shown only once.
- A Supabase Cloud token. Tokens starting
sbp_are for Supabase Cloud; SupaHost tokens startshp_. - The client tries OAuth. There's no OAuth sign-in for this server yet. Clients that only support OAuth connectors (Claude.ai and ChatGPT's web connectors) can't connect for now.
- Scope mismatch (403). A
?project=or?instance=in the URL that doesn't match the token's scope. - Opening the URL in a browser sends a GET, which returns 405. That's expected; MCP clients use POST.
How to fix it
Create a fresh token on Dashboard → Access tokens → New token. Pick the scope (one project, or Whole instance (all projects)) and whether it's read-only. Copy it straight away.
Export it in the shell your tool starts from, then restart the tool:
export SUPAHOST_TOKEN="shp_..."Check the config. For Claude Code:
claude mcp add --scope project --transport http supahost "https://mcp.supahost.space/mcp" \ --header "Authorization: Bearer ${SUPAHOST_TOKEN}"For Cursor (
.cursor/mcp.json):{ "mcpServers": { "supahost": { "url": "https://mcp.supahost.space/mcp", "headers": { "Authorization": "Bearer ${env:SUPAHOST_TOKEN}" } } } }Dashboard → AI agents (MCP) generates the right snippet for 19 clients.
Test the token outside the tool:
curl -s -X POST https://mcp.supahost.space/mcp \ -H "Authorization: Bearer $SUPAHOST_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'A JSON result naming the server
supahostmeans the token and network are fine, so the problem is in the tool's config. A 401 means the token is wrong or revoked.In Claude Code, run
/mcpto see the server's status after changes.
Connected, but tools are missing
- Read-only tokens, or
read_only=truein the URL, don't register write tools such asapply_migrationordeploy_edge_function. - Project-scoped tokens don't get
list_projects,get_projectorcreate_project. - Storage tools aren't on by default.
features=in the URL replaces the default list, so name every group you want, for example?features=docs,account,database,debugging,development,functions,storage.
On SupaHost
- Only a hash of each token is stored, so a lost token can't be shown again. Revoke it and create a new one.
- The Access tokens page shows each token's prefix, scope and Last used, which tells you whether your tool's requests are arriving at all.
- Writes made over MCP appear in Dashboard → Activity as
MCP (<token name>).