Skip to main content
Glama
MCP Template

MCP Template

MCP Template

MCP Cloudflare Workers Hono TypeScript pnpm

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

설정

  1. package.json, wrangler.jsonc, src/auth.ts의 서비스 이름과 공개 URL을 변경합니다.

  2. D1 데이터베이스를 생성하고 wrangler.jsonc의 database_id를 설정합니다.

  3. pnpm install을 실행합니다.

  4. pnpm wrangler d1 migrations apply mcp-template-db --remote를 실행합니다.

  5. 로컬 개발 시 .dev.vars.example을 .dev.vars로 복제하고 BETTER_AUTH_SECRET을 설정합니다.

  6. 원격 환경에서는 pnpm wrangler secret put BETTER_AUTH_SECRET으로 동일한 Secret을 설정합니다.

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

URL은 1회만 사용할 수 있으며 24시간 후 만료됩니다.

확인

pnpm format:check
pnpm typecheck
pnpm build

문서

구현·문서 업데이트 시 규칙은 AGENTS.md를 참조하세요.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A 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.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A 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
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A 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.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    This is an MCP server deployed on Cloudflare Workers with OAuth authentication, enabling remote MCP clients to connect and use tools.
    -