Skip to content

Commit e7b868c

Browse files
committed
Update wrangler.jsonc for staging and dev env.
Add UserDetails binding for active account id.
1 parent d9de749 commit e7b868c

File tree

3 files changed

+80
-4
lines changed

3 files changed

+80
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CLOUDFLARE_CLIENT_ID=
22
CLOUDFLARE_CLIENT_SECRET=
3-
CLOUDFLARE_API_TOKEN=
3+
DEV_CLOUDFLARE_API_TOKEN=

apps/dns-analytics/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ import { registerAnalyticTools } from './tools/analytics'
1616

1717
import type { AuthProps } from '@repo/mcp-common/src/cloudflare-oauth-handler'
1818
import type { Env } from './context'
19-
import { getUserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
19+
import { getUserDetails, UserDetails } from '@repo/mcp-common/src/durable-objects/user_details'
20+
21+
export { UserDetails }
2022

2123
const env = getEnv<Env>()
2224

apps/dns-analytics/wrangler.jsonc

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"name": "mcp-cloudflare-dns-analytics-dev",
1111
"migrations": [
1212
{
13-
"new_sqlite_classes": ["DNSAnalyticsMCP"],
13+
"new_sqlite_classes": ["UserDetails", "DNSAnalyticsMCP"],
1414
"tag": "v1"
1515
}
1616
],
@@ -22,6 +22,10 @@
2222
{
2323
"class_name": "DNSAnalyticsMCP",
2424
"name": "MCP_OBJECT"
25+
},
26+
{
27+
"class_name": "UserDetails",
28+
"name": "USER_DETAILS"
2529
}
2630
]
2731
},
@@ -48,5 +52,75 @@
4852
"binding": "MCP_METRICS",
4953
"dataset": "mcp-metrics-dev"
5054
}
51-
]
55+
],
56+
"env": {
57+
"staging": {
58+
"name": "mcp-cloudflare-dns-analytics-staging",
59+
"account_id": "6702657b6aa048cf3081ff3ff3c9c52f",
60+
"routes": [{ "pattern": "dns-analytics-staging.mcp.cloudflare.com", "custom_domain": true }],
61+
"durable_objects": {
62+
"bindings": [
63+
{
64+
"class_name": "DNSAnalyticsMCP",
65+
"name": "MCP_OBJECT"
66+
},
67+
{
68+
"class_name": "UserDetails",
69+
"name": "USER_DETAILS"
70+
}
71+
]
72+
},
73+
"kv_namespaces": [
74+
{
75+
"binding": "OAUTH_KV",
76+
"id": "a6ad24203a244d248f2fe1acfeb7b3a3"
77+
}
78+
],
79+
"vars": {
80+
"ENVIRONMENT": "staging",
81+
"MCP_SERVER_NAME": "dns-analytics-staging",
82+
"MCP_SERVER_VERSION": "1.0.0"
83+
},
84+
"analytics_engine_datasets": [
85+
{
86+
"binding": "MCP_METRICS",
87+
"dataset": "mcp-metrics-staging"
88+
}
89+
]
90+
},
91+
"production": {
92+
"name": "mcp-cloudflare-dns-analytics-production",
93+
"account_id": "6702657b6aa048cf3081ff3ff3c9c52f",
94+
"routes": [{ "pattern": "dns-analytics.mcp.cloudflare.com", "custom_domain": true }],
95+
"durable_objects": {
96+
"bindings": [
97+
{
98+
"class_name": "DNSAnalyticsMCP",
99+
"name": "MCP_OBJECT"
100+
},
101+
{
102+
"class_name": "UserDetails",
103+
"name": "USER_DETAILS"
104+
}
105+
]
106+
},
107+
"kv_namespaces": [
108+
{
109+
"binding": "OAUTH_KV",
110+
"id": "753f27a19ef94d7dbd49de05588ca890"
111+
}
112+
],
113+
"vars": {
114+
"ENVIRONMENT": "production",
115+
"MCP_SERVER_NAME": "dns-analytics",
116+
"MCP_SERVER_VERSION": "1.0.0"
117+
},
118+
"analytics_engine_datasets": [
119+
{
120+
"binding": "MCP_METRICS",
121+
"dataset": "mcp-metrics-production"
122+
}
123+
]
124+
}
125+
}
52126
}

0 commit comments

Comments
 (0)