Deprecate Server.__init__ handlers for removed capabilities (#3002)

This commit is contained in:
Marcelo Trylesinski 2026-06-26 17:51:13 +02:00 • committed by GitHub
commit ecdf09d44f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 221 additions and 16 deletions

View file

@ -53,7 +53,11 @@ async def set_logging_level(ctx: ServerRequestContext, params: SetLevelRequestPa
raise NotImplementedError
server = Server("stdio-echo", on_list_tools=list_tools, on_call_tool=call_tool, on_set_logging_level=set_logging_level)
with warnings.catch_warnings():
warnings.simplefilter("ignore", MCPDeprecationWarning)
server = Server( # pyright: ignore[reportDeprecated]
"stdio-echo", on_list_tools=list_tools, on_call_tool=call_tool, on_set_logging_level=set_logging_level
)
async def main() -> None:

View file

@ -73,7 +73,7 @@ def _server() -> Server:
"""Registered so the resources subscribe sub-capability is advertised; the client never subscribes."""
raise NotImplementedError
return Server(
return Server( # pyright: ignore[reportDeprecated]
"hosted",
on_list_tools=list_tools,
on_call_tool=call_tool,