feat: add remote MCP server on Cloudflare Workers#26
Merged
Conversation
Hosts a multi-tenant MCP server alongside the existing stdio binary so
end users can paste a personal URL into Claude.ai or ChatGPT instead of
running anything locally.
- src/remote/{worker,agent,setup,storage}.ts: Worker entrypoint, per-
request McpServer factory, /setup onboarding form, and AES-GCM
credential storage in Workers KV.
- Refactor jira.ts and tools.ts onto a per-request Ctx so the same code
serves stdio and the Worker without a process-wide config singleton.
oauth.ts and the OAuth path stay stdio-only via a dynamic import.
- Hardening: per-IP rate limit on POST /setup (Cloudflare Rate Limiting
binding), Cache-Control: no-store + Referrer-Policy: no-referrer on
/setup responses, AES-GCM 256 with per-record IV, 404-on-unknown-id
for /mcp/u_<id>.
- Build split: tsconfig.node.json for the npm CLI, tsconfig.worker.json
for the Worker bundle. npm package still ships only build/.
- README documents fork-and-deploy, troubleshooting, and the
ENCRYPTION_KEY-is-permanent caveat. wrangler.jsonc is committed with
an empty KV id so each deployer wires their own.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Hosts a multi-tenant MCP server on Cloudflare Workers alongside the existing stdio binary, so end users can paste a personal URL into Claude.ai or ChatGPT instead of running anything locally.
src/remote/{worker,agent,setup,storage}.ts— Worker entrypoint, per-request McpServer factory,/setuponboarding form, and AES-GCM credential storage in Workers KV.jira.tsandtools.tsrefactored onto a per-requestCtxso the same code serves stdio and the Worker without a process-wide config singleton.oauth.tsand the OAuth path stay stdio-only via dynamic import./setup(Cloudflare Rate Limiting binding),Cache-Control: no-store+Referrer-Policy: no-referreron/setup, AES-GCM 256 with per-record IV, 404-on-unknown-id for/mcp/u_<id>.tsconfig.node.jsonfor the npm CLI,tsconfig.worker.jsonfor the Worker bundle. The npm package still ships onlybuild/.Existing stdio users see no behaviour change — same 7 tools, same env vars, same build artefact.
Test plan