fastapi_mcp icon indicating copy to clipboard operation
fastapi_mcp copied to clipboard

Support POST requests on main route

Open guillochon opened this issue 7 months ago • 6 comments

Hi, I'm trying to use an MCP client that only supports POST requests on the main route:

x.x.x.x:52924 - "POST /mcp HTTP/1.1" 405 Method Not Allowed

I've noticed that some clients (like Cursor) try the POST route first before falling back to GET, but not every client seems to do this. Can we support both?

guillochon avatar May 29 '25 17:05 guillochon

Experiencing the same problems with a package as they seem to have switched to POST for initialization. FastApiMcp returns 405. For now at least there is the option to pin an older version of the package. MCP is a pretty new - not very mature on all levels - standard but I think this should be aligned in the future. A workaround or fix would be appreciated though.

viprapp avatar May 30 '25 09:05 viprapp

I am facing the same issue with Pydantic AI latest version.

apasias avatar Jun 02 '25 08:06 apasias

Can we merge #159 ? It seems to fix the issue.

guillochon avatar Jun 12 '25 16:06 guillochon

This issue is due to FastApiMCP's transport only supporting SSE.

## FastApiMCP transport parameter documentation:
The transport type for the MCP server. Currently, only 'sse' is supported.

Therefore, this issue should track https://github.com/tadata-org/fastapi_mcp/issues/61 and https://github.com/tadata-org/fastapi_mcp/issues/133.

Edison-A-N avatar Jun 27 '25 07:06 Edison-A-N

Same with me

DoiiarX avatar Jul 21 '25 04:07 DoiiarX

Can Streamable HTTP in v0.4.0 come to rescue?

livizy avatar Oct 11 '25 15:10 livizy