Commit graph

3 commits

Author SHA1 Message Date
Johnny
390126f1cd
fix(mcp): harden tool schemas and request routing (#6115) 2026-07-25 09:54:12 +08:00
johnnyjoygh
8fa2ff4423 fix(mcp): allow reverse-proxied instances to serve /mcp
The go-sdk Streamable HTTP handler enables DNS-rebinding protection that
rejects any request whose Host header is non-loopback while the server is
bound to a loopback address. memos is commonly run bound to loopback behind a
reverse proxy (e.g. the public demo), so every /mcp request was rejected with
"403 Forbidden: invalid Host header" before authentication ran.

Disable the SDK's localhost protection and rely on memos' own Origin/Host
allowlist (isAllowedMCPOrigin) for CSRF / DNS-rebinding protection. Add a
regression test covering the proxied shape and confirming disallowed origins
are still rejected.
2026-06-21 22:20:00 +08:00
boojack
777d227eb9
feat: add OpenAPI-driven MCP support (#6026) 2026-06-09 09:16:50 +08:00