Mcp Boilerplate banner
iannuttall iannuttall

Mcp Boilerplate

DevOps community intermediate

Description

A remote Cloudflare MCP server boilerplate with user authentication and Stripe for paid tools.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

MCP Boilerplate: Simple Setup Guide

This project helps you create your own remote MCP server on Cloudflare with user login and payment options. You don't need to be a technical expert to get it running.

[!NOTE] This project is now free to use and open source. If you want to support me, just follow me on X [@iannuttall](https://x.com/iannuttall) and subscribe to [my newsletter](https://ian.is).

What You'll Get

  • An MCP server that works with Cursor, Claude and other AI assistants
  • User login with Google or GitHub
  • Payment processing with Stripe
  • The ability to create both free and paid MCP tools

Setup Checklist

Before starting, make sure you have:

Step-by-Step Setup

Step 1: Get the Code

  1. Clone this repository to your computer:
git clone https://github.com/iannuttall/mcp-boilerplate.git
cd mcp-boilerplate
  1. Install everything needed:
npm install

Step 2: Set Up the Database

  1. Install Wrangler (Cloudflare's tool) if you haven't already:
npm install -g wrangler
  1. Create a database for user login:
npx wrangler kv namespace create "OAUTH_KV"

Note: you can't use a different name for this database. It has to be "OAUTH_KV".

  1. After running this command, you'll see some text that includes `id` and `preview_id` values

  2. Open the `wrangler.jsonc` file in the project folder

  3. Look for the section with `"kv_namespaces": [`

  4. Add your database information there:

"kv_namespaces": [
  {
    "binding": "OAUTH_KV",
    "id": "paste-your-id-here",
    "preview_id": "paste-your-preview-id-here"
  }
]

Step 3: Set Up Your Local Settings

  1. Create a file for your settings:
cp .dev.vars.example .dev.vars
  1. Open the `.dev.vars` file in your code editor

  2. You'll need to add several values here (we'll get them in the next steps)

Step 4a: Setting Up Google Login (Recommended)

  1. Go to the Google Cloud Console
  2. Create a new project with any name you like
  3. Go to "APIs & Services" > "Credentials"
  4. Click "+ CREATE CREDENTIALS" and choose "OAuth client ID"
  5. If prompted, set up a consent screen:
    • Choose "External" for User Type
    • Add an App name (like "My AI Tool")
    • Add your email address where required
    • You can skip the "Scopes" and "Test users" sections
  6. For the OAuth client:
    • Select "Web application" for Application type
    • Give it a name
    • Under "Authorized redirect URIs" add the following:
http://localhost:8787/callback/google
  1. Click "CREATE"
  2. You'll now see your Client ID and Client Secret - copy these val