Skip to content
Hidden Logic Lab

Review MCP HTTP, SSE, and Streamable HTTP auth before deploy

Cursor or Claude Code applies a SKILL.md before merging or deploying MCP servers exposed over HTTP, SSE, or Streamable HTTP: bind address, auth, CORS, tokens in URLs, and dangerous tools — with merge-blocking findings.

Copy prompt

Cursor, Claude Code · Coding · 40 min · Deep

Outcome

An MCP HTTP auth SKILL.md in platform or agent docs, a PR comment naming listen address, auth mode, and CORS policy per endpoint, and no public MCP listener merged without caller authentication and scoped credentials.

Steps

  1. 1

    Run the skill on a public bind without auth

    Use a PR that sets host 0.0.0.0 and enables CORS * on the MCP route. The skill should Block before deploy.

  2. 2

    Document production bind and auth matrix

    Maintain a table of allowed listen addresses and auth modes per environment. The agent diffs new YAML and code against that matrix.

  3. 3

    Pair with third-party MCP install review

    Vendored MCP servers need transport review as well as supply-chain review. Link both skills when adding external MCP packages with HTTP transport.

Copy prompt

The prompt to paste

Write SKILL.md for reviewing MCP servers exposed over HTTP, Server-Sent Events (SSE), or Streamable HTTP before merge or deploy. Focus on network exposure, authentication, CORS, credential transport, and tool authorization — not MCP protocol tutorials.

Repository context:
[server entrypoint paths, framework: Express, Hono, Fastify, stdlib http, MCP SDK transport — names only]
[deployment target: local dev only, Docker, Fly, Railway, Vercel, Kubernetes — where this listener actually runs]
[auth mechanism if any: mTLS, OAuth, API key header, bearer JWT, mutual TLS — names only, no secrets]
[tool surface: which MCP tools touch filesystem, shell, or cloud APIs]

PR or deploy context (paste when using):
[PR link, changed transport setup, Dockerfile or deploy manifest, env vars for bind host/port — names only]

SKILL.md must include:
1. Purpose — an MCP HTTP endpoint without auth is a remote agent capability API; browsers and bots can invoke tools that read files, run commands, or use cloud credentials if the server is reachable and CORS allows it.
2. When to use — any PR touching MCP transport setup, SSE or Streamable HTTP handlers, Docker EXPOSE/ENTRYPOINT for MCP, ingress rules, or auth middleware in front of MCP routes. When not to use — stdio-only MCP used locally with no network listener.
3. Hard rules for findings:
   - Block: MCP HTTP/SSE/Streamable HTTP listener bound to 0.0.0.0 or deployed behind a public ingress with no authentication or network policy; Access-Control-Allow-Origin: * or equivalent wildcard CORS on endpoints that expose tools with read/write capability; long-lived unscoped API tokens passed in query strings, URL paths, or logged at info level on connection; tools that read arbitrary local files, execute shell commands, or call cloud control planes without per-caller authorization checks in server code; dev server configured for 127.0.0.1/localhost shipped in production image or deploy config without adding auth or private networking; stream endpoint that echoes client-provided tokens or session ids into logs or metrics unredacted.
   - Warn: auth only on initial SSE handshake but not on subsequent POST/message endpoints; shared service account for all MCP clients; token TTL longer than team policy without rotation; tools list exposes admin capabilities to unauthenticated health routes; TLS termination at edge while backend allows plain HTTP from wide VPC; missing rate limits on token issuance endpoint.
   - Note: MCP tool naming, JSON-RPC id style — never block on style alone.
4. Review steps the agent must execute:
   - Locate bind host/port in code and deploy manifests; flag 0.0.0.0 or missing HOST guard in production profile.
   - Trace auth middleware order: verify every tool-invocation path runs after auth, including SSE reconnect and Streamable HTTP session resume.
   - Inspect CORS config: list allowed origins; Block wildcard on non-public-read-only tools.
   - Search for tokens in query params (URLSearchParams, req.url splits) and log statements on connect/disconnect.
   - List each MCP tool in the diff; for file read, exec, subprocess, or cloud SDK tools, confirm server checks caller identity or role before invocation.
   - Compare dev vs prod config: localhost-only assumptions in README or compose files that deploy file copies unchanged to public hosts.
   - If reverse proxy is present: confirm mTLS or signed headers are validated in app code, not assumed from IP alone.
5. PR comment template: endpoint table (path — transport — bind — auth — CORS — risky tools), findings by severity, deploy recommendation.
6. Safe patterns section: stdio MCP for local agents; HTTP MCP behind VPN or identity-aware proxy; short-lived scoped tokens in Authorization header only; tool allowlists per API key; separate read-only health route with no tool surface.
7. Two example prompts: add Streamable HTTP transport for internal staging vs expose SSE MCP on 0.0.0.0 in Dockerfile without auth.
8. Pitfalls: testing only from localhost while EXPOSE 8000 goes public, copying SSE tutorial CORS wildcard, logging full connection URL with ?token=, assuming Cursor client always sends auth when other HTTP clients can call the same URL.
9. Done means: every Block resolved, bind address and auth mode named per endpoint, no live tokens in PR comment, dangerous tools mapped to authorization checks or removed.

Rules:
- Never paste API keys, bearer tokens, or mTLS private key material.
- Do not recommend exposing MCP on the public internet with security-through-obscurity port numbers.
- Output only SKILL.md markdown.

Streamable HTTP and SSE look like passive streams but often accept follow-up POSTs without repeating auth. The skill must trace the full session lifecycle, not only the first EventSource or upgrade request.

Sample case written by Hidden Logic Lab. Not affiliated with Cursor or Claude Code.

Get new cases in your inbox

Weekly notes on new use cases and agent workflows. No product pitches.

Occasional notes on new cases. No product pitches in the first note.