Skip to main content
Glama

oferty-spike-mcp

Spike #1 des Projekts „Oferty Online": Ob der eingebaute OAuth-2.1-Server von Supabase Auth (Beta) sich über Dynamic Client Registration mit der Claude-App verständigen kann.

Der Code ist Wegwerfcode. Keine Tests, keine Fehlerbehandlung außer dem, was der Spike selbst diagnostiziert, keine echten MCP-Tools. Nach der Ausführung bleibt nur eine Notiz mit den Erkenntnissen.

Was hier drin ist

Datei

Rolle

src/server.js

HTTP-Routing, Host-Validierung, Lazy Auth, Discovery

src/mcp.js

MCP-v2-Server + ping()-Tool, das die Identität aus dem Token zurückgibt

src/verifier.js

zwei Pfade: statisches Bearer (Claude Code) und Supabase-Token (Claude-App)

src/consent.js

Zustimmungsseite – das Einzige, das wir selbst schreiben

src/supabase-metadata.js

Abruf der AS-Metadaten beim Start, Fail Fast

Wir verwenden SDK v2 (@modelcontextprotocol/server + @modelcontextprotocol/node). @modelcontextprotocol/sdk ist Legacy v1 – die meisten Tutorials im Netz beschreiben genau diese.

Related MCP server: mcp-oauth-server-next

Umgebungsvariablen

Siehe .env.example. Alle vier sind erforderlich, der Prozess startet ohne sie nicht.

Lokale Ausführung

npm ci
APP_ORIGIN=http://localhost:3000 SUPABASE_URL=https://twoj.supabase.co \
  SUPABASE_ANON_KEY=... SPIKE_STATIC_TOKEN=... npm start

Endpunkte

  • POST /mcp — Streamable HTTP, zustandslos

  • GET /.well-known/oauth-protected-resource/mcp — RFC 9728

  • GET /.well-known/oauth-authorization-server — Supabase-Metadaten, wörtlich durchgereicht

  • GET /oauth/consent?authorization_id=… — Zustimmungsseite

  • GET /healthz — Lebensfähigkeit des Prozesses, pingt bewusst kein Supabase an

Diagnose

Ohne Token antwortet POST /mcp mit 401 und einem WWW-Authenticate-Header, der auf die Protected Resource Metadata verweist – daran erkennst du, dass Lazy Authentication funktioniert.

Bei Verdacht auf ein Problem mit dem Reconnect des Connectors (der verdächtigste Punkt des Spikes) sind supabase.auth.oauth.listGrants() und revokeGrant({ clientId }) nützlich – sie erlauben, die gespeicherte Zustimmung zu sehen und zu löschen, ohne die Datenbank manuell anzufassen.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude.ai to connect to a Hermes MCP server via OAuth 2.1 authorization code flow with PKCE, acting as a reverse proxy and single-user authorization gateway.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A proof-of-concept HTTP MCP server requiring OAuth 2.0 authentication before tool use. Demonstrates the full authentication flow with Claude Code, including discovery, client registration, PKCE authorization, and bearer token verification.
      -