Fix middleware example: add context parameter to call_next() (#2215)

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
This commit is contained in:
Jeremiah Lowin 2025-10-24 18:41:00 -04:00 committed by GitHub
commit 577ed6e9a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -210,8 +210,8 @@ class UserAuthMiddleware(Middleware):
# Middleware stores user info in context state
context.fastmcp_context.set_state("user_id", "user_123")
context.fastmcp_context.set_state("permissions", ["read", "write"])
return await call_next()
return await call_next(context)
@mcp.tool
async def secure_operation(data: str, ctx: Context) -> str: