Fresh start - excluded large ROM JSON files

This commit is contained in:
OpenClaw Agent
2026-04-11 09:45:12 -05:00
commit 5deb387aa6
395 changed files with 47744 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
"""Test MCP client for OpenClaw server."""
import asyncio
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
try:
from mcp import ClientSession
from mcp.client.stdio import stdio_client, StdioServerParameters
except ImportError:
print("Install mcp: pip install mcp")
sys.exit(1)
async def test_mcp():
"""Test the OpenClaw MCP server."""
params = StdioServerParameters(
command="python",
args=["openclaw_mcp_server.py"]
)
print("Connecting to OpenClaw MCP server...")
async with stdio_client(params) as (read_stream, write_stream):
async with ClientSession(read_stream, write_stream) as session:
await session.initialize()
print("Connected! ✅")
# Get tools
tools_result = await session.list_tools()
print(f"\nTools available: {len(tools_result.tools)}")
for tool in tools_result.tools:
print(f" - {tool.name}: {tool.description}")
# Test list_files
print("\nTesting list_files...")
result = await session.call_tool("list_files", {"directory": "."})
print(f"Result: {result}")
# Test get_status
print("\nTesting get_status...")
result = await session.call_tool("get_status", {})
print(f"Result: {result}")
if __name__ == "__main__":
asyncio.run(test_mcp())