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
{{ message }}
Repository navigation
Commit 39b5302
Browse filesBrowse the repository at this point in the historyBrowse files
feat(mcp): streamable-HTTP transport for the hosted mcp.fojin.ai endpoint (#1157)
fojin-mcp 0.2.0 — the PyPI stdio server becomes hostable:
- MCP SDK v2 migration (mcp>=2,<3). Required regardless of hosting: 2.0
removed mcp.server.fastmcp, so 0.1.0 breaks on any fresh install today.
- --transport streamable-http: stateless json_response mode (each call is
one plain JSON POST — Cloudflare-proxy- and multi-worker-safe), Host
validation pinned to the public hostname, per-client-IP sliding-window
rate limiting, JSON access/tool logs, /healthz.
- Shared process-wide FojinClient (one pool + text_id→cbeta_id cache,
collapsing get_parallels' repeat fan-out) behind a concurrency gate.
- client fixes: lookup_entity sent size= where /kg/entities takes limit=
(silently ignored, always 20 rows); resolve_urn pre-encoded '#' and got
double-encoded by httpx (server saw a literal %23).
- Deploy: mcp compose service (loopback-bound, healthchecked, talks to
backend over the compose network) + mcp.fojin.ai nginx block.
- backend: requests without X-Forwarded-For (docker-network/loopback
callers — nginx always appends it) skip the per-IP limiter, so all
hosted-MCP users don't share one 20/min semantic-search bucket; the MCP
layer rate-limits per real client instead.
0 commit comments