Commit graph

6 commits

Author SHA1 Message Date
DJP
569c7946a7 Expand README with full architecture, client setup (LibreChat, Claude Desktop, Claude Code), troubleshooting
Documents what the server is, how request flow works end-to-end, and the
two SDK gotchas we hit (lifespan-not-mounted + DNS-rebinding 421s) so
future-us doesn't have to rediscover them. Adds explicit per-client
config snippets for LibreChat, Claude Desktop (native http transport
plus mcp-remote stdio bridge fallback), and 'claude mcp add' for Claude
Code. Troubleshooting table covers the actual failures from this deploy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 22:40:14 -04:00
DJP
5e1a88b53c Fix MCP 421: allow-list public host for DNS-rebinding protection
The MCP SDK ships with DNS-rebinding protection that 421s any request whose
Host header isn't in an allowlist (default: 127.0.0.1, localhost). Once
ProxyPreserveHost is On, Apache forwards the real Host (optical-dev.…) to
the container, which the SDK then rejects.

Two changes:
- email_server.py: pass TransportSecuritySettings(allowed_hosts=[...]) to
  FastMCP, sourced from PUBLIC_HOSTS env var (defaults to the optical-dev
  hostname)
- apache-mg-mcp.conf.tmpl: add ProxyPreserveHost On so the container sees
  the real hostname instead of 127.0.0.1:9080

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 22:35:26 -04:00
DJP
a46c850e61 Fix MCP 500: nest FastMCP session manager run() in FastAPI lifespan
When FastMCP's streamable_http_app is mounted as a Starlette sub-app, its
session manager's task group is never started — Starlette doesn't propagate
lifespan to mounts. First request hits handle_request() and raises
RuntimeError: Task group is not initialized.

Wrap mcp.session_manager.run() in the parent FastAPI app's lifespan so the
task group starts at uvicorn boot and stops at shutdown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 22:28:43 -04:00
DJP
32a402ea34 Merge remote-tracking branch 'origin/main' 2026-05-06 22:07:58 -04:00
DJP
e463c27663 Initial mg-mcp: Mailgun MCP server (Streamable HTTPS) for optical-dev
Containerized FastAPI + FastMCP server exposing send_email tool, backed
by Mailgun (mg.oliver.solutions). Bearer-token auth. Deployable to
/opt/mg-mcp/ on optical-dev.oliver.solutions behind the shared Apache vhost,
following the same pattern as adeo-maturity-tool / oliver-sales-ops-platform.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 22:05:38 -04:00
Dave Porter
6c7c641d0d Initial commit 2026-05-07 02:04:34 +00:00