You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local CLI MCP endpoint (http://localhost:54321/mcp) fails OAuth: Kong has no routes for .well-known/oauth-* — 'no Route matched with those values' #257
Following the official "Local Development" install docs (Platform: CLI → Server URL: http://localhost:54321/mcp), the Claude Code MCP client can never authenticate against the locally-bundled Supabase MCP server. The failure happens during OAuth discovery: Kong (the local stack's gateway on port 54321) has no routes for the .well-known/oauth-* metadata endpoints that the MCP server's auth flow depends on, so the client receives Kong's generic "no Route matched" 404 in place of an OAuth error response, and the SDK's Zod schema rejects the payload.
The MCP endpoint itself (/mcp) is reachable and responds, but the OAuth companion endpoints required to complete the authorization handshake are not proxied through Kong in the CLI's local stack. This makes the advertised http://localhost:54321/mcp URL effectively unusable from any MCP client that follows the standard OAuth 2.0 Protected Resource Metadata flow (RFC 9728).
Note: I'm filing here because this repo is where /docs/guides/getting-started/mcp + the "Platform: CLI" install instructions point users. The root cause likely lives in the Supabase CLI's Kong template (supabase/cli) — please feel free to transfer if appropriate.
To Reproduce
Install Supabase CLI 2.90.0 and run supabase start in any project.
Confirm the MCP URL is advertised by the CLI:
$ supabase status
...
│ MCP │ http://127.0.0.1:54321/mcp │
...
Follow the official local install instructions for Claude Code — add to .mcp.json:
In a terminal, run claude /mcp, select supabase_local, choose Authenticate.
Observe the failure dialog:
Supabase_local MCP Server
Status: failed
Auth: not authenticated
URL: http://127.0.0.1:54321/mcp
Error: SDK auth failed: HTTP 404: Invalid OAuth error response: ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": ["error"],
"message": "Invalid input: expected string, received undefined"
}
]. Raw body: {"message":"no Route matched with those values"}
Reproducible via curl
The /mcp endpoint itself answers (POST, with the required Accept: application/json, text/event-stream), proving the MCP service is reachable through Kong:
But the OAuth discovery endpoints the client must fetch next are not routed:
$ curl -s http://127.0.0.1:54321/.well-known/oauth-protected-resource
{"message":"no Route matched with those values"}
$ curl -s http://127.0.0.1:54321/.well-known/oauth-authorization-server
404 page not found
The {"message":"no Route matched with those values"} payload is Kong's default no-route response, which is exactly what shows up in the Raw body: of the Claude Code error above — confirming the OAuth metadata fetch is the step that fails.
Running Docker containers in the local stack (no dedicated MCP container — the service is embedded in Studio, and hitting /mcp/.well-known/oauth-protected-resource actually falls through to Studio's Next.js 404 page, X-Powered-By: Next.js):
Following the documented Platform: CLI install path should yield a working, authenticated MCP connection. Concretely, the OAuth discovery endpoints advertised by the local MCP server (Protected Resource Metadata, Authorization Server Metadata, and the token/registration URLs they in turn point to) must all be reachable through Kong on port 54321, so that an MCP client can complete the standard RFC 9728 + OAuth 2.0 Dynamic Client Registration flow.
Either of the following would resolve this:
Update the local Kong template shipped by the CLI to proxy the .well-known/oauth-* paths (and any downstream authorization/token/registration endpoints) to the MCP/Studio upstream.
Have the local MCP server advertise OAuth URLs that resolve to endpoints Kong already routes (or a port/host that doesn't require going through Kong).
Alternatively, ship a no-auth mode for the local CLI MCP (see related Local-only mode with no access token #22), since OAuth on a loopback-only dev stack is mostly ceremony anyway.
Screenshots
Official install doc page (Platform: CLI, Client: Claude Code) showing http://localhost:54321/mcp as the recommended URL.
Claude Code auth dialog showing the ZodError / Raw body: {"message":"no Route matched with those values"} failure.
(I'll add them via the web UI after the issue is created.)
System information
OS: macOS 26.4.1 (Darwin 25.4.0)
Supabase CLI: 2.90.0
Kong image: public.ecr.aws/supabase/kong:2.8.1
Studio image: public.ecr.aws/supabase/studio:2026.01.27-sha-2a37755
Node.js: v24.14.0
MCP client: Claude Code (HTTP transport)
Additional context
The hosted MCP at https://mcp.supabase.com/mcp?project_ref=... works fine from the same machine / same client — the break is specific to the local CLI stack.
Working workaround for anyone hitting this in the meantime: swap the HTTP transport for a stdio server pointed straight at the local Postgres, e.g.
Bug report
Describe the bug
Following the official "Local Development" install docs (Platform: CLI → Server URL:
http://localhost:54321/mcp), the Claude Code MCP client can never authenticate against the locally-bundled Supabase MCP server. The failure happens during OAuth discovery: Kong (the local stack's gateway on port 54321) has no routes for the.well-known/oauth-*metadata endpoints that the MCP server's auth flow depends on, so the client receives Kong's generic "no Route matched" 404 in place of an OAuth error response, and the SDK's Zod schema rejects the payload.The MCP endpoint itself (
/mcp) is reachable and responds, but the OAuth companion endpoints required to complete the authorization handshake are not proxied through Kong in the CLI's local stack. This makes the advertisedhttp://localhost:54321/mcpURL effectively unusable from any MCP client that follows the standard OAuth 2.0 Protected Resource Metadata flow (RFC 9728).Note: I'm filing here because this repo is where
/docs/guides/getting-started/mcp+ the "Platform: CLI" install instructions point users. The root cause likely lives in the Supabase CLI's Kong template (supabase/cli) — please feel free to transfer if appropriate.To Reproduce
2.90.0and runsupabase startin any project..mcp.json:{ "mcpServers": { "supabase_local": { "type": "http", "url": "http://127.0.0.1:54321/mcp" } } }claude /mcp, selectsupabase_local, choose Authenticate.Reproducible via curl
The
/mcpendpoint itself answers (POST, with the requiredAccept: application/json, text/event-stream), proving the MCP service is reachable through Kong:But the OAuth discovery endpoints the client must fetch next are not routed:
$ curl -s http://127.0.0.1:54321/.well-known/oauth-protected-resource {"message":"no Route matched with those values"} $ curl -s http://127.0.0.1:54321/.well-known/oauth-authorization-server 404 page not foundThe
{"message":"no Route matched with those values"}payload is Kong's default no-route response, which is exactly what shows up in theRaw body:of the Claude Code error above — confirming the OAuth metadata fetch is the step that fails.Running Docker containers in the local stack (no dedicated MCP container — the service is embedded in Studio, and hitting
/mcp/.well-known/oauth-protected-resourceactually falls through to Studio's Next.js 404 page,X-Powered-By: Next.js):Expected behavior
Following the documented Platform: CLI install path should yield a working, authenticated MCP connection. Concretely, the OAuth discovery endpoints advertised by the local MCP server (Protected Resource Metadata, Authorization Server Metadata, and the token/registration URLs they in turn point to) must all be reachable through Kong on port 54321, so that an MCP client can complete the standard RFC 9728 + OAuth 2.0 Dynamic Client Registration flow.
Either of the following would resolve this:
.well-known/oauth-*paths (and any downstream authorization/token/registration endpoints) to the MCP/Studio upstream.Screenshots
http://localhost:54321/mcpas the recommended URL.ZodError/Raw body: {"message":"no Route matched with those values"}failure.(I'll add them via the web UI after the issue is created.)
System information
public.ecr.aws/supabase/kong:2.8.1public.ecr.aws/supabase/studio:2026.01.27-sha-2a37755Additional context
https://mcp.supabase.com/mcp?project_ref=...works fine from the same machine / same client — the break is specific to the local CLI stack.