Peril_Dice/test_validate_lsl.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

62 lines
No EOL
1.9 KiB
Python
Executable file

#!/usr/bin/env python3
"""
Test script to validate a specific LSL file using the comprehensive validator
"""
import json
import subprocess
import sys
def test_validate_lsl():
"""Test LSL validation through MCP server"""
# Test validate_lsl_file with Main_Controller_Linkset.lsl
validate_request = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "validate_lsl_file",
"arguments": {
"file_path": "Main_Controller_Linkset.lsl"
}
}
}
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(validate_request) + '\n', timeout=15)
print("=== LSL Comprehensive Validation Test ===")
print("\nValidating Main_Controller_Linkset.lsl:")
lines = stdout.strip().split('\n')
for line in lines:
if line.strip():
try:
response = json.loads(line)
if 'content' in response:
print(response['content'][0]['text'])
elif 'method' in response and response['method'] == 'server/initialized':
print("✅ Server initialized successfully")
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_validate_lsl()