shell
$ npx -y skills add cloudflare/skills --agent claude-codeShips with cloudflare. Installing the plugin gets this command.
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/build-mcp
Context preview
What this command does when you run it.
Build a remote MCP server on Cloudflare using McpAgent
Stats
Stars2,459
Forks228
LanguageShell
LicenseApache-2.0
Ships with cloudflare
Command definition
build-mcp.md
--- description: Build a remote MCP server on Cloudflare using McpAgent argument-hint: [mcp-description] allowed-tools: [Read, Glob, Grep, Bash, Write, Edit, WebFetch] --- # Build MCP Server on Cloudflare ## Arguments The user invoked this command with: $ARGUMENTS ## Instructions When this command is invoked: 1. Read the skill file at `agents-sdk/SKILL.md` for core SDK guidance 2. Read `agents-sdk/references/mcp.md` for MCP client and server APIs, transports, and securing 3. Read `agents-sdk/references/configuration.md` for wrangler setup 4. Fetch https://developers.cloudflare.com/agents/api-reference/mcp-agent-api/ for the latest McpAgent API 5. For OAuth/security, fetch https://developers.cloudflare.com/agents/api-reference/securing-mcp-servers/ ## Scaffold Steps 1. **Create project**: `npx create-cloudflare@latest --template cloudflare/agents-starter` (or start fresh) 2. **Install MCP SDK**: `npm install @modelcontextprotocol/sdk zod` 3. **Configure wrangler.jsonc**: DO binding + `new_sqlite_classes` migration for the McpAgent class 4. **Implement McpAgent**: extend `McpAgent`, create `McpServer`, register tools in `init()` 5. **Serve transport**: `MyMCP.serve("/mcp", { binding: "MyMCP" })` (Streamable HTTP, recommended) 6. **Test**: `npx @modelcontextprotocol/inspector@latest`
