Actualizacion para mcp
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# client.py
|
||||
import asyncio
|
||||
from src.Llms.MCPs.Mcp_client import MCPClient
|
||||
from src.Llms.MCPs.Http_mcp_server import HttpMCPServer
|
||||
|
||||
async def main():
|
||||
client = MCPClient()
|
||||
|
||||
client.register_server(HttpMCPServer(
|
||||
name="tools",
|
||||
path="IGNORED_IN_CLIENT", # no importa aquí
|
||||
host="127.0.0.1",
|
||||
port=4300,
|
||||
path_http="/tools"
|
||||
))
|
||||
|
||||
await client.connect_all()
|
||||
|
||||
result = await client.call_tool({
|
||||
"server": "tools",
|
||||
"tool": "get_hostname",
|
||||
"input": {}
|
||||
})
|
||||
print("RESULT:", result)
|
||||
|
||||
await client.disconnect_all()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user