Peril_Dice/test_mcp_server.py
RebeccaNod1 23153cb5db feat: Add MCP (Model Context Protocol) development tools
🔧 MCP Development Infrastructure:
- lsl_mcp_server.py (414 lines): Complete MCP server for LSL validation
  • LSL file listing and validation capabilities
  • Memory usage analysis and reporting
  • Git status integration
  • Architecture analysis tools

📋 Testing & Documentation:
- test_lslint_mcp.py: MCP server testing framework
- test_mcp_server.py: Server functionality tests
- test_validate_lsl.py: LSL validation testing
- debug_mcp.py: MCP debugging utilities
- MCP_README.md: Complete documentation and setup guide
- mcp_config.json: MCP server configuration

🎯 Development Benefits:
- Enhanced LSL development workflow
- Automated validation and analysis
- Professional debugging capabilities
- Integration with existing LSL validator
- Support for AI-assisted development

These tools were used during development of the GitHub Update System
and provide foundation for future LSL development automation.
2025-10-02 11:16:14 -05:00

52 lines
No EOL
1.4 KiB
Python
Executable file

#!/usr/bin/env python3
"""
Simple test script to verify the LSL MCP server is working
"""
import json
import subprocess
import sys
def test_mcp_server():
"""Test basic MCP server functionality"""
# Test tools/list
test_request = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}
try:
# Start the MCP server process
process = subprocess.Popen([
'python3', '/home/richard/peril/lsl_mcp_server.py'
], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
# Send the request
stdout, stderr = process.communicate(input=json.dumps(test_request) + '\n', timeout=10)
print("=== MCP Server Test Results ===")
print("\nServer Output:")
for line in stdout.strip().split('\n'):
if line.strip():
try:
response = json.loads(line)
print(json.dumps(response, indent=2))
except json.JSONDecodeError:
print(f"Non-JSON output: {line}")
if stderr:
print(f"\nServer Errors:\n{stderr}")
print("\n=== Test Complete ===")
except subprocess.TimeoutExpired:
print("Server test timed out")
process.kill()
except Exception as e:
print(f"Test failed: {e}")
if __name__ == "__main__":
test_mcp_server()