Deprecate Server.__init__ handlers for removed capabilities (#3002)
This commit is contained in:
parent
08b62308d4
commit
ecdf09d44f
2 changed files with 221 additions and 16 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue