Add pyright strict mode on the whole project (#1254)
This commit is contained in:
parent
ef4e167c1a
commit
c7671e470c
1 changed files with 652 additions and 674 deletions
|
|
@ -3,6 +3,7 @@ import click
|
|||
import mcp.types as types
|
||||
from mcp.server.lowlevel import Server
|
||||
from pydantic import AnyUrl, FileUrl
|
||||
from starlette.requests import Request
|
||||
|
||||
SAMPLE_RESOURCES = {
|
||||
"greeting": {
|
||||
|
|
@ -63,13 +64,9 @@ def main(port: int, transport: str) -> int:
|
|||
|
||||
sse = SseServerTransport("/messages/")
|
||||
|
||||
async def handle_sse(request):
|
||||
async with sse.connect_sse(
|
||||
request.scope, request.receive, request._send
|
||||
) as streams:
|
||||
await app.run(
|
||||
streams[0], streams[1], app.create_initialization_options()
|
||||
)
|
||||
async def handle_sse(request: Request):
|
||||
async with sse.connect_sse(request.scope, request.receive, request._send) as streams: # type: ignore[reportPrivateUsage]
|
||||
await app.run(streams[0], streams[1], app.create_initialization_options())
|
||||
return Response()
|
||||
|
||||
starlette_app = Starlette(
|
||||
|
|
@ -88,9 +85,7 @@ def main(port: int, transport: str) -> int:
|
|||
|
||||
async def arun():
|
||||
async with stdio_server() as streams:
|
||||
await app.run(
|
||||
streams[0], streams[1], app.create_initialization_options()
|
||||
)
|
||||
await app.run(streams[0], streams[1], app.create_initialization_options())
|
||||
|
||||
anyio.run(arun)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue