UNPKG

@mmlotfy/intellicodemcp

Version:

IntelliCodeMCP - Advanced AI Model Context Protocol System for intelligent code management and orchestration

82 lines 3.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const memory_bank_1 = require("../tools/memory-bank"); const code_trace_1 = require("../tools/code-trace"); const smartcontext_weaver_1 = require("../tools/smartcontext-weaver"); const smartthink_weaver_1 = require("../tools/smartthink-weaver"); const performance_orchestrator_1 = require("../tools/performance-orchestrator"); const web_search_1 = require("../tools/web-search"); class MCPServer { constructor() { this.tools = new Map(); this.registerTools(); } registerTools() { // Register IntelliMemory Hub this.register({ name: 'memory_bank', description: 'File-based storage system for project data', handler: memory_bank_1.executeMemoryFile, }); // Register CodeTraceMCP this.register({ name: 'code_trace', description: 'Tracks TypeScript and ESLint errors', handler: code_trace_1.executeCodeTrace, }); // Register SmartContext Weaver this.register({ name: 'smartcontext_weaver', description: 'Manages and summarizes conversation contexts', handler: smartcontext_weaver_1.executeSmartContext, }); // Register SmartThink Weaver this.register({ name: 'smartthink_weaver', description: 'Advanced reasoning for complex tasks', handler: smartthink_weaver_1.executeSmartThink, }); // Register MCP Performance Orchestrator this.register({ name: 'performance_orchestrator', description: 'Optimizes AI model performance and task orchestration', handler: performance_orchestrator_1.executePerformanceOrchestrator, }); // Register Web Search this.register({ name: 'web_search', description: 'Search the web using SerpAPI for real-time information', handler: web_search_1.executeWebSearch, }); } register(tool) { this.tools.set(tool.name, tool); console.log(`Registered tool: ${tool.name} - ${tool.description}`); } async execute(toolName, args) { const tool = this.tools.get(toolName); if (!tool) { throw new Error(`Tool '${toolName}' not found. Available tools: ${Array.from(this.tools.keys()).join(', ')}`); } try { console.log(`Executing tool: ${toolName}`); const result = await tool.handler(args); console.log(`Tool ${toolName} executed successfully`); return result; } catch (error) { console.error(`Error executing tool ${toolName}:`, error.message); throw error; } } listTools() { return Array.from(this.tools.keys()); } getToolInfo(toolName) { return this.tools.get(toolName); } } // Create and export server instance const server = new MCPServer(); exports.default = server; //# sourceMappingURL=index.js.map