Skip to content

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

Description

@stardraw-fred

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 (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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions