Skip to content

Commit f9b1f7e

Browse files
authored
Add Sentry client to CloudflareMCPServer (#74)
* Add sentry client to CloudflareMCPServer * Dont use empty object in tool calls & update agents deps (#80) * Add syncpack lint job * Dont use empty object in tool calls * Allow sentry to only record the scope search param
1 parent 616322c commit f9b1f7e

File tree

26 files changed

+503
-881
lines changed

26 files changed

+503
-881
lines changed

.github/workflows/test-and-check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
cache: 'pnpm'
2222
- name: Install dependencies
2323
run: pnpm install
24+
- name: Syncpack lint
25+
run: pnpm syncpack lint
2426
- name: Run linter
2527
run: pnpm check:turbo
2628
- name: Run linter (formatting)

.syncpackrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const config = {
1414
{
1515
label: 'Sentry types that are compatible with toucan-js',
1616
dependencies: ['@sentry/types', '@sentry/tracing'],
17-
pinVersion: '7.76.0',
17+
pinVersion: '8.9.2',
1818
},
1919
{
2020
label: 'toucan-js that is compatible with pinned sentry types',
2121
dependencies: ['toucan-js'],
22-
pinVersion: '3.3.1',
22+
pinVersion: '4.1.1',
2323
},
2424
{
2525
label: 'pin vitest compatible with @cloudflare/vitest-pool-workers',

apps/docs-autorag/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"test": "vitest run"
1313
},
1414
"dependencies": {
15-
"@cloudflare/workers-oauth-provider": "0.0.2",
15+
"@cloudflare/workers-oauth-provider": "0.0.3",
1616
"@hono/zod-validator": "0.4.3",
17-
"@modelcontextprotocol/sdk": "1.9.0",
17+
"@modelcontextprotocol/sdk": "1.10.2",
1818
"@repo/mcp-common": "workspace:*",
1919
"@repo/mcp-observability": "workspace:*",
20-
"agents": "0.0.62",
20+
"agents": "0.0.67",
2121
"cloudflare": "4.2.0",
2222
"hono": "4.7.6",
2323
"mime": "4.0.6",

apps/docs-autorag/src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ export type Props = never
1515
export type State = never
1616

1717
export class CloudflareDocumentationMCP extends McpAgent<Env, State, Props> {
18-
server = new CloudflareMCPServer(undefined, env.MCP_METRICS, {
19-
name: env.MCP_SERVER_NAME,
20-
version: env.MCP_SERVER_VERSION,
18+
server = new CloudflareMCPServer({
19+
wae: env.MCP_METRICS,
20+
serverInfo: {
21+
name: env.MCP_SERVER_NAME,
22+
version: env.MCP_SERVER_VERSION,
23+
},
2124
})
2225

2326
constructor(

apps/sandbox-container/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,23 @@
1818
"eval:ci": "start-server-and-test --expect 404 eval:server http://localhost:8976 'vitest run --testTimeout=60000 --config vitest.config.evals.ts'"
1919
},
2020
"dependencies": {
21-
"@cloudflare/workers-oauth-provider": "0.0.2",
21+
"@cloudflare/workers-oauth-provider": "0.0.3",
2222
"@hono/node-server": "1.13.8",
2323
"@hono/zod-validator": "0.4.3",
24-
"@modelcontextprotocol/sdk": "1.9.0",
24+
"@modelcontextprotocol/sdk": "1.10.2",
2525
"@n8n/json-schema-to-zod": "1.1.0",
2626
"@repo/eval-tools": "workspace:*",
2727
"@repo/mcp-common": "workspace:*",
2828
"@repo/mcp-observability": "workspace:*",
2929
"@types/node": "22.14.1",
30-
"agents": "0.0.62",
30+
"agents": "0.0.67",
3131
"cron-schedule": "5.0.4",
3232
"esbuild": "0.25.1",
3333
"hono": "4.7.6",
3434
"mime": "4.0.6",
35-
"octokit": "4.1.2",
36-
"partyserver": "0.0.65",
3735
"simple-git-hooks": "2.12.1",
3836
"tsx": "4.19.3",
3937
"vitest-evals": "0.1.4",
40-
"workers-mcp": "0.1.0-3",
4138
"zod": "3.24.2"
4239
},
4340
"devDependencies": {

apps/sandbox-container/server/containerMcp.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ export class ContainerMcpAgent extends McpAgent<Env, {}, Props> {
5252

5353
async init() {
5454
this.props.user.id
55-
this.server = new CloudflareMCPServer(
56-
this.props.user.id,
57-
this.env.MCP_METRICS,
58-
{
55+
this.server = new CloudflareMCPServer({
56+
userId: this.props.user.id,
57+
wae: this.env.MCP_METRICS,
58+
serverInfo: {
5959
name: this.env.MCP_SERVER_NAME,
6060
version: this.env.MCP_SERVER_VERSION,
6161
},
62-
{ instructions: BASE_INSTRUCTIONS }
63-
)
62+
options: { instructions: BASE_INSTRUCTIONS },
63+
})
6464

6565
this.server.tool(
6666
'container_initialize',

apps/workers-bindings/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"wrangler": "4.10.0"
2323
},
2424
"dependencies": {
25-
"@cloudflare/workers-oauth-provider": "0.0.2",
26-
"@modelcontextprotocol/sdk": "1.9.0",
25+
"@cloudflare/workers-oauth-provider": "0.0.3",
26+
"@modelcontextprotocol/sdk": "1.10.2",
2727
"@n8n/json-schema-to-zod": "1.1.0",
2828
"@repo/mcp-common": "workspace:*",
2929
"@repo/mcp-observability": "workspace:*",
30-
"agents": "0.0.62",
30+
"agents": "0.0.67",
3131
"hono": "4.7.6",
3232
"zod": "3.24.2"
3333
}

apps/workers-bindings/src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ export class WorkersBindingsMCP extends McpAgent<Env, WorkersBindingsMCPState, P
5757
}
5858

5959
async init() {
60-
this.server = new CloudflareMCPServer(this.props.user.id, this.env.MCP_METRICS, {
61-
name: this.env.MCP_SERVER_NAME,
62-
version: this.env.MCP_SERVER_VERSION,
60+
this.server = new CloudflareMCPServer({
61+
userId: this.props.user.id,
62+
wae: this.env.MCP_METRICS,
63+
serverInfo: {
64+
name: this.env.MCP_SERVER_NAME,
65+
version: this.env.MCP_SERVER_VERSION,
66+
},
6367
})
6468

6569
registerAccountTools(this)

apps/workers-observability/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"test": "vitest run"
1313
},
1414
"dependencies": {
15-
"@cloudflare/workers-oauth-provider": "0.0.2",
15+
"@cloudflare/workers-oauth-provider": "0.0.3",
1616
"@hono/zod-validator": "0.4.3",
17-
"@modelcontextprotocol/sdk": "1.9.0",
17+
"@modelcontextprotocol/sdk": "1.10.2",
1818
"@repo/mcp-common": "workspace:*",
1919
"@repo/mcp-observability": "workspace:*",
20-
"agents": "0.0.62",
20+
"agents": "0.0.67",
2121
"cloudflare": "4.2.0",
2222
"hono": "4.7.6",
2323
"zod": "3.24.2"

apps/workers-observability/src/context.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ export interface Env {
99
CLOUDFLARE_CLIENT_SECRET: 'PLACEHOLDER'
1010
MCP_OBJECT: DurableObjectNamespace<ObservabilityMCP>
1111
MCP_METRICS: AnalyticsEngineDataset
12+
SENTRY_ACCESS_CLIENT_ID: 'PLACEHOLDER'
13+
SENTRY_ACCESS_CLIENT_SECRET: 'PLACEHOLDER'
14+
GIT_HASH: 'OVERRIDEN_DURING_DEPLOYMENT'
15+
SENTRY_DSN: 'PLACEHOLDER'
1216
}

0 commit comments

Comments
 (0)