mKit

mKit

A boilerplate for building MCP servers on Cloudflare Workers with built-in OAuth 2.1 authentication, Stripe billing integration, and OpenAI Apps SDK UI support.

Category
Visit Server

README

<p align="center"> <img src="./brand/mKit-brand-logo.png" alt="mKit" height="160" /> </p>

mKit — MCP Server Boilerplate for Cloudflare Workers

This repository is a boilerplate for bootstrapping MCP servers on Cloudflare Workers with OAuth 2.1, Stripe billing, and OpenAI Apps SDK UI integration.

Last updated: 2026-01-08 Owner: TBD (set maintainer/team) Review cadence: Quarterly (confirm)

Doc requirements

  • Audience tier: Beginner to intermediate
  • Scope: Using this repo as a template to configure, run, and deploy an MCP server
  • Non-scope: OAuth provider setup details, Stripe account setup, and product-specific UI design
  • Required approvals: Maintainer approval for production changes (confirm)

Table of contents

Risks and assumptions

  • Assumptions: You control a Cloudflare account, OAuth providers, and a Stripe account.
  • Risks / blast radius: Misconfigured secrets or webhook signing can cause auth/payment failures.
  • Rollback / recovery: Rotate secrets and redeploy; disable affected routes until fixed.

Prerequisites

  • Required: Node.js 20+, pnpm, Wrangler CLI, Cloudflare account
  • Optional: Stripe and OAuth provider accounts (needed to enable payments and login)

Quickstart

1) Install dependencies

pnpm install

2) Run setup

pnpm setup

This interactive script will:

  • Prompt for OAuth credentials (Google/GitHub)
  • Prompt for Stripe configuration (optional)
  • Generate a secure cookie encryption key
  • Create KV namespaces in Cloudflare
  • Write .env and update wrangler.jsonc

3) Run locally

pnpm dev
pnpm dev:worker

Run each command in a separate terminal.

4) Verify

Expected output:

  • Vite prints a local dev server URL without errors.
  • Wrangler prints a local worker URL and no startup errors.
  • A request to /mcp returns a non-5xx response.

Common tasks

Create a new tool to expose MCP functionality

  • What you get: A new MCP tool registered at server startup.
  • Steps:
# Add a new file under src/tools/free/ or src/tools/paid/
  • Verify: The tool is registered in the server startup logs.

Add a new widget page for the Apps SDK UI

  • What you get: A new auto-discovered widget route.
  • Steps:
# Add an HTML file in src/app/routes/ and a React component in src/app/components/
  • Verify: The route is present in the generated manifest at build time.

Build and deploy to Cloudflare

  • What you get: A live MCP endpoint at your worker URL.
  • Steps:
pnpm build-deploy
  • Verify: pnpm wrangler deploy reports success and the worker URL responds.

Run quality checks

  • What you get: Type safety and test validation.
  • Steps:
pnpm typecheck
pnpm lint
pnpm test
  • Verify: Each command exits with status 0.

Troubleshooting

Symptom: wrangler dev fails with missing KV namespace

Cause: wrangler.jsonc has placeholder KV IDs. Fix:

pnpm wrangler kv namespace create OAUTH_KV

Update wrangler.jsonc with the real IDs and retry.

Symptom: OAuth login fails or tokens are rejected

Cause: OAuth issuer or JWKS URL is incorrect. Fix: Re-check OAUTH_ISSUER and OAUTH_JWKS_URI in .env.

Symptom: Stripe webhooks are rejected

Cause: Webhook signing secret does not match Stripe configuration. Fix: Update STRIPE_WEBHOOK_SECRET with the value from Stripe dashboard.

Acceptance criteria

  • [ ] .env created from .env.example with valid values.
  • [ ] KV namespace IDs set in wrangler.jsonc.
  • [ ] Local dev runs without startup errors.
  • [ ] At least one tool is registered and callable.
  • [ ] Deployment succeeds in Cloudflare.
  • [ ] Troubleshooting steps are validated by maintainers.

Evidence bundle

  • Lint outputs (Vale/markdownlint/link check): Not run (no configs found).
  • Brand check output: Not run (no brand check script found).
  • Readability output (if available): Not run (no readability script found).
  • Checklist snapshot: Pending maintainer confirmation.

Reference

  • Project layout: src/worker, src/auth, src/billing, src/tools, src/app
  • Commands: pnpm setup, pnpm dev, pnpm dev:worker, pnpm build, pnpm deploy, pnpm test, pnpm lint
  • Related docs: docs/architecture.md, docs/development.md, docs/deployment.md, docs/configuration.md, docs/runbook.md

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured