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
To reduce duplication when exposing functionality from an API, I see it immensely useful to be able to tack on this protocol to an existing fastapi (maybe others) by means of a decorator or extension to fastapi.
fromfastapiimportFastAPIfromfastmcpimportFastMCP, FastAPIWrappermcp=FastMCP("Demo 🚀")
app=FastAPIWrapper(FastAPI(), mcp)
@app.get("/") # <<< internally does normal fastapi stuff + @mcp.tool()asyncdefroot():
return {"message": "Hello World"}
The text was updated successfully, but these errors were encountered:
To reduce duplication when exposing functionality from an API, I see it immensely useful to be able to tack on this protocol to an existing fastapi (maybe others) by means of a decorator or extension to fastapi.
The text was updated successfully, but these errors were encountered: