Let Client take StdioServerParameters directly (#3321)
This commit is contained in:
parent
fb443cc4b2
commit
e473cca6a1
1 changed files with 51 additions and 27 deletions
|
|
@ -1,5 +1,4 @@
|
|||
from mcp import Client, StdioServerParameters
|
||||
from mcp.client.stdio import stdio_client
|
||||
|
||||
server = StdioServerParameters(
|
||||
command="uv",
|
||||
|
|
@ -9,6 +8,6 @@ server = StdioServerParameters(
|
|||
|
||||
|
||||
async def main() -> None:
|
||||
async with Client(stdio_client(server)) as client:
|
||||
async with Client(server) as client:
|
||||
result = await client.list_tools()
|
||||
print([tool.name for tool in result.tools])
|
||||
|
|
|
|||
Loading…
Reference in a new issue