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

60 lines
No EOL
1.7 KiB
Python
Executable file

#!/usr/bin/env python3
"""
Test script to verify lslint functionality with MCP server
"""
import json
import subprocess
import sys
def test_lslint_functionality():
"""Test lslint functionality through MCP server"""
# Test list_lsl_files first
list_request = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_lsl_files",
"arguments": {}
}
}
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(list_request) + '\n', timeout=10)
print("=== LSL MCP Server - LSLint Test ===")
print("\nListing LSL Files:")
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 'tools' in response:
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_lslint_functionality()