Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ cloudflare-mcp/
│ └── tool-call.test.ts
├── scripts/
│ └── seed-r2.ts # Seed OpenAPI spec to R2 bucket
├── docs/
│ └── connection-guides/ # Client-specific MCP setup guides
├── .github/workflows/
│ ├── ci.yml # PR validation
│ └── bonk.yml # AI code review
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

MCP URL: `https://mcp.cloudflare.com/mcp`

### Connection Guides

- [Claude Code](docs/connection-guides/claude-code.md)

### Option 1: OAuth (Recommended)

Just connect to the MCP server URL - you'll be redirected to Cloudflare to authorize and select permissions.
Expand Down
60 changes: 60 additions & 0 deletions docs/connection-guides/claude-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Connect Claude Code to the Cloudflare MCP server

The Cloudflare MCP server gives Claude Code access to the Cloudflare API through the remote HTTP transport.

## Add the server

Run this command from the project where you use Claude Code:

```sh
claude mcp add --transport http cloudflare-api https://mcp.cloudflare.com/mcp
```

This creates a local-scope configuration by default. It is private to you and loads only for the current project.

To load the server in every project for your user, set the scope to `user`:

```sh
claude mcp add --transport http --scope user cloudflare-api https://mcp.cloudflare.com/mcp
```

## Authenticate with Cloudflare

Start Claude Code, run `/mcp`, and select `cloudflare-api`. Follow the browser prompt to sign in to Cloudflare and choose the permissions Claude Code can use.

Claude Code stores and refreshes the OAuth credentials. They do not need to be added to a project file.

## Share the configuration with a project

Use project scope when everyone working in a repository should receive the same server configuration:

```sh
claude mcp add --transport http --scope project cloudflare-api https://mcp.cloudflare.com/mcp
```

This creates or updates `.mcp.json` in the project root:

```json
{
"mcpServers": {
"cloudflare-api": {
"type": "http",
"url": "https://mcp.cloudflare.com/mcp"
}
}
}
```

Keep `"type": "http"` when editing the file manually. Without it, Claude Code does not treat the URL as a remote HTTP server. Claude Code asks each user to approve project-scoped servers before connecting.

## Verify the connection

Check the saved configuration from your terminal:

```sh
claude mcp get cloudflare-api
```

Within Claude Code, run `/mcp` to check the connection or repeat the OAuth flow. If the server is missing, confirm that the configuration uses the exact URL `https://mcp.cloudflare.com/mcp` and includes `"type": "http"`.

For details about configuration scopes and MCP commands, refer to the [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp).