|
| 1 | +# Cloudflare Workers Configuration - Example Template |
| 2 | +# Copy this to wrangler.toml and replace placeholders with actual values |
| 3 | + |
| 4 | +name = "your-mcp-server-name" |
| 5 | +main = "src/index.ts" |
| 6 | +compatibility_date = "2024-11-05" |
| 7 | +compatibility_flags = ["nodejs_compat"] |
| 8 | + |
| 9 | +# Replace with your Cloudflare account ID before deploying. |
| 10 | +account_id = "YOUR_CLOUDFLARE_ACCOUNT_ID" |
| 11 | + |
| 12 | +[[ai]] |
| 13 | +binding = "AI" |
| 14 | +# Provide the AI Gateway identifier created in Cloudflare (credentials supplied via wrangler secret). |
| 15 | +id = "YOUR_AI_GATEWAY_ID" |
| 16 | + |
| 17 | +# Custom domain routing (optional) |
| 18 | +routes = [ |
| 19 | + { pattern = "your-worker-domain.com", custom_domain = true } |
| 20 | +] |
| 21 | + |
| 22 | +# Deployment configuration |
| 23 | +WORKER_DOMAIN = "your-worker-name.your-subdomain.workers.dev" |
| 24 | +PROTOCOL = "https" |
| 25 | + |
| 26 | +# Durable Objects for session and token management |
| 27 | +[[durable_objects.bindings]] |
| 28 | +name = "MCP_OBJECT" |
| 29 | +class_name = "MicrosoftMCPAgent" |
| 30 | + |
| 31 | +# KV Namespaces |
| 32 | +[[kv_namespaces]] |
| 33 | +binding = "OAUTH_KV" |
| 34 | +id = "YOUR_OAUTH_KV_NAMESPACE_ID" |
| 35 | +preview_id = "YOUR_OAUTH_KV_PREVIEW_ID" |
| 36 | + |
| 37 | +[[kv_namespaces]] |
| 38 | +binding = "CONFIG_KV" |
| 39 | +id = "YOUR_CONFIG_KV_NAMESPACE_ID" |
| 40 | +preview_id = "YOUR_CONFIG_KV_PREVIEW_ID" |
| 41 | + |
| 42 | +[[kv_namespaces]] |
| 43 | +binding = "CACHE_KV" |
| 44 | +id = "YOUR_CACHE_KV_NAMESPACE_ID" |
| 45 | +preview_id = "YOUR_CACHE_KV_PREVIEW_ID" |
| 46 | + |
| 47 | +# Secrets (deploy via: wrangler secret put SECRET_NAME) |
| 48 | +# - MICROSOFT_CLIENT_ID |
| 49 | +# - MICROSOFT_TENANT_ID |
| 50 | +# - GRAPH_API_VERSION |
| 51 | +# - MICROSOFT_CLIENT_SECRET |
| 52 | +# - ENCRYPTION_KEY |
| 53 | +# - COOKIE_SECRET |
| 54 | +# - COOKIE_ENCRYPTION_KEY |
| 55 | +# - AI_GATEWAY_SERVICE_TOKEN (if required by policy) |
| 56 | + |
| 57 | +# Migration Information |
| 58 | +[[migrations]] |
| 59 | +tag = "v1" |
| 60 | +new_classes = ["MicrosoftMCPAgent"] |
0 commit comments