Development Guide
How to add a new MCP server to the MCP Pure hub.
Step 1: Research
Follow the Agent Research Guide to identify the service and tools.
Step 2: Create Server Directory
Create a new folder in apps/hub/src/mcp/[name].
bashmkdir -p apps/hub/src/mcp/reddit
Step 3: Implement Logic
We follow a standard pattern:
service.ts: Handles API calls to the target service.tools.ts: Defines MCP tools and registers them to a server instance.index.ts: The Hono sub-app that handles SSE transport.
Step 4: Register Route
Update apps/hub/src/index.ts to mount your new sub-app:
typescriptimport yourService from "./mcp/yourService"; app.route("/mcp/yourService", yourService);
Step 5: Test and Deploy Hub
- Run
bun run dev:huband use the MCP Inspector to test. - Run
bun run deploy:hubto push to Cloudflare.
Step 6: Deploy Frontend (Cloudflare Pages)
The frontend in apps/web is a Next.js application optimized for Cloudflare Pages.
- Go to the Cloudflare Dashboard.
- Navigate to Workers & Pages > Create application > Pages > Connect to Git.
- Select the
mcppurerepository. - Set Build command:
cd apps/web && bun run pages:build - Set Build output directory:
apps/web/.next-on-pages - Add compatibility flag:
nodejs_compat - Deploy!