Skip to main content
Glama
epsilon-labs-llc

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.comwrangler.jsoncPUBLIC_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時間・一度限りURL

セットアップ

  1. package.jsonwrangler.jsoncsrc/auth.tsのサービス名と公開URLを変更します。

  2. D1データベースを作成し、wrangler.jsoncdatabase_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 を参照してください。

Maintenance

ActivityMaintained
ResponsivenessNo issues

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