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
I was just trying out the Echo demo with sse transport and there seems to be an error in the ASGI exception wrapper. The inspector can list the tools and resources, but on every request an error occurs inside starlet (TypeError: 'NoneType' object is not callable)
# demo.pyfromfastmcpimportFastMCPmcp=FastMCP("Echo 🚀")
@mcp.resource("echo://{message}")defecho_resource(message: str) ->str:
"""Echo a message as a resource"""returnf"Resource echo: {message}"@mcp.tool()defecho_tool(message: str) ->str:
"""Echo a message as a tool"""returnf"Tool echo: {message}"@mcp.prompt()defecho_prompt(message: str) ->str:
"""Create an echo prompt"""returnf"Please process this message: {message}"if__name__=="__main__":
mcp.run(transport="sse")
Then executing python demo.py and fastmcp dev demo.py and connect via localhost:8000/sse.
Unfortunately, I’m encountering the same problem while trying to use SSE transport. I was wondering if anyone has made progress on identifying the root cause or has any leads on how to resolve this? Any pointers would be greatly appreciated!
Thanks in advance to anyone who can help shed some light on this! 🙏
To address this issue, I have proposed a PR #77, which introduces a fix to use Mount instead of Route for SSE message handling. This solution aims to resolve the ASGI exception and eliminate the “NoneType object is not callable” error
Hi everyone,
thanks a lot for this library!
I was just trying out the Echo demo with
sse
transport and there seems to be an error in the ASGI exception wrapper. The inspector can list the tools and resources, but on every request an error occurs inside starlet (TypeError: 'NoneType' object is not callable
)Then executing
python demo.py
andfastmcp dev demo.py
and connect via localhost:8000/sse.I included a minimal reproduction repo here: https://github.com/eiseleMichael/fastmcp-sse-test
This might be related: modelcontextprotocol/python-sdk#83
Let me know if you need more info or if I'm just using it wrong :-)
The text was updated successfully, but these errors were encountered: