cloudflare / cloudflare/mcp-server-cloudflare

[Feature Request] Worker routing management — list, add, and update routes and custom domains

Open
#396 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.2k
Forks
514
Avg merge
1d 21h
Merged PRs (30d)
2

Description

## Problem

When managing Workers via the MCP, there's currently no way to inspect or modify how traffic reaches a Worker. The existing tools cover deployment and bindings well, but stop short of routing — leaving a gap that forces you to context-switch to the dashboard or the REST API directly.

**Concrete example:** asking an AI assistant "what URL do I reach this worker on?" is unanswerable through the MCP today, even though that information is readily available via the Cloudflare API.

## Proposed Tools

| Tool | Description |
|---|---|
| `workers_list_routes` | List all routes (zone-based patterns) bound to a given worker |
| `workers_list_custom_domains` | List custom domains attached to a given worker |
| `workers_add_route` | Add a route pattern for a worker on a given zone |
| `workers_update_route` | Update an existing route pattern |
| `workers_delete_route` | Remove a route from a worker |
| `workers_add_custom_domain` | Attach a custom domain to a worker |
| `workers_delete_custom_domain` | Remove a custom domain from a worker |

## Use Cases

- "What URL do I reach `my-worker` on?" — currently impossible to answer via MCP
- "Add `api.example.com/*` as a route for this worker" — requires dropping out to `wrangler` or the dashboard
- Validating routing config as part of a deployment workflow, entirely within the MCP context

## Notes

The underlying data is available via the Cloudflare REST API (`/zones/{zone_id}/workers/routes` and `/workers/domains`). This would simply expose it through the typed tool interface, consistent with how other resources are handled in this server.

There is a related broader option in [cloudflare/mcp](https://github.com/cloudflare/mcp) (Code Mode), but that requires broader API permissions and is less ergonomic for targeted tasks. Domain-specific tooling here would be the right fit for users already using `workers-bindings`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.