Skip to content

Commit c0e6700

Browse files
committed
Move observability server to it's own subdomain and adjust all app routes to be /sse
1 parent 5ba47c9 commit c0e6700

File tree

18 files changed

+80
-56
lines changed

18 files changed

+80
-56
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Replace the content with the following configuration. Once you restart Claude De
2020
"command": "npx",
2121
"args": [
2222
"mcp-remote",
23-
"https://mcp.cloudflare.com/workers/observability/sse"
23+
"https://observability.mcp.cloudflare.com/sse"
2424
]
2525
}
2626
}

apps/sandbox-container/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Do the following from within the sandbox-container app:
1212
2. Get the Cloudflare client id and secret from a team member and add them to the `.dev.vars` file.
1313
3. Run `pnpm i` then `pnpm dev` to start the MCP server.
1414
4. Run `pnpx @modelcontextprotocol/inspector` to start the MCP inspector client.
15-
5. Open the inspector client in your browser and connect to the server via `http://localhost:8976/workers/sandbox/sse`.
15+
5. Open the inspector client in your browser and connect to the server via `http://localhost:8976/sse`.
1616

1717
Note: Temporary files created through files tool calls are stored in the workdir folder of this app.
1818

apps/sandbox-container/container/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { Hono } from 'hono'
77
import { streamText } from 'hono/streaming'
88
import mime from 'mime'
99

10-
import { ExecParams, FilesWrite } from '../shared/schema.ts'
11-
import { get_file_name_from_path } from './fileUtils.ts'
10+
import { ExecParams, FilesWrite } from '../shared/schema'
11+
import { get_file_name_from_path } from './fileUtils'
1212

1313
import type { FileList } from '../shared/schema.ts'
1414

apps/sandbox-container/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"zod": "^3.24.2"
4141
},
4242
"devDependencies": {
43+
"@cloudflare/vitest-pool-workers": "0.8.14",
4344
"ai": "^4.3.6",
4445
"concurrently": "^9.1.2",
4546
"wrangler": "^4.9.1"

apps/sandbox-container/server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export type Props = {
3030
}
3131

3232
export default new OAuthProvider({
33-
apiRoute: '/workers/sandbox/sse',
33+
apiRoute: '/sse',
3434
// @ts-ignore
35-
apiHandler: ContainerMcpAgent.mount('/workers/sandbox/sse', { binding: 'CONTAINER_MCP_AGENT' }),
35+
apiHandler: ContainerMcpAgent.mount('/sse', { binding: 'CONTAINER_MCP_AGENT' }),
3636
// @ts-ignore
3737
defaultHandler: CloudflareAuthHandler,
3838
authorizeEndpoint: '/oauth/authorize',

apps/sandbox-container/worker-configuration.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ declare namespace Cloudflare {
99
CONTAINER_MCP_AGENT: DurableObjectNamespace<import("./server/index").ContainerMcpAgent>;
1010
CONTAINER_MANAGER: DurableObjectNamespace<import("./server/index").ContainerManager>;
1111
AI: Ai;
12+
ENVIRONMENT: string
1213
}
1314
}
1415
interface Env extends Cloudflare.Env {}

apps/sandbox-container/wrangler.jsonc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "node_modules/wrangler/config-schema.json",
3-
"name": "sandbox-container",
3+
"name": "sandbox-container-dev",
44
"main": "server/index.ts",
55
"compatibility_date": "2025-04-03",
66
"compatibility_flags": ["nodejs_compat"],
@@ -48,6 +48,7 @@
4848
},
4949
"vars": {
5050
"CLOUDFLARE_CLIENT_ID": "<PLACEHOLDER>",
51-
"CLOUDFLARE_CLIENT_SECRET": "<PLACEHOLDER>"
51+
"CLOUDFLARE_CLIENT_SECRET": "<PLACEHOLDER>",
52+
"ENVIRONMENT": "development"
5253
}
5354
}

apps/workers-bindings/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export class WorkersBindingsMCP extends McpAgent<Env, WorkersBindingsMCPState, P
6262

6363
// Export the OAuth handler as the default
6464
export default new OAuthProvider({
65-
apiRoute: '/workers/bindings/sse',
65+
apiRoute: '/sse',
6666
// @ts-ignore
67-
apiHandler: WorkersBindingsMCP.mount('/workers/bindings/sse'),
67+
apiHandler: WorkersBindingsMCP.mount('/sse'),
6868
// @ts-ignore
6969
defaultHandler: CloudflareAuthHandler,
7070
authorizeEndpoint: '/oauth/authorize',

apps/workers-bindings/worker-configuration.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ declare namespace Cloudflare {
55
OAUTH_KV: KVNamespace;
66
CLOUDFLARE_CLIENT_ID: string;
77
CLOUDFLARE_CLIENT_SECRET: string;
8+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
89
MCP_OBJECT: DurableObjectNamespace<import("./src/index").WorkersBindingsMCP>;
10+
ENVIRONMENT: string
911
}
1012
}
1113
interface Env extends Cloudflare.Env {}

apps/workers-bindings/wrangler.jsonc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
{
66
"$schema": "node_modules/wrangler/config-schema.json",
7-
"name": "workers-bindings",
7+
"name": "workers-bindings-dev",
88
"main": "src/index.ts",
99
"compatibility_date": "2025-03-10",
1010
"compatibility_flags": ["nodejs_compat"],
@@ -33,6 +33,9 @@
3333
},
3434
"dev": {
3535
"port": 8976
36+
},
37+
"vars": {
38+
"ENVIRONMENT": "development"
3639
}
3740
/**
3841
* Smart Placement

0 commit comments

Comments
 (0)