Geraldino07/Meridian-ChatBot
0
1#!/usr/bin/env python32"""Smoke test: MCP list_tools + one read-only tool call. Run from repo root: python scripts/smoke_mcp.py"""3 4from __future__ import annotations5 6import asyncio7import sys8from pathlib import Path9 10# Allow running without editable install11_ROOT = Path(__file__).resolve().parents[1]12if str(_ROOT) not in sys.path:13 sys.path.insert(0, str(_ROOT / "src"))14 15from meridian_bot.config import get_settings16from meridian_bot.mcp_client.session import call_tool_safe, with_mcp_session17 18 19async def main() -> None:20 settings = get_settings()21 print("MCP_SERVER_URL:", settings.mcp_server_url)22 async with with_mcp_session(settings) as session:23 from meridian_bot.mcp_client.session import list_tool_definitions24 25 tools = await list_tool_definitions(session)26 print("tools:", [t["name"] for t in tools])27 text = await call_tool_safe(session, "search_products", {"query": "keyboard"})28 print("search_products sample:\n", text[:1200])29 30 31if __name__ == "__main__":32 asyncio.run(main())33 