Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .changeset/clever-humans-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'workers-observability': patch
'cloudflare-casb-mcp-server': patch
'cloudflare-browser-mcp-server': patch
'containers-mcp': patch
'workers-bindings': patch
'docs-vectorize': patch
'workers-builds': patch
'@repo/eval-tools': patch
'@repo/mcp-common': patch
'dns-analytics': patch
'dex-analysis': patch
'docs-autorag': patch
'cloudflare-ai-gateway-mcp-server': patch
'auditlogs': patch
'demo-day': patch
'cloudflare-autorag-mcp-server': patch
'graphql-mcp-server': patch
'logpush': patch
'cloudflare-radar-mcp-server': patch
---

feat: Add MCP tool titles and hints to all Cloudflare tools
4 changes: 2 additions & 2 deletions apps/ai-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/auditlogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/autorag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/browser-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/cloudflare-one-casb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/demo-day/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"test": "vitest run"
},
"dependencies": {
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"zod": "3.24.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions apps/dex-analysis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"jszip": "3.10.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/dns-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/docs-autorag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"mime": "4.0.6",
Expand Down
4 changes: 2 additions & 2 deletions apps/docs-vectorize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"mime": "4.0.6",
Expand Down
4 changes: 2 additions & 2 deletions apps/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/logpush/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/radar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/sandbox-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/node-server": "1.13.8",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@n8n/json-schema-to-zod": "1.1.0",
"@repo/eval-tools": "workspace:*",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cron-schedule": "5.0.4",
"esbuild": "0.25.1",
"hono": "4.7.6",
Expand Down
4 changes: 2 additions & 2 deletions apps/workers-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
},
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@n8n/json-schema-to-zod": "1.1.0",
"@repo/eval-tools": "workspace:*",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"ai": "4.3.10",
"concurrently": "9.1.2",
"hono": "4.7.6",
Expand Down
4 changes: 2 additions & 2 deletions apps/workers-builds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.5",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/workers-observability/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"@cloudflare/workers-oauth-provider": "0.0.5",
"@fast-csv/format": "5.0.2",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-common": "workspace:*",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"zod": "3.24.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/eval-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@ai-sdk/google": "1.2.17",
"@ai-sdk/openai": "1.3.20",
"@cloudflare/vitest-pool-workers": "0.8.14",
"agents": "0.0.100",
"agents": "0.0.113",
"ai": "4.3.10",
"ai-gateway-provider": "0.0.6",
"workers-ai-provider": "0.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"@cloudflare/workers-oauth-provider": "0.0.5",
"@fast-csv/format": "5.0.2",
"@hono/zod-validator": "0.4.3",
"@modelcontextprotocol/sdk": "1.13.3",
"@modelcontextprotocol/sdk": "1.17.2",
"@repo/mcp-observability": "workspace:*",
"agents": "0.0.100",
"agents": "0.0.113",
"cloudflare": "4.2.0",
"hono": "4.7.6",
"toucan-js": "4.1.1",
Expand Down
100 changes: 59 additions & 41 deletions packages/mcp-common/src/tools/account.tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,62 @@ import type { CloudflareMcpAgent } from '../types/cloudflare-mcp-agent.types'

export function registerAccountTools(agent: CloudflareMcpAgent) {
// Tool to list all accounts
agent.server.tool('accounts_list', 'List all accounts in your Cloudflare account', async () => {
try {
const results = await handleAccountsList({
client: getCloudflareClient(agent.props.accessToken),
})
// Sort accounts by created_on date (newest first)
const accounts = results
// order by created_on desc ( newest first )
.sort((a, b) => {
if (!a.created_on) return 1
if (!b.created_on) return -1
return new Date(b.created_on).getTime() - new Date(a.created_on).getTime()
})
// Remove fields not needed by the LLM
.map((account) => {
return {
id: account.id,
name: account.name,
created_on: account.created_on,
}
agent.server.tool(
'accounts_list',
'List all accounts in your Cloudflare account',
{},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to test if empty objects still cause issues with windsurf tool calling! #80

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Nice ( tested in staging ) ! Looks good

{
title: 'List accounts',
annotations: {
readOnlyHint: true,
},
},
async () => {
try {
const results = await handleAccountsList({
client: getCloudflareClient(agent.props.accessToken),
})
// Sort accounts by created_on date (newest first)
const accounts = results
// order by created_on desc ( newest first )
.sort((a, b) => {
if (!a.created_on) return 1
if (!b.created_on) return -1
return new Date(b.created_on).getTime() - new Date(a.created_on).getTime()
})
// Remove fields not needed by the LLM
.map((account) => {
return {
id: account.id,
name: account.name,
created_on: account.created_on,
}
})

return {
content: [
{
type: 'text',
text: JSON.stringify({
accounts,
count: accounts.length,
}),
},
],
}
} catch (e) {
agent.server.recordError(e)
return {
content: [
{
type: 'text',
text: `Error listing accounts: ${e instanceof Error && e.message}`,
},
],
return {
content: [
{
type: 'text',
text: JSON.stringify({
accounts,
count: accounts.length,
}),
},
],
}
} catch (e) {
agent.server.recordError(e)
return {
content: [
{
type: 'text',
text: `Error listing accounts: ${e instanceof Error && e.message}`,
},
],
}
}
}
})
)

// Only register set_active_account tool when user token is provided, as it doesn't make sense to expose
// this tool for account scoped tokens, given that they're scoped to a single account
Expand All @@ -67,6 +78,13 @@ export function registerAccountTools(agent: CloudflareMcpAgent) {
{
activeAccountIdParam,
},
{
title: 'Set active account',
annotations: {
readOnlyHint: false,
destructiveHint: false,
},
},
async (params) => {
try {
const { activeAccountIdParam: activeAccountId } = params
Expand Down
Loading