build-mcp

build-mcp is a command for coding agents from is-bo/fullstack-forge-skill. It costs 12 tokens per session (706 once invoked), scanned A, a copy of build-mcp, Apache-2.0.

A command for creating a remote MCP server on Cloudflare. MCP, or Model Context Protocol, is a standard way for AI applications to connect to tools and data.

In plain words
What is it for?
Use it to build an MCP server with registered tools, HTTP transport, OAuth security, Cloudflare storage bindings, and Wrangler deployment.
Why use it?
It provides the server structure, configuration, security guidance, testing steps, and deployment commands needed to expose tools remotely.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/is-bo/fullstack-forge-skill/build-mcp
Clone the repo
git clone --depth 1 https://github.com/is-bo/fullstack-forge-skill

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-mcp

README.md
[![agentmods](https://agentmods.dev/badge/commands/is-bo/fullstack-forge-skill/build-mcp.svg)](https://agentmods.dev/commands/is-bo/fullstack-forge-skill/build-mcp)
Your own site
<a href="https://agentmods.dev/commands/is-bo/fullstack-forge-skill/build-mcp"><img src="https://agentmods.dev/badge/commands/is-bo/fullstack-forge-skill/build-mcp.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.00706
Opus 5 $0.00006 $0.00353
Sonnet 5 $0.00002 $0.00141
Haiku 4.5 $0.00001 $0.00071

Measured yesterday against content hash 265c29d38cd8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

build-mcp scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fetch(request: Request, env: Env, ctx: ExecutionContext) {
Origin

This is a copy

100% identical to build-mcp — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

third_party/agent-skills/cloudflare-skills/content/commands/build-mcp.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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
  7. Deploy: npx wrangler deploy

Quick Reference

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { McpAgent } from "agents/mcp";
import { z } from "zod";

export class MyMCP extends McpAgent<Env, State, {}> {
  server = new McpServer({ name: "my-mcp", version: "1.0.0" });
  initialState = { counter: 0 };

  async init() {
    this.server.registerTool("my_tool", {
      description: "Does something useful",
      inputSchema: { query: z.string() }
    }, async ({ query }) => ({
      content: [{ text: `Result: ${query}`, type: "text" }]
    }));
  }
}

// Entry point
export default {
  fetch(request: Request, env: Env, ctx: ExecutionContext) {
    return MyMCP.serve("/mcp", { binding: "MyMCP" }).fetch(request, env, ctx);
  }
};

Transport Options

Transport Method Use for
Streamable HTTP MyMCP.serve("/mcp") External/public clients (recommended)
SSE MyMCP.serveSSE("/sse") Legacy clients only (deprecated)
RPC addMcpServer(name, env.Binding) Same-Worker internal calls

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 77 lines · 12 tokens per session scan A 265c29d38cd8

Subscribe to this mod's changes

build-mcp is a command published in the GitHub repository is-bo/fullstack-forge-skill (2 stars, last pushed 7d ago), licensed Apache-2.0. It adds 12 tokens to every session and 706 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to build-mcp, differing in 0 lines, and is treated as a copy.