Files
google-mcp/core
Claude cd326d0f2d Fix TypeError: CORSMiddleware.__call__() missing 2 required positional arguments
The _wrap_well_known_endpoint function assumed all route endpoints are regular
request handlers (async def handler(request) -> Response). However, the MCP
SDK's cors_middleware wraps handlers with CORSMiddleware, which is an ASGI app
expecting (scope, receive, send). When the wrapper called
`await endpoint(request)` on a CORSMiddleware instance, it passed only 1
argument instead of the required 3 ASGI args.

The fix detects whether the endpoint is a regular handler function or an ASGI
app (using the same inspect check as Starlette's Route constructor), and uses
the appropriate calling convention:
- Regular handlers: called as `await endpoint(request)` (existing behavior)
- ASGI apps: invoked via the ASGI interface `await endpoint(scope, receive, send)`
  with response capture to apply cache-busting headers

https://claude.ai/code/session_011S5zFTWRfKBJBUEanrhvQg
2026-03-01 04:56:33 +00:00
..
2025-12-13 13:49:28 -08:00
2026-02-24 11:20:27 -04:00
2025-12-13 13:49:28 -08:00
2025-12-13 13:49:28 -08:00
2025-12-13 13:49:28 -08:00
2026-02-24 21:09:14 -04:00
2026-02-01 12:06:49 -05:00
2026-02-13 16:13:33 -05:00