Files
zeekay ce3bfd33c1 test: Add local MCP server test script
- Validates server module loading
- Provides testing instructions for users
- Helps with debugging installation issues
2025-11-17 13:52:47 -08:00

49 lines
1.6 KiB
Python

#!/usr/bin/env python
"""Test script to verify MCP server is working locally."""
import asyncio
import json
import sys
async def test_mcp_server():
"""Test the MCP server by running it directly."""
import os
# Set required environment variables for testing
os.environ["MACOS_HOST"] = "localhost"
os.environ["MACOS_USERNAME"] = "test"
os.environ["MACOS_PASSWORD"] = "test"
os.environ["MACOS_PORT"] = "5900"
try:
# Import the server module
from src.mcp_remote_macos import server
print("✅ MCP Server module loaded successfully!")
print("\n📦 Testing server initialization...")
# The server requires actual connection details to run
# For now, we'll just verify the module loads
print("✅ Server module is ready for use!")
print("\n🔧 To use with Claude Desktop:")
print("1. Edit the 'remote-macos-local' server in Claude Desktop config")
print("2. Add your actual macOS host, username, and password")
print("3. Restart Claude Desktop")
print("\n🐳 To use with Docker:")
print("docker run -i -e MACOS_HOST=your_host -e MACOS_USERNAME=your_user -e MACOS_PASSWORD=your_pass --rm mcp-remote-macos:test")
return True
except Exception as e:
print(f"❌ Error testing MCP server: {e}")
import traceback
traceback.print_exc()
return False
if __name__ == "__main__":
success = asyncio.run(test_mcp_server())
sys.exit(0 if success else 1)