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
✨ 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!
182 lines
6.2 KiB
Python
182 lines
6.2 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Essential Files Analysis for Enhanced MCP Tools
|
|
|
|
This script analyzes which files are absolutely essential vs optional.
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
|
|
def analyze_essential_files():
|
|
"""Analyze which files are essential for running the server"""
|
|
|
|
print("📦 Enhanced MCP Tools - Essential Files Analysis")
|
|
print("=" * 60)
|
|
|
|
enhanced_mcp_dir = Path("enhanced_mcp")
|
|
|
|
# Core Infrastructure (ABSOLUTELY ESSENTIAL)
|
|
core_essential = [
|
|
"enhanced_mcp/__init__.py",
|
|
"enhanced_mcp/base.py",
|
|
"enhanced_mcp/mcp_server.py",
|
|
]
|
|
|
|
print("\n🔴 ABSOLUTELY ESSENTIAL (Core Infrastructure):")
|
|
print("-" * 50)
|
|
for file_path in core_essential:
|
|
if os.path.exists(file_path):
|
|
size = os.path.getsize(file_path)
|
|
print(f"✅ {file_path:<35} ({size:,} bytes)")
|
|
else:
|
|
print(f"❌ {file_path:<35} (MISSING!)")
|
|
|
|
# Currently Required (due to imports in mcp_server.py)
|
|
currently_required = [
|
|
"enhanced_mcp/diff_patch.py",
|
|
"enhanced_mcp/intelligent_completion.py",
|
|
"enhanced_mcp/asciinema_integration.py",
|
|
"enhanced_mcp/sneller_analytics.py",
|
|
"enhanced_mcp/git_integration.py",
|
|
"enhanced_mcp/file_operations.py",
|
|
"enhanced_mcp/archive_compression.py",
|
|
"enhanced_mcp/workflow_tools.py",
|
|
]
|
|
|
|
print("\n🟡 CURRENTLY REQUIRED (due to imports):")
|
|
print("-" * 50)
|
|
total_size = 0
|
|
for file_path in currently_required:
|
|
if os.path.exists(file_path):
|
|
size = os.path.getsize(file_path)
|
|
total_size += size
|
|
print(f"✅ {file_path:<35} ({size:,} bytes)")
|
|
else:
|
|
print(f"❌ {file_path:<35} (MISSING!)")
|
|
|
|
print(f"\nTotal size of ALL modules: {total_size:,} bytes")
|
|
|
|
# Potentially Optional (could be made optional with refactoring)
|
|
potentially_optional = [
|
|
("asciinema_integration.py", "Terminal recording - specialized use case"),
|
|
("sneller_analytics.py", "High-performance SQL - specialized use case"),
|
|
("archive_compression.py", "Archive operations - can use standard tools"),
|
|
("diff_patch.py", "Diff/patch - basic functionality, could be optional"),
|
|
]
|
|
|
|
print("\n🟢 POTENTIALLY OPTIONAL (with refactoring):")
|
|
print("-" * 50)
|
|
for filename, description in potentially_optional:
|
|
file_path = f"enhanced_mcp/{filename}"
|
|
if os.path.exists(file_path):
|
|
size = os.path.getsize(file_path)
|
|
print(f"🔄 {filename:<35} - {description}")
|
|
print(f" {file_path:<35} ({size:,} bytes)")
|
|
|
|
# Most Essential Core
|
|
most_essential = [
|
|
("intelligent_completion.py", "AI-powered tool recommendations - core feature"),
|
|
("git_integration.py", "Git operations - fundamental for development"),
|
|
("file_operations.py", "File operations - basic functionality"),
|
|
("workflow_tools.py", "Development workflow - essential utilities"),
|
|
]
|
|
|
|
print("\n🔥 MOST ESSENTIAL (beyond core infrastructure):")
|
|
print("-" * 50)
|
|
essential_size = 0
|
|
for filename, description in most_essential:
|
|
file_path = f"enhanced_mcp/{filename}"
|
|
if os.path.exists(file_path):
|
|
size = os.path.getsize(file_path)
|
|
essential_size += size
|
|
print(f"⭐ {filename:<35} - {description}")
|
|
print(f" {file_path:<35} ({size:,} bytes)")
|
|
|
|
# Calculate minimal vs full
|
|
core_size = sum(os.path.getsize(f) for f in core_essential if os.path.exists(f))
|
|
|
|
print("\n📊 SIZE ANALYSIS:")
|
|
print("-" * 50)
|
|
print(f"Core Infrastructure Only: {core_size:,} bytes")
|
|
print(f"Minimal Essential: {core_size + essential_size:,} bytes")
|
|
print(f"Full System (Current): {core_size + total_size:,} bytes")
|
|
|
|
return {
|
|
"core_essential": core_essential,
|
|
"currently_required": currently_required,
|
|
"most_essential": [f"enhanced_mcp/{f}" for f, _ in most_essential],
|
|
"potentially_optional": [f"enhanced_mcp/{f}" for f, _ in potentially_optional],
|
|
}
|
|
|
|
|
|
def show_minimal_server_example():
|
|
"""Show how to create a minimal server"""
|
|
|
|
print("\n🚀 MINIMAL SERVER EXAMPLE:")
|
|
print("-" * 50)
|
|
|
|
minimal_example = '''
|
|
# minimal_mcp_server.py - Example of absolute minimum files needed
|
|
|
|
from enhanced_mcp.base import *
|
|
from enhanced_mcp.intelligent_completion import IntelligentCompletion
|
|
from enhanced_mcp.git_integration import GitIntegration
|
|
from enhanced_mcp.file_operations import EnhancedFileOperations
|
|
|
|
class MinimalMCPServer(MCPMixin):
|
|
"""Minimal MCP server with only essential tools"""
|
|
|
|
def __init__(self, name: str = "Minimal MCP Server"):
|
|
super().__init__()
|
|
self.name = name
|
|
|
|
# Only the most essential tools
|
|
self.completion = IntelligentCompletion() # AI recommendations
|
|
self.git = GitIntegration() # Git operations
|
|
self.file_ops = EnhancedFileOperations() # File operations
|
|
|
|
self.tools = {
|
|
'completion': self.completion,
|
|
'git': self.git,
|
|
'file_ops': self.file_ops
|
|
}
|
|
|
|
def create_minimal_server():
|
|
server = FastMCP("Minimal Enhanced MCP")
|
|
tool_server = MinimalMCPServer()
|
|
server.include_router(tool_server, prefix="tools")
|
|
return server
|
|
|
|
if __name__ == "__main__":
|
|
server = create_minimal_server()
|
|
server.run()
|
|
'''
|
|
|
|
print(minimal_example)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
os.chdir("/home/rpm/claude/enhanced-mcp-tools")
|
|
results = analyze_essential_files()
|
|
show_minimal_server_example()
|
|
|
|
print("\n🎯 SUMMARY:")
|
|
print("=" * 60)
|
|
print("✅ ABSOLUTE MINIMUM to run ANY server:")
|
|
for f in results["core_essential"]:
|
|
print(f" - {f}")
|
|
|
|
print("\n✅ PRACTICAL MINIMUM for useful server:")
|
|
for f in results["most_essential"]:
|
|
print(f" - {f}")
|
|
|
|
print("\n🔄 CURRENTLY ALL REQUIRED due to mcp_server.py imports:")
|
|
print(" - All 11 modules are imported and instantiated")
|
|
|
|
print("\n💡 TO MAKE MODULES OPTIONAL:")
|
|
print(" - Refactor mcp_server.py to use conditional imports")
|
|
print(" - Add configuration to enable/disable modules")
|
|
print(" - Use dependency injection pattern")
|