enhanced-mcp-tools/tests/test_functional.py
Ryan Malloy 92b158b847
Some checks failed
CI / Code Quality (push) Failing after 17s
CI / Test (ubuntu-latest, 3.10) (push) Failing after 5s
CI / Test (ubuntu-latest, 3.11) (push) Failing after 4s
CI / Test (ubuntu-latest, 3.12) (push) Failing after 4s
CI / Test (ubuntu-latest, 3.13) (push) Failing after 4s
CI / Coverage (push) Failing after 25s
CI / Test (macos-latest, 3.13) (push) Has been cancelled
CI / Test (macos-latest, 3.10) (push) Has been cancelled
CI / Test (macos-latest, 3.11) (push) Has been cancelled
CI / Test (macos-latest, 3.12) (push) Has been cancelled
CI / Test (windows-latest, 3.10) (push) Has been cancelled
CI / Test (windows-latest, 3.11) (push) Has been cancelled
CI / Test (windows-latest, 3.12) (push) Has been cancelled
CI / Test (windows-latest, 3.13) (push) Has been cancelled
🚀 Initial release: Enhanced MCP Tools v1.0.0
 Features:
- 50+ development tools across 13 specialized categories
-  Sneller Analytics: High-performance vectorized SQL (TB/s throughput)
- 🎬 Asciinema Integration: Terminal recording and sharing
- 🧠 AI-Powered Recommendations: Intelligent tool suggestions
- 🔀 Advanced Git Integration: Smart operations with AI suggestions
- 📁 Enhanced File Operations: Monitoring, bulk ops, backups
- 🔍 Semantic Code Search: AST-based intelligent analysis
- 🏗️ Development Workflow: Testing, linting, formatting
- 🌐 Network & API Tools: HTTP client, mock servers
- 📦 Archive & Compression: Multi-format operations
- 🔬 Process Tracing: System call monitoring
- 🌍 Environment Management: Virtual envs, dependencies

🎯 Ready for production with comprehensive documentation and MCP Inspector support!
2025-06-23 02:33:23 -06:00

79 lines
2.4 KiB
Python

#!/usr/bin/env python3
"""
Functional test for MCP tools
"""
import asyncio
import os
import tempfile
from pathlib import Path
from enhanced_mcp.mcp_server import MCPToolServer
async def test_functional():
"""Test actual tool functionality"""
print("Testing MCP Tools Functionality")
print("=" * 40)
server = MCPToolServer()
server.register_all_tools()
# Test 1: Environment Info
print("\n1. Testing environment_info...")
try:
result = await server.env_process.environment_info(["system", "python"])
print(f" ✅ Environment info: {len(result)} sections returned")
print(f" 📊 Python version: {result.get('python', {}).get('version')}")
except Exception as e:
print(f" ❌ Environment info failed: {e}")
# Test 2: File backup
print("\n2. Testing file_backup...")
try:
# Create a temporary file
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".txt") as f:
f.write("Test content for backup")
temp_file = f.name
result = await server.file_ops.file_backup([temp_file])
print(f" ✅ File backup: {len(result)} backup(s) created")
# Cleanup
os.unlink(temp_file)
for backup in result:
if os.path.exists(backup):
os.unlink(backup)
except Exception as e:
print(f" ❌ File backup failed: {e}")
# Test 3: HTTP Request
print("\n3. Testing http_request...")
try:
result = await server.network_api.http_request(
url="https://httpbin.org/json", method="GET", timeout=10
)
print(f" ✅ HTTP request: Status {result.get('status_code')}")
print(f" 📊 Response time: {result.get('elapsed_seconds', 0):.2f}s")
except Exception as e:
print(f" ❌ HTTP request failed: {e}")
# Test 4: Dependency Check
print("\n4. Testing dependency_check...")
try:
result = await server.utility.dependency_check(".")
deps = result.get("dependencies", {})
print(f" ✅ Dependency check: Found {len(deps)} dependency files")
if "python" in deps:
print(f" 📦 Python deps: {len(deps['python'])} found")
except Exception as e:
print(f" ❌ Dependency check failed: {e}")
print("\n" + "=" * 40)
print("✅ Functional testing complete!")
if __name__ == "__main__":
asyncio.run(test_functional())