You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the initial services/mcp-gateway Worker scaffold for the app-owned control plane / Worker-owned runtime architecture, including top-level production Wrangler config, env.dev, Hyperdrive, per-instance DO binding, Analytics Engine binding, generated Worker types, and local service docs.
Add a route-only Hono entrypoint and route-shape tests for /health, scoped /mcp-connect/... runtime routes, and generic/scoped protected-resource metadata routes; all gateway runtime routes remain 501 stubs so the service is safe to merge before OAuth/runtime implementation.
Keep the gateway architecture notes in the planning workspace until PR2 to avoid introducing a partially overlapping spec surface in the repo before the functional implementation lands.
Verification
Started pnpm --filter cloudflare-mcp-gateway dev and confirmed the local Worker booted on http://0.0.0.0:8806.
Requested GET /health locally and confirmed 200 with {"status":"ok","service":"mcp-gateway"}.
Requested GET /mcp-connect/user/user-123/config-123/route-123 locally and confirmed 501 with {"status":"not_implemented"}.
Additional manual verification details:
Visual Changes
N/A
Reviewer Notes
PR1 intentionally does not attach mcp.kilo.ai or implement OAuth, gateway tables/migrations, provider discovery, proxying, or DO domain behavior.
The Worker uses a top-level production Wrangler config plus env.dev; the compatibility date is pinned to 2026-05-15 because that was the newest date supported by the local Wrangler runtime used during validation.
The branch contains two commits: the scaffold and a follow-up that defers the copied gateway specs to PR2.
The two previously flagged WARNING issues (discarded Zod parse return values in all four route handlers) are resolved in commit 48a0815e6 — validated params are now captured and threaded through to notImplementedResponse as a typed optional parameter.
✅ Fixed — same pattern applied to both parameterized handlers
Other Observations (not in diff, unchanged)
Wildcard route params include a "*" key: Routes like /mcp-connect/user/:userId/:configId/:routeKey/* produce c.req.param() objects containing an extra "*" key (the matched wildcard segment). Zod's z.object() strips unknown keys by default, so the wildcard portion is silently discarded. This is harmless in PR1, but the intent should be documented — future handlers that need the sub-path (e.g. to proxy /tools/list downstream) must extract the * param explicitly before parsing with the schema.
dev environment duplicates production bindings verbatim in wrangler.jsonc: The env.dev block repeats durable_objects, hyperdrive, and analytics_engine_datasets identically to the top-level config. Wrangler env blocks do not inherit bindings from the top level, so duplication is required by the platform — no action needed, just noting it for reviewers unfamiliar with Wrangler's env semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
services/mcp-gatewayWorker scaffold for the app-owned control plane / Worker-owned runtime architecture, including top-level production Wrangler config,env.dev, Hyperdrive, per-instance DO binding, Analytics Engine binding, generated Worker types, and local service docs./health, scoped/mcp-connect/...runtime routes, and generic/scoped protected-resource metadata routes; all gateway runtime routes remain501stubs so the service is safe to merge before OAuth/runtime implementation.Verification
pnpm --filter cloudflare-mcp-gateway devand confirmed the local Worker booted onhttp://0.0.0.0:8806.GET /healthlocally and confirmed200with{"status":"ok","service":"mcp-gateway"}.GET /mcp-connect/user/user-123/config-123/route-123locally and confirmed501with{"status":"not_implemented"}.Visual Changes
N/A
Reviewer Notes
mcp.kilo.aior implement OAuth, gateway tables/migrations, provider discovery, proxying, or DO domain behavior.env.dev; the compatibility date is pinned to2026-05-15because that was the newest date supported by the local Wrangler runtime used during validation.