Commit Graph

10 Commits

Author SHA1 Message Date
Ra
4b7c4b6314 Save current state before fixing MCP tool registration and proxying 2025-09-03 03:01:58 -07:00
Ra
004ba6ab55 Fix VS Code MCP server initialization crash and multi-agent architecture
CRITICAL FIX:
- Removed auto-registration during initialization that was causing crashes
- Fixed pattern match error with Inbox.start_link (already_started case)
- Changed architecture to require explicit agent registration with unique IDs

MULTI-AGENT SUPPORT:
- Agents must now register themselves with unique identifiers (e.g., 'Green Platypus')
- register_agent tool now works without requiring prior agent_id
- All other tools require agent_id parameter to identify the calling agent
- Proper error handling for missing agent_id in tool calls

ARCHITECTURE CHANGE:
- One MCP server instance serves multiple agents (as per VS Code design)
- Removed auto-registration of 'GitHub Copilot' agent during initialization
- Each agent must explicitly call register_agent before using other tools

This fixes the VS Code connection error:
MatchError: no match of right hand side value: {:error, {:already_started, #PID<0.215.0>}}
2025-09-03 00:59:52 -07:00
Ra
7cb42e4131 Remove duplicate MCP server files - consolidation complete
- Deleted mcp_server_manager.ex, enhanced_mcp_server.ex, unified_mcp_server.ex
- All functionality successfully consolidated into single mcp_server.ex
- Server starts correctly with all external servers (context7, filesystem, memory, sequentialthinking)
- HTTP server support working for mcp_figma
- All 15+ agent coordination tools properly registered
- Codebase is now clean with no duplicate files
2025-09-03 00:24:06 -07:00
Ra
ea3c390257 Successfully consolidated all MCP server functionality into unified MCPServer
- Combined external server management from MCPServerManager (stdio/http support)
- Integrated session tracking and heartbeat from EnhancedMCPServer
- Added auto-registration and unified interface from UnifiedMCPServer
- Fixed HTTP server support to prevent crashes on mcp_figma config
- All 15+ agent coordination tools now properly registered and working
- External servers (context7, filesystem, memory, sequentialthinking) starting correctly
- HTTP servers handled gracefully with proper fallback logging
- Application.ex updated to start only consolidated MCPServer
- Ready to remove duplicate files after verification
2025-09-03 00:19:39 -07:00
Ra
074c4473ca Save current state before cleaning up duplicate MCP server files 2025-09-03 00:01:02 -07:00
Ra
37f76e060e Fix MCP server communication: remove line limit and improve JSON parsing
- Remove {:line, 1024} port option that was truncating long JSON responses
- Rewrite collect_response to handle binary data instead of line-based data
- Add extract_json_messages function to properly parse complete JSON from mixed stdout
- Filter out log messages while preserving complete JSON responses
- Add timeouts to all GenServer calls to prevent blocking
- This fixes the 'unexpected end of input at position 1024' JSON decode errors
2025-08-24 06:17:18 -07:00
Ra
62319b87db feat: implement dynamic MCP tool discovery with shared server architecture
- Replace hardcoded tool lists with dynamic discovery via MCP tools/list
- Move MCPServerManager to application supervision tree for resource sharing
- Eliminate duplicate MCP server instances (one shared instance per server type)
- Add automatic tool refresh when servers restart
- Implement conditional VS Code tool loading based on module availability
- Add comprehensive test suite for dynamic discovery
- Update documentation with architecture improvements

Benefits:
- Full MCP protocol compliance
- Massive resource savings (shared servers vs per-agent instances)
- Zero maintenance overhead for tool list synchronization
- Automatic adaptation to server changes
- Improved reliability and performance

Closes: Dynamic tool discovery implementation
Fixes: Multiple MCP server instance resource waste
2025-08-23 15:47:12 -07:00
Ra
5da801c2ca Implement VS Code Tool Integration
Phase 1: Core VS Code Tool Provider
- Created VSCodeToolProvider with 12 core tools (file ops, editor ops, commands)
- Implemented VSCodePermissions with 6 permission levels and security controls
- Integrated VS Code tools into UnifiedMCPServer tool discovery and routing
- Added comprehensive documentation in VSCODE_TOOL_INTEGRATION.md

Tools implemented:
- File Operations: read_file, write_file, create_file, delete_file, list_directory
- Editor Operations: get/set editor content, get/set selection, get active editor
- Commands: run_command (with whitelist), show_message
- Workspace: get_workspace_folders

Security features:
- Permission levels: read_only, editor, filesystem, terminal, git, admin
- Path sandboxing to prevent access outside workspace
- Command whitelisting for safe operations
- Audit logging for all VS Code tool operations

Next: Implement actual VS Code Extension API bridge and language services
2025-08-23 14:53:03 -07:00
Ra
943d8ad4d7 Fix inbox creation issues in agent coordinator
- Fixed Task.new/3 to handle both maps and keyword lists
- Added robust inbox existence checking in find_available_agent
- Ensure inbox creation during agent registration and task assignment
- Add helper function ensure_inbox_exists to avoid crashes
2025-08-23 14:46:28 -07:00
Ra
5048db99c7 start repo 2025-08-22 05:08:00 -07:00