sqlite-notes
Stytch 인증 SQLite MCP
SaaS 통합의 구조를 배우기 위해 의도적으로 작게 만든 원격 MCP 서비스입니다:
FastMCP는 Streamable HTTP를 통해 6개의 도구를 제공합니다.
Stytch Connected Apps는 OAuth 2.1 디스커버리, Dynamic Client Registration, PKCE, 브라우저 로그인, 동의, 토큰 발급을 처리합니다.
서비스는 모든 액세스 토큰의 서명, 발급자, 대상(audience), 만료,
openid스코프를 Stytch의 순환 JWKS에 대해 검증합니다.SQLite 행은 토큰의
sub로 키가 지정되므로 각 Stytch 사용자는 자신의 메모만 볼 수 있습니다.Stytch 클라이언트가 실수로 더 긴 액세스 토큰 수명으로 구성된 경우에도 서버는 액세스를 30분으로 제한합니다.
Claude Code 플러그인은 고정된
mcp-remote브리지를 실행하며, 이 브리지는 OAuth를 수행하고 Claude Code를 원격 MCP 엔드포인트에 연결합니다.
아키텍처
Claude Code plugin -> http(s)://MCP/mcp -> validate Stytch JWT -> per-user SQLite CRUD
| ^
+-> Stytch discovery -> browser login/consent app -> Stytch token endpoint브라우저 앱이 필요합니다. Stytch는 디스커버리, 등록, 토큰 엔드포인트를 호스팅하고, 애플리케이션은
로그인 및 동의에 사용되는 IdentityProvider 컴포넌트를 호스팅합니다.
Related MCP server: Supabase MCP Server
1. Stytch 구성
Consumer Authentication 프로젝트를 만든 후 다음을 구성합니다:
Frontend SDK에서 SDK를 활성화하고
http://localhost:3000을 승인합니다.Redirect URLs에서 로그인 및 가입 모두에
http://localhost:3000/authenticate를 추가합니다.Email Magic Links를 Login 또는 Create로 활성화합니다.
Connected Apps에서 Authorization URL을
http://localhost:3000/oauth/authorize로 설정합니다.Dynamic Client Registration을 활성화합니다. MCP 클라이언트는 콜백 포트가 달라질 수 있으므로 DCR을 사용합니다.
Stytch가 허용하는 경우 Connected Apps 액세스 토큰 만료를 30분으로 설정합니다.
서비스와 플러그인은 openid만 요청합니다. MCP 서버는 안정적인 sub
식별자만 필요하기 때문입니다. 프로필이나 이메일 데이터는 필요하지 않습니다.
서버는 토큰의 iat 이후 30분이 지나면 모든 액세스 토큰을 거부합니다. 플러그인은 고정된
mcp-remote@0.2.1 브리지를 사용하며, 이 브리지는 offline_access를 추가하지 않고 MCP 보호 리소스가
광고하는 스코프를 요청합니다. 따라서 Stytch는 리프레시 토큰을 발급하지 않으며, 만료 시
사용자는 대화형 인증으로 돌아가게 됩니다.
이 브리지는 의도적입니다. 기본 Claude Code OAuth는 인증 서버가
offline_access를 광고할 때 자동으로 추가하여 자동 토큰 갱신을 허용하고 강제 로그인
요구 사항을 무력화합니다.
.env.example을 .env로 복사하고 다음을 설정합니다:
STYTCH_PROJECT_ID: JWT 대상(audience)으로 사용되는project-test-...프로젝트 ID.STYTCH_DOMAIN: Stytch가 표시하는 전체 프로젝트 도메인(예:https://...customers.stych.dev). 발급자 및 JWKS 호스트로 사용됩니다. 여기에 API 시크릿이나 공개 토큰을 사용하지 마십시오.STYTCH_PUBLIC_TOKEN: 로그인 및 동의 UI에서 사용하는 브라우저 안전public-token-test-...값.MCP_BASE_URL:/mcp를 제외한 MCP 서버의 외부에서 보이는 오리진(origin).
이 프로젝트에는 Stytch 시크릿 키가 필요하지 않습니다. JWT 검증에는 공개 서명 키만 필요합니다.
대시보드 구성을 저장한 후 Stytch 디스커버리와 서명 키를 검증합니다:
set -a; source .env; set +a
uv run python scripts/check_stytch.py다음 메시지가 출력될 때까지 브라우저 로그인 테스트로 진행하지 마십시오:
PASS: Stytch authorization metadata and JWKS are ready for MCP OAuth.
2. 로컬에서 실행
uv sync
set -a; source .env; set +a
uv run mcp-auth다른 터미널에서:
cd web
npm install
npm run dev실제 OAuth 테스트를 위해서는 MCP 엔드포인트와 인증 페이지가 모두 일반적으로
안정적인 HTTPS URL에서 접근 가능해야 합니다. 개발 터널이 포트 8000과 3000을 게시할 수 있습니다. MCP_BASE_URL,
Stytch Frontend SDK 승인 환경 및 리다이렉트 URL, Connected Apps Authorization URL,
그리고 SQLITE_NOTES_MCP_URL을 해당 HTTPS URL로 업데이트합니다. 일반 localhost 설정은 빌드 중에
유용하지만, 프로덕션은 HTTPS를 사용해야 합니다.
3. Claude Code 플러그인 설치 및 인증
저장소 루트에서 로컬 마켓플레이스를 등록하고 이 프로젝트에 플러그인을 설치합니다:
claude plugin marketplace add "$PWD" --scope project
claude plugin install sqlite-notes@mcp-auth-local --scope project로컬 서버 URL은 기본적으로 http://127.0.0.1:8000/mcp입니다. 호스팅 또는 터널링된 서버의 경우
Claude Code를 시작하기 전에 URL을 설정합니다:
export SQLITE_NOTES_MCP_URL=https://your-mcp-tunnel.example/mcp그런 다음 /reload-plugins을 실행하고 /mcp을 열어 sqlite-notes를 선택합니다. 고정된 mcp-remote 브리지는
MCP 서버를 통해 Stytch 인증 서버를 디스커버리하고, 자체 등록하고, 브라우저를
열고, PKCE를 사용하며, 액세스 토큰을 가지고 돌아옵니다.
다음과 같은 프롬프트를 시도해 보세요:
"Grocery list라는 제목과 coffee and oranges라는 본문으로 메모를 만들어 줘."
"내 메모를 나열해 줘."
"메모 1을 업데이트해서 milk를 추가해 줘."
"메모 1을 삭제해 줘."
30분 후 MCP 서버는 현재 액세스 토큰을 거부합니다. 브리지가
offline_access를 요청하지 않으므로 자동으로 갱신할 수 없으며 대화형 인증을
반복해야 합니다.
테스트
uv run pytest
cd web && npm run build자동화된 테스트는 CRUD 및 사용자 간 격리와 30분 액세스 토큰 경계를 다룹니다. 구성된 Stytch 프로젝트와 이메일 받은 편지함 없이는 전체 로그인을 자동화할 수 없으므로 브라우저 흐름은 명시적인 수동 엔드투엔드 확인입니다.
프로덕션 참고 사항
SQLite와 단일 프로세스는 이 연습을 위해 의도적으로 선택되었습니다. 유료 다중 인스턴스 서비스의 경우 관리형 데이터베이스, 마이그레이션, 백업, HTTPS, 구조화된 감사 로그, 속도 제한, 명시적 권한 부여 스코프를 사용하십시오. 동일한 경계를 유지하십시오: Stytch는 사용자를 인증하고, 데이터베이스와 서비스는 해당 사용자가 액세스할 수 있는 행과 작업을 결정합니다.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Google Keep-style notes app with an MCP server for AI agents to read/write notes.
Cross-session, cross-device memory for your agent: remember and recall notes. No key to start.
Persistent memory and vector search for AI agents. Hosted, OAuth-protected via Google sign-in.
- TaprootOAuthcom.taproothq
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenancePersonal note management server that enables creating, reading, updating, deleting, listing, and searching notes with support for titles, content, and tags.-
- AlicenseNot gradedqualityDmaintenanceEnables notes management through MCP integration with a Supabase PostgreSQL database, supporting full CRUD operations. It features secure user data isolation using JWT authentication and Row Level Security policies.MIT
- FlicenseBqualityDmaintenanceA simple server for saving, listing, and searching notes persisted to a local JSON file. It enables users to manage their personal notes using natural language via the Model Context Protocol.3-
- FlicenseNot gradedqualityDmaintenanceEnables to create notebooks and notes with tags, and perform full-text search across notes using FTS5 syntax, all stored locally in SQLite.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/walkerhughes/mcp-auth'
If you have feedback or need assistance with the MCP directory API, please join our Discord server