# Cloudflare MCP Server Comparison

## Overview

[Cloudflare's MCP server](https://github.com/cloudflare/mcp-server-cloudflare) (4K stars, TypeScript) exposes Cloudflare Workers, KV, R2, D1, and other Cloudflare services as MCP tools. It runs on Cloudflare Workers itself (edge compute), making it one of the few MCP servers designed for remote-first deployment.

---

## How Cloudflare's MCP server works

1. **Workers extending `McpAgent`**: Each Cloudflare product has its own MCP server that extends the `McpAgent` base class from `agents-sdk`. The `McpAgent` class provides tool registration, auth, and transport handling.

2. **Per-app tool files**: Tools are organized as `tools/*.tools.ts` files with `registerXxxTools()` functions. This is the per-domain-file pattern, similar to our definitions files.

3. **OAuth 2.1 + PKCE**: Full OAuth implementation for Cloudflare API access. Uses the MCP spec's OAuth framework with Authorization Server Metadata (RFC 8414) and Dynamic Client Registration (RFC 7591).

4. **Remote-first architecture**: Runs on Cloudflare Workers with Streamable HTTP transport. No stdio — the server is deployed as a cloud-hosted endpoint that MCP clients connect to over HTTP.

5. **Sentry integration**: Built-in error tracking with Sentry for production monitoring.

---

## How our system differs

| Aspect                | Cloudflare MCP                      | Coda MCP Server                     |
| --------------------- | ----------------------------------- | ----------------------------------- |
| **Deployment**        | Edge (Cloudflare Workers)           | Local process (stdio)               |
| **Transport**         | Streamable HTTP (remote)            | stdio (local)                       |
| **Auth**              | OAuth 2.1 + PKCE                    | Bearer token forwarded to Express   |
| **Architecture**      | Class-based (`McpAgent`)            | Factory functions + interfaces      |
| **Tool organization** | `registerXxxTools()` per product    | `TOOL_DEFINITIONS` array per domain |
| **Error tracking**    | Sentry                              | OTel tracing + structured errors    |
| **Runtime**           | V8 isolates (Workers)               | Node.js (stdio process)             |
| **Sessions**          | Durable Objects (per-session state) | Stateless                           |

---

## What we are NOT adopting and why

1. **Edge deployment**: Our tools proxy to an Express API running in Fargate, not on the edge. Edge deployment would add cold start latency and require a different auth architecture.

2. **`McpAgent` base class**: Our factory-function approach with interface injection is more flexible and testable than class inheritance. The project style guide prefers composition over inheritance.

3. **OAuth 2.1 at the MCP layer**: Our auth is handled by the Express middleware stack. Adding OAuth to the MCP process would duplicate existing infrastructure. OAuth at the MCP layer becomes relevant when we add Streamable HTTP transport (future, with SDK v2).

---

## What we are adopting

### 1. OAuth 2.1 + PKCE for remote transport (future)

When we add Streamable HTTP transport, Cloudflare's OAuth implementation is the reference for TypeScript MCP servers. The MCP spec requires OAuth 2.1 + PKCE for remote HTTP transport, and Cloudflare has the most production-tested implementation.

### 2. Per-domain tool file organization

Cloudflare's `registerXxxTools()` pattern validates our per-domain definitions files (`account/definitions.ts`, `graphql/definitions.ts`, etc.).

---

## Validation of our approach

Cloudflare validates one key architectural decision we haven't yet adopted:

- **Remote-first deployment** requires OAuth, session management, and Streamable HTTP. We've correctly deferred these to SDK v2, but Cloudflare shows the full production path.

Cloudflare also validates one decision we've already made:

- **Metrics + error tracking** at the MCP layer. Our OTel tracing + structured errors serve the same purpose as their Sentry integration.

---

## References

- [cloudflare/mcp-server-cloudflare](https://github.com/cloudflare/mcp-server-cloudflare) (GitHub)
- Cloudflare blog: "Building MCP servers for Cloudflare services"

---

_Comparison conducted 2026-05-10._
