Skip to content

feat: public Workers MCP and private Charlie code-mode - #45

Open
robertoecf wants to merge 4 commits into
mainfrom
feat/workers-mcp-public
Open

feat: public Workers MCP and private Charlie code-mode#45
robertoecf wants to merge 4 commits into
mainfrom
feat/workers-mcp-public

Conversation

@robertoecf

Copy link
Copy Markdown
Owner

Summary

  • Public MCP moves to Cloudflare Worker (workers/mcp) — JSON sources only, no code-mode
  • FastAPI stays Tailscale/loopback (gVisor); Charlie stack on :8001 with Tunnel + Access + fail-closed origin token
  • Worker upstream timeout/size bounds; Tailscale bind assert script

Test plan

  • wrangler deployhttps://openfindata.com.br/health ok
  • Charlie loopback: /health 200; /mcp without origin 401; /stats with origin 200
  • Doppler: set OPENFINDATA_CHARLIE_ORIGIN_TOKEN to match VPS deploy/.env
  • Tunnel smoke with Access + origin headers
  • pytest origin_guard + mcp_surface

Made with Cursor

Split the public surface onto a Cloudflare Worker (JSON sources only)
and keep FastAPI Tailscale-only. Add an Access-protected Charlie stack
with fail-closed origin token, Worker upstream bounds, and Tailscale
bind validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7352c644-86a3-4b61-adcb-e92e1840b23e


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@guardrails

guardrails Bot commented Aug 19, 2026

Copy link
Copy Markdown

⚠️ We detected 1 security issue in this pull request:

Vulnerable Libraries (1)
Severity Details
High pkg:npm/wrangler@4.122.0 upgrade to: > 4.122.0

More info on how to fix Vulnerable Libraries in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

Enforce 60 req/60s and 20/10s burst per IP on /mcp via Workers Rate Limit
bindings. Overflow is synchronous 429 + Retry-After. Landing and /health
stay unlimited.
Cover 429/Retry-After and IP keying with fake Rate Limit bindings.
Stop trusting X-Forwarded-For when CF-Connecting-IP is absent.
@cursor

cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

Incremento: rate limit público /mcp

Continuação na branch feat/workers-mcp-public (não saiu de main).

  • Bindings Workers Rate Limit (não Queues): 60 req / 60s por IP + burst 20 / 10s
  • Overflow síncrono: HTTP 429, Retry-After, corpo {"error":"rate_limited"}
  • / e /health fora do limite
  • Landing com linha de uso justo
  • Timeout/payload/last_n intactos
  • Sem deploy, sem secrets/Doppler/VPS/origin token

HEAD: 1357d81

MCP Trust Review

  • Classificação: MCP_SURFACE
  • Base: origin/main (607de01)
  • Head: 1357d81bafb4a30330edc9298db61ec59132c4a0
  • Tools tocadas: n/a — sem nova tool; Worker público continua JSON-only, sem findata_run_code
  • Conclusão: PASS

Achados

NO_FINDINGS neste incremento (rate limit + testes executáveis). Dívida pré-existente do PR (1d88e8d: Charlie code-mode / origin token no child env, validação Tailscale opcional no compose) não foi reaberta aqui.

Over-engineering

NO_FINDINGS. Dois bindings nativos cobrem sustentado + pico.

Review

  • Adversarial: CROSS_FAMILY (autor Grok, reviewer GPT-5.6). Blockers apontados são do commit anterior do PR, fora deste incremento.
  • Preflight: OK em 1357d81 (ruff/mypy/pytest 336 passed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants