Enables deployment of MCP servers as serverless functions on Cloudflare's edge computing platform
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cloudflare Remote MCP Serverlist my available Craft documents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Craft MCP Server
A remote Model Context Protocol (MCP) server for Craft document management, deployed on Cloudflare Workers. This server enables AI assistants like Claude to read, write, search, and manage Craft documents and collections.
Features
Document Management: Read, write, search, and delete content in Craft documents
Collection Support: Work with Craft collections (similar to Notion databases)
Multi-Document: Support for multiple Craft documents via configuration
GitHub OAuth Authentication: Secure access control using GitHub accounts
Serverless: Deployed on Cloudflare Workers with Durable Objects
Setup
1. Clone and Install
git clone <your-repo-url>
cd craft-mcp
npm install2. Create GitHub OAuth App
Click New OAuth App
Fill in:
Application name: Craft MCP Server
Homepage URL:
https://craft-mcp.YOUR_SUBDOMAIN.workers.devAuthorization callback URL:
https://craft-mcp.YOUR_SUBDOMAIN.workers.dev/callback
Click Register application
Copy the Client ID and generate a Client Secret
3. Create KV Namespace
# Create the KV namespace for OAuth tokens
wrangler kv namespace create OAUTH_KV
# Note the namespace ID from the output
# Update wrangler.toml with this ID4. Configure Environment Variables
For Local Development
Create a .dev.vars file in the project root:
# Craft documents
CRAFT_DOCUMENTS={"My Document": "https://connect.craft.do/links/YOUR_LINK_ID/api/v1"}
# GitHub OAuth credentials
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# Optional: Restrict access to specific GitHub users
ALLOWED_USERNAMES=username1,username2Get Craft Document Link IDs:
Open your Craft document
Click Share → Enable API
Copy the link ID from the URL (e.g.,
AcHPMgNXYdR)
For Production
Set via Cloudflare Dashboard (Workers & Pages → Your Worker → Settings → Variables):
CRAFT_DOCUMENTS- JSON mapping of document names to API URLsGITHUB_CLIENT_ID- Your GitHub OAuth Client IDGITHUB_CLIENT_SECRET- Your GitHub OAuth Client Secret (mark as encrypted)ALLOWED_USERNAMES- (Optional) Comma-separated list of allowed GitHub usernames
OR use Wrangler CLI:
wrangler secret put GITHUB_CLIENT_ID
wrangler secret put GITHUB_CLIENT_SECRET
wrangler secret put CRAFT_DOCUMENTS5. Update wrangler.toml
Replace YOUR_KV_NAMESPACE_ID_HERE with your actual KV namespace ID:
[[kv_namespaces]]
binding = "OAUTH_KV"
id = "your_actual_namespace_id"6. Run Locally
npm run devYour MCP server will be available at http://localhost:8787/sse
7. Deploy to Cloudflare
Via GitHub (Recommended)
Connect your GitHub repo to Cloudflare (Workers & Pages → Create → Connect to Git)
Configure environment variables in the dashboard
Push changes to
mainbranch - Cloudflare automatically deploys
Direct Deployment
npm run deployNote: Set environment variables in the dashboard first. The keep_vars = true setting ensures they won't be overwritten.
Connect to Claude Desktop
Edit your Claude Desktop config (Settings → Developer → Edit Config):
{
"mcpServers": {
"craft": {
"url": "https://craft-mcp.YOUR_SUBDOMAIN.workers.dev/sse"
}
}
}For local development, use http://localhost:8787/sse
Authentication Flow:
Restart Claude Desktop
When you try to use Craft tools, you'll be redirected to GitHub
Authorize the application
You'll be redirected back and authentication will complete
Craft tools will become available
The OAuth flow is handled automatically by the MCP client.
Available Tools
listDocuments- Show configured documentsreadDocument- Read document content with embedded IDsinsertText- Insert markdown content into documentsdeleteText- Delete pages or headingssearch- Search within documents with regex supportgetCollectionItems- Retrieve items from Craft collectionscreateCollectionItems- Add items to collectionsupdateCollectionItems- Update existing collection items
See CLAUDE.md for detailed tool documentation and architecture information.
Development
# Install dependencies
npm install
# Run locally
npm run dev
# Type check
npm run type-check
# Lint and format
npm run lint:fix
npm run format
# Deploy to Cloudflare
npm run deployProject Structure
craft-mcp/
├── src/
│ └── index.ts # MCP server implementation
├── docs/ # API documentation
├── wrangler.toml # Cloudflare Workers config (placeholders only)
├── .dev.vars # Local env vars (gitignored, create this)
└── package.jsonSecurity Notes
OAuth Authentication: All access requires GitHub authentication
User Whitelist: Use
ALLOWED_USERNAMESto restrict access to specific GitHub usersDocument Link IDs: Provide full API access to your Craft documents - keep them private
Environment Variables: Never commit real credentials or link IDs to version control
KV Namespace: The
OAUTH_KVnamespace stores OAuth tokens and session stateKeep
.dev.varsand production environment variables secure
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.