add mcp, batching

This commit is contained in:
2025-12-07 04:35:21 +01:00
parent 30f68a9d04
commit d6bc34d138
14 changed files with 1973 additions and 138 deletions

27
mcp/test/client.py Normal file
View File

@@ -0,0 +1,27 @@
import asyncio
from fastmcp import Client
client = Client("http://[::1]:8031/mcp")
async def test_get_cave_location(cave: str, state: str, county: str):
async with client:
resp = await client.call_tool("get_cave_location", {"cave": cave, "state": state, "county": county})
print()
print(cave)
for item in resp.structured_content['result']:
print(item)
async def test_general_caving_information(query: str):
async with client:
resp = await client.call_tool("general_caving_information", {"query": query})
print()
print(query)
for item in resp.structured_content['result']:
print(item)
asyncio.run(test_get_cave_location("Nellies Cave", "VA", "Montgomery"))
asyncio.run(test_get_cave_location("links cave", "VA", "Giles"))
#asyncio.run(test_get_cave_location("new river", "VA", "Giles"))
#asyncio.run(test_get_cave_location("tawneys", "VA", "Giles"))
#asyncio.run(test_get_cave_location("staty fork", "WV", "Pocahontas"))
#asyncio.run(test_general_caving_information("broken sunnto"))