Set up Cloudflare Workers in Metorial for AI agents
Share Cloudflare Workers with your team in Claude, ChatGPT and Cursor through Metorial: global API key or API token sign-in, 36 tools (17 read-only).
To give your team Cloudflare Workers in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Cloudflare Workers integration in a Metorial portal, and each person connects with a global API key. Agents can manage Cloudflare Workers serverless scripts, versions, and deployments on Cloudflare's global edge network. The integration has 36 tools, 17 read-only, 13 write and 6 destructive, plus 3 triggers.
What you'll learn
- How an admin shares Cloudflare Workers in a portal and how each person connects
- What Cloudflare Workers asks for when you connect, and where to find it
- How to keep the 17 read-only tools and reject the other 19
Before you start
- A portal with at least one access group
- A global API key from Cloudflare Workers for each person, or one for a shared connection
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in methods
| Method | Type | What a person provides |
|---|---|---|
| Global API Key (default) | Custom credentials | email and token |
| API Token | API token | token |
The portal and metorial setup use Global API Key unless someone picks another method.
Global API Key
To connect, a person enters these values:
email: Cloudflare account email address.token: Cloudflare Global API Key. Found under My Profile > API Tokens in the dashboard.
API Token
To connect, a person enters:
token: Cloudflare API Token. Created via My Profile > API Tokens in the Cloudflare dashboard.
Setup settings
Whichever method you pick, setup also asks for:
accountId: Cloudflare Account ID. Found in the Cloudflare dashboard under Account Home.
Admin: share Cloudflare Workers in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
Share a new integration
Select Share a Resource, then New Integration, and choose Cloudflare Workers. Under Auth Method, keep Global API Key or pick another. For how members connect, choose Each person connects so everyone enters their own global API key, or Shared connection to enter one global API key for everyone.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Cloudflare Workers.
Choose who gets it
Add the access groups that should see Cloudflare Workers. When a person asks for access from the portal, the request appears under Access Requests.
With the CLI
The CLI cannot create the per-user Cloudflare Workers integration. Once it exists, check which groups have it:
Employee: connect Cloudflare Workers
In the portal
Open Cloudflare Workers in the catalog
Sign in to your portal and open Cloudflare Workers. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. In the setup window, enter your global API key (email and token).
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
catalog search prints the catalog item ID. metorial setup uses Global API Key. To connect with API Token instead, find its ID with metorial catalog get <catalog-item-id> and add --auth-method <auth-method-id>.
Add it to your AI client
metorial install adds your Cloudflare Workers connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.
For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.
Make it read-only
Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 17 read-only tools, such as get_domain and get_script, and lose the 13 write tools, such as put_secret or create_tail, and the 6 destructive tools, such as delete_tail or delete_route.
Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.
Check it worked
metorial tools lists the 36 tools, minus any you rejected. list_domains takes no input. It lists all custom domains attached to Workers in the account.
To see every input a tool takes, run metorial schema <integration-id> <tool-key>.
Tools
Read-only tools (17)
list_tails: List all active tail sessions for a Worker script. NeedsscriptName.list_deployments: List all deployments for a Worker script. NeedsscriptName.get_subdomain: Retrieve the account's workers.dev subdomain and optionally check whether a specific Worker is enabled on it.list_secrets: List all secret bindings on a Worker script. NeedsscriptName.list_telemetry_keys: List all available telemetry event keys for Workers observability queries.list_scripts: List all Worker scripts in the account.get_script: Retrieve detailed metadata and settings for a specific Worker script including bindings, compatibility settings, observability config, and placement. NeedsscriptName.get_schedules: Retrieve all cron trigger schedules configured for a Worker. NeedsscriptName.list_routes: List all Worker routes for a Cloudflare zone. NeedszoneId.get_version: Retrieve detailed information about a specific Worker version, including its bindings, runtime configuration, and startup time. NeedsscriptNameandversionId.get_worker_settings: Retrieve the full settings and bindings configuration for a Worker script, including environment variables, KV namespaces, R2 buckets, D1 databases, Queues, Durable Objects, and other bindings. NeedsscriptName.list_domains: List all custom domains attached to Workers in the account.list_versions: List all versions of a Worker script. NeedsscriptName.get_deployment: Retrieve a specific Worker deployment, including its traffic strategy and version split. NeedsscriptNameanddeploymentId.get_domain: Retrieve a specific custom domain attachment for a Worker. NeedsdomainId.get_script_content: Download a Worker's script content as a Slate attachment. NeedsscriptName.get_secret: Retrieve metadata for a secret binding on a Worker script. NeedsscriptNameandsecretName.
Write tools (13)
attach_domain: Attach a Worker to a custom domain (hostname) on a Cloudflare zone. Needshostname,scriptNameandzoneId.query_telemetry: Run an observability query against Workers telemetry data. NeedstimeframeFromandtimeframeTo.create_deployment: Deploy one or more Worker versions with a traffic split. NeedsscriptNameandversions.update_script_settings: Update script-level settings for a Worker including Logpush, observability, tail consumers, and tags. NeedsscriptName.put_secret: Create or update a secret on a Worker script. NeedsscriptName,secretNameandsecretValue.create_route: Create a new Worker route that maps a URL pattern on a zone to a Worker script. NeedszoneId,patternandscriptName.update_schedules: Replace all cron trigger schedules for a Worker. NeedsscriptNameandschedules.set_script_subdomain: Enable or disable a Worker on the workers.dev subdomain. NeedsscriptNameandenabled.create_tail: Start a real-time log tail for a Worker script. NeedsscriptName.update_route: Update an existing Worker route's URL pattern and/or the target Worker script. NeedszoneId,routeId,patternandscriptName.put_script_content: Replace a Worker's script content without changing its existing configuration or metadata. NeedsscriptNameandscriptContent.upload_version: Upload a new deployable Worker version without deploying it. NeedsscriptNameandscriptContent.upload_worker_module: Create or replace a Worker script by uploading code and multipart metadata. NeedsscriptNameandscriptContent.
Destructive tools (6)
delete_secret: Delete a secret binding from a Worker script. NeedsscriptNameandsecretName.delete_script: Delete a Worker script from the account. NeedsscriptName.detach_domain: Detach a Worker from a custom domain. NeedsdomainId.delete_tail: Stop an active tail session for a Worker script. NeedsscriptNameandtailId.delete_route: Delete a Worker route from a zone. NeedszoneIdandrouteId.delete_deployment: Delete a specific Worker deployment from a script. NeedsscriptNameanddeploymentId.
Triggers
Cloudflare Workers has 3 triggers, which fire on events in Cloudflare Workers:
script_changes: Detects when Worker scripts are created, updated, or deleted in the account.inbound_webhookdeployment_changes: Detects when new deployments are created for a specific Worker script, including gradual rollouts and full deployments.
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Cloudflare Workers there
- Tool permissions: tool filters and what employees see
- Cloudflare Workers on metorial.com: the integration overview