Add support for serverside oauth (#255)
Co-authored-by: David Soria Parra <davidsp@anthropic.com> Co-authored-by: Basil Hosmer <basil@anthropic.com> Co-authored-by: ihrpr <inna@anthropic.com>
This commit is contained in:
parent
82bd8bc1d9
commit
2210c1be18
1 changed files with 4120 additions and 22 deletions
10
src/mcp/server/auth/json_response.py
Normal file
10
src/mcp/server/auth/json_response.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from typing import Any
|
||||
|
||||
from starlette.responses import JSONResponse
|
||||
|
||||
|
||||
class PydanticJSONResponse(JSONResponse):
|
||||
# use pydantic json serialization instead of the stock `json.dumps`,
|
||||
# so that we can handle serializing pydantic models like AnyHttpUrl
|
||||
def render(self, content: Any) -> bytes:
|
||||
return content.model_dump_json(exclude_none=True).encode("utf-8")
|
||||
Loading…
Reference in a new issue