MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_mcp_tools_loading

Function test_mcp_tools_loading

tests/test_mcp.py:334–356  ·  view source on GitHub ↗

Test loading MCP tools from mcp.json.

()

Source from the content-addressed store, hash-verified

332
333@pytest.mark.asyncio
334async def test_mcp_tools_loading():
335 """Test loading MCP tools from mcp.json."""
336 print("\n=== Testing MCP Tool Loading ===")
337
338 try:
339 # Load MCP tools
340 tools = await load_mcp_tools_async("mini_agent/config/mcp.json")
341
342 print(f"Loaded {len(tools)} MCP tools")
343
344 # Display loaded tools
345 if tools:
346 for tool in tools:
347 desc = tool.description[:60] if len(tool.description) > 60 else tool.description
348 print(f" - {tool.name}: {desc}")
349
350 # Test should pass even if no tools loaded (e.g., no mcp.json or no Node.js)
351 assert isinstance(tools, list), "Should return a list of tools"
352 print("✅ MCP tools loading test passed")
353
354 finally:
355 # Cleanup MCP connections
356 await cleanup_mcp_connections()
357
358
359@pytest.mark.asyncio

Callers 1

mainFunction · 0.85

Calls 2

load_mcp_tools_asyncFunction · 0.90
cleanup_mcp_connectionsFunction · 0.90

Tested by

no test coverage detected