Skip to main content
Glama

oferty-spike-mcp

'Oferty Online' 프로젝트의 Spike #1: Supabase Auth(베타)에 내장된 OAuth 2.1 서버가 Dynamic Client Registration을 통해 Claude 앱과 통신할 수 있는지 여부.

코드는 버릴 예정입니다. 테스트 없음, spike 자체가 진단하는 것 외의 오류 처리 없음, 실제 MCP 도구 없음. 실행 후에는 결론이 담긴 메모만 남습니다.

구성

파일

역할

src/server.js

HTTP 라우팅, Host 검증, lazy auth, discovery

src/mcp.js

MCP v2 서버 + 토큰에서 신원을 반환하는 ping() 도구

src/verifier.js

두 가지 경로: 정적 Bearer(Claude Code) 및 Supabase 토큰(Claude 앱)

src/consent.js

동의 페이지 — 우리가 직접 작성하는 유일한 것

src/supabase-metadata.js

시작 시 AS 메타데이터 가져오기, fail fast

SDK v2(@modelcontextprotocol/server + @modelcontextprotocol/node)를 사용합니다. @modelcontextprotocol/sdk는 레거시 v1입니다 — 웹에 있는 대부분의 튜토리얼이 바로 그것을 설명합니다.

Related MCP server: mcp-oauth-server-next

환경 변수

.env.example 참조. 네 개 모두 필수이며, 이들이 없으면 프로세스가 시작되지 않습니다.

로컬 실행

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

엔드포인트

  • POST /mcp — Streamable HTTP, stateless

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

  • GET /.well-known/oauth-authorization-server — Supabase 메타데이터, 그대로 전달됨

  • GET /oauth/consent?authorization_id=… — 동의 페이지

  • GET /healthz — 프로세스의 생존 여부, 의도적으로 Supabase를 ping하지 않음

진단

토큰 없이 POST /mcp는 Protected Resource Metadata를 가리키는 WWW-Authenticate 헤더와 함께 401로 응답합니다 — 이를 통해 lazy authentication이 작동함을 알 수 있습니다.

커넥터 재연결 문제가 의심될 때(spike에서 가장 의심스러운 지점) supabase.auth.oauth.listGrants()와 revokeGrant({ clientId })가 유용합니다 — 데이터베이스를 수동으로 건드리지 않고 저장된 동의를 확인하고 삭제할 수 있습니다.

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.
      -