AttestoMCP.Server.PhoenixParser (attesto_mcp_server v2.8.0)

Copy Markdown View Source

MCP-route parser bypass for Phoenix endpoints.

Phoenix endpoints commonly run Plug.Parsers before the router. This adapter keeps that parser unchanged for every request except the configured MCP routes, which must reach the MCP Plug with their bodies still unread so that authentication can run first. :mcp_path accepts one path or a non-empty list of at most 32 unique paths. Matching uses decoded path_info and covers each configured path's complete forwarded subtree, including route-equivalent trailing or repeated slashes. This mirrors Phoenix forward/4: a request below an MCP mount must reach that mount with its body unread even when the MCP Plug will reject the remaining sub-path.