MCP Template
MCP Template
Better Auth의 패스키 인증과 인증된 연결을 확인하는 MCP Tool을 갖춘 Cloudflare Workers용 템플릿입니다.
엔드포인트
MCP:
https://mcp.example.com/mcp헬스 체크:
https://mcp.example.com/health인증:
https://mcp.example.com/auth/*패스키 등록:
https://mcp.example.com/passkey/register?token=...
https://mcp.example.com은 wrangler.jsonc의 PUBLIC_ORIGIN에 맞춰 변경합니다.
Related MCP server: GitHub OAuth MCP Server
기술 스택
Cloudflare Workers
Hono
TypeScript
pnpm
Model Context Protocol
Better Auth
Cloudflare D1
포함된 것
Cloudflare Workers, Hono, TypeScript strict
Better Auth, Passkey, OAuth, CIMD
Cloudflare D1용 Better Auth Migration
인증된 User만 실행할 수 있는
get_server_status최초 패스키 등록용 24시간·1회 한정 URL
설정
package.json,wrangler.jsonc,src/auth.ts의 서비스 이름과 공개 URL을 변경합니다.D1 데이터베이스를 생성하고
wrangler.jsonc의database_id를 설정합니다.pnpm install을 실행합니다.pnpm wrangler d1 migrations apply mcp-template-db --remote를 실행합니다.로컬 개발 시
.dev.vars.example을.dev.vars로 복제하고BETTER_AUTH_SECRET을 설정합니다.원격 환경에서는
pnpm wrangler secret put BETTER_AUTH_SECRET으로 동일한 Secret을 설정합니다.pnpm dev로 시작합니다.
PUBLIC_ORIGIN은 HTTPS 공개 URL로 설정합니다. 로컬 개발에서 Passkey를 사용하는 경우 wrangler.jsonc의 값과 접속하는 URL을 일치시키세요.
최초 User와 패스키 등록
공개 가입은 없습니다. D1에 User를 수동으로 등록한 후 등록 URL을 발급합니다.
pnpm user:issue-passkey-url user@example.com mcp-template-db https://mcp.example.comURL은 1회만 사용할 수 있으며 24시간 후 만료됩니다.
확인
pnpm format:check
pnpm typecheck
pnpm build문서
구현·문서 업데이트 시 규칙은 AGENTS.md를 참조하세요.
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloudflare Workers MCP server: ai-provider-status
Cloudflare Workers MCP server: blog
Cloudflare Workers MCP server: a11y-scorer
Cloudflare Workers MCP server: ai-gateway
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA reference MCP server for Cloudflare Workers that provides remote connection support with integrated GitHub OAuth authentication. It enables developers to build and deploy authenticated remote tools with user-specific access controls and persistent state management.-
- FlicenseNot gradedqualityCmaintenanceA remote MCP server for Cloudflare Workers featuring built-in GitHub OAuth for secure user authentication and identity-based access control to tools. It provides a reference implementation for managing remote MCP connections with persistent state and OAuth provider integration.1-
- FlicenseNot gradedqualityCmaintenanceA Cloudflare Workers-based MCP server that enables secure remote connections using built-in OAuth authentication via Cloudflare Access. It provides identity-based access control for MCP tools and supports persistent state management through Durable Objects and SSE.-
- FlicenseNot gradedqualityCmaintenanceThis is an MCP server deployed on Cloudflare Workers with OAuth authentication, enabling remote MCP clients to connect and use tools.-