-
Notifications
You must be signed in to change notification settings - Fork 313
Description
Bug Description
When using the cloudflare-bindings MCP server from VS Code (GitHub Copilot), all tools that require an account ID fail with the error:
No currently active accountId. Try listing your accounts (accounts_list) and then setting an active account (set_active_account)
However, the set_active_account tool is not exposed in the 25 tools discovered by VS Code.
Environment
- MCP Client: VS Code 1.106.3 with GitHub Copilot
- MCP Server:
https://bindings.mcp.cloudflare.com/mcp - Transport: Tested both direct HTTP (
"type": "http") and viamcp-remote0.1.31 - Account: Single Cloudflare account
Steps to Reproduce
-
Configure VS Code MCP with cloudflare-bindings:
{ "servers": { "cloudflare-bindings": { "command": "npx", "args": ["mcp-remote", "https://bindings.mcp.cloudflare.com/mcp"] } } } -
Start the server - VS Code discovers 25 tools
-
Call
accounts_list- works, returns the account:{"accounts":[{"id":"xxx","name":"[email protected]'s Account"}],"count":1} -
Call
d1_database_create(or any D1/KV/R2/Workers tool) - fails:No currently active accountId. Try listing your accounts (accounts_list) and then setting an active account (set_active_account) -
Try to call
set_active_account- tool doesn't exist in the exposed tools
Expected Behavior
Either:
- Auto-select the account when there's only one account (most common case)
- Expose the
set_active_accounttool so users can set it manually
Code Reference
Looking at the source code in apps/workers-bindings/src/bindings.app.ts, the setActiveAccountId method exists:
async setActiveAccountId(accountId: string) {
// ...
}And registerAccountTools is called in init(), but the set_active_account tool appears to not be registered or is filtered out.
Impact
This bug makes the entire cloudflare-bindings MCP server unusable for managing D1 databases, KV namespaces, R2 buckets, and Workers - the core functionality of the server.
We spent ~30 minutes trying different configurations (direct HTTP, mcp-remote, re-authenticating OAuth multiple times) before realizing the tool simply isn't exposed.
Workaround
Use Wrangler CLI directly:
npx wrangler d1 create my-databaseThis works fine, but defeats the purpose of having an MCP server for AI-assisted Cloudflare management.
Suggested Fix
In packages/mcp-common/src/tools/account.tools.ts, ensure set_active_account is registered:
agent.server.tool(
'set_active_account',
'Set the active Cloudflare account for subsequent operations',
{ account_id: z.string().describe('The account ID to set as active') },
async ({ account_id }) => {
await agent.setActiveAccountId(account_id)
return { content: [{ type: 'text', text: `Active account set to ${account_id}` }] }
}
)Or better, auto-select when accounts.length === 1.