cf-mcp-bridge
Provides read-only integration with the Cloudflare API for inspecting account data, including zones, DNS records, Worker scripts, Pages projects, R2 buckets, and Tunnels.
Allows listing and inspecting Cloudflare Worker scripts in the account.
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., "@cf-mcp-bridgelist DNS records for example.com"
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.
cf-mcp-bridge
A small, read-only Model Context Protocol (MCP) bridge for Cloudflare, deployed on Cloudflare Workers.
The bridge is intentionally narrow: it exposes a handful of useful Cloudflare account inspection tools instead of wrapping the entire Cloudflare API. The MCP endpoint fails closed unless both the Cloudflare API token and the MCP client secret are configured.
Current tools
cloudflare_token_status— verify the configured Cloudflare API tokenlist_accounts— list accounts visible to the tokenlist_zones— list zones/domains, optionally filtered by namelist_dns_records— inspect DNS records for a zonelist_workers— list Worker scriptslist_pages_projects— list Pages projectslist_r2_buckets— list R2 bucketslist_tunnels— list active Cloudflare Tunnels and connectionsget_tunnel_status— inspect one Tunnel
All current tools are read-only. There are no DNS mutation, Worker deployment, R2 deletion, cache purge, or Tunnel mutation tools in v0.1.
Related MCP server: seosiri-db-infra-mcp
Architecture
MCP client
|
| Authorization: Bearer <MCP_SHARED_SECRET>
v
Cloudflare Worker /mcp
|
| CF_API_TOKEN (Worker secret)
v
Cloudflare APIGET /health is public and returns only service health. /mcp requires the bearer secret.
The Cloudflare API token never needs to be stored in an MCP client. It stays in the Worker secret store.
Requirements
Node.js 20+
A Cloudflare account
Wrangler authenticated to the Cloudflare account
A read-only / least-privilege Cloudflare API token
Cloudflare recommends createMcpHandler() for new stateless MCP servers. This project uses the current Streamable HTTP stateless handler rather than the deprecated McpAgent path.
Local development
npm install
cp .dev.vars.example .dev.varsFill .dev.vars with local values:
CF_API_TOKEN="..."
CF_ACCOUNT_ID="..."
MCP_SHARED_SECRET="..."Generate a strong MCP shared secret, for example:
openssl rand -hex 32Then run:
npm run devThe MCP endpoint will normally be:
http://localhost:8787/mcpHealth check:
curl http://localhost:8787/healthTest with MCP Inspector
Run the inspector in another terminal:
npx @modelcontextprotocol/inspector@latestUse the local MCP URL and send this header:
Authorization: Bearer <MCP_SHARED_SECRET>Then connect and use List Tools.
Deploy to Cloudflare Workers
Authenticate Wrangler if needed:
npx wrangler loginSet the secrets. Do not put real values in wrangler.jsonc or commit them to Git.
npx wrangler secret put CF_API_TOKEN
npx wrangler secret put MCP_SHARED_SECRET
npx wrangler secret put CF_ACCOUNT_IDCF_ACCOUNT_ID is technically not sensitive, but storing it alongside the other deployment values keeps the repository generic. You may also configure it as a normal Worker variable if you prefer.
Deploy:
npm run deployThe endpoint will be similar to:
https://cf-mcp-bridge.<your-workers-subdomain>.workers.dev/mcpCloudflare API token permissions
Create a dedicated token for this bridge. Do not use the Global API Key.
Only grant permissions for the tools you actually want enabled. The exact Cloudflare permission labels can vary by product and account configuration, but the token should be limited to read access for the relevant resources, such as:
Account / account information: read
Zone: read
DNS: read
Workers Scripts: read
Pages: read
R2: read
Cloudflare Tunnel: read
Restrict the token to the specific account and zones whenever possible.
If a tool returns a Cloudflare permission error, add only the missing read scope rather than broadening the token to edit access.
Connect from an MCP client
Clients that support remote Streamable HTTP and custom headers can connect directly to /mcp with the bearer secret.
For clients that use a local proxy, mcp-remote can bridge to the remote endpoint. The exact header configuration depends on the client/version; keep MCP_SHARED_SECRET on the local machine and never embed the Cloudflare API token in the client.
Security model
The v0.1 security model is deliberately simple:
A dedicated Cloudflare API token is stored only as a Worker secret.
The Cloudflare API token should be read-only and resource-scoped.
The
/mcpendpoint requires an independent bearer secret.If required secrets are missing,
/mcpreturns503instead of starting insecurely.The repository contains no credentials.
No destructive MCP tools exist.
For a single-user deployment this is a pragmatic first layer. The next security upgrade is to put the MCP endpoint behind Cloudflare Access / OAuth, so MCP clients authenticate through an identity provider rather than a static shared secret.
Planned v0.2
Cloudflare Access / OAuth protection
Audit log reader
Worker/Pages deployment status and recent failures
Better pagination for very large accounts
Explicit output schemas
Tests against mocked Cloudflare API responses
Write actions should be added only as a separate, deliberately scoped layer, ideally using a second Cloudflare API token with narrowly limited edit permissions.
Useful commands
npm run dev
npm run typecheck
npm run deployReferences
Cloudflare Agents MCP docs: https://developers.cloudflare.com/agents/model-context-protocol/
Remote MCP server guide: https://developers.cloudflare.com/agents/model-context-protocol/guides/remote-mcp-server/
MCP handler API: https://developers.cloudflare.com/agents/model-context-protocol/apis/handler-api/
Cloudflare API: https://developers.cloudflare.com/api/
License
Private/internal use unless you choose to add a license later.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read-only MCP server for turva.dev, an agent-readiness audit and advisory service.
Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.
Read-only MCP access to your DEXUN AdWhiz account: ad accounts, AI recommendations, savings.
Related MCP Servers
- AlicenseBqualityCmaintenanceRead-only Cloudflare MCP server for SOC investigation, exposing Cloudflare services like WAF, bot management, analytics, and Zero Trust for querying and discovery.32MIT
- AlicenseNot gradedqualityDmaintenanceProvides secure live database querying, schema inspection, AWS S3 security audits, and Cloudflare infrastructure control through MCP tools.MIT
- AlicenseNot gradedqualityBmaintenanceProvides authenticated, read-only access to SuperOps data via MCP, supporting stdio and HTTP transports with privacy-safe redaction.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceProvides a unified MCP interface to manage Cloudflare services including DNS, compute (Workers, KV, D1), storage (R2), AI, security, Radar, and a universal API gateway for any Cloudflare v4 endpoint.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/duya7019/cf-mcp-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server