Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSE Mode: Error when connecting #69

Open
eiseleMichael opened this issue Dec 10, 2024 · 0 comments
Open

SSE Mode: Error when connecting #69

eiseleMichael opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@eiseleMichael
Copy link

eiseleMichael commented Dec 10, 2024

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)

# demo.py
from fastmcp import FastMCP

mcp = FastMCP("Echo 🚀")

@mcp.resource("echo://{message}")
def echo_resource(message: str) -> str:
    """Echo a message as a resource"""
    return f"Resource echo: {message}"

@mcp.tool()
def echo_tool(message: str) -> str:
    """Echo a message as a tool"""
    return f"Tool echo: {message}"

@mcp.prompt()
def echo_prompt(message: str) -> str:
    """Create an echo prompt"""
    return f"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.

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 :-)

@github-actions github-actions bot added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant