- MCP server cu stdio transport pentru performanță maximă
- Tool-uri pentru file operations, HTTP requests, system commands
- Suport NATS pentru comunicare inter-module
- Configurare nginx cu API key auth și SSL
- Arhitectură modulară și extensibilă
🤖 Generated with Claude Code
54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
// Test server without stdio transport
|
|
const { MCPServer } = require('./dist/server');
|
|
|
|
async function test() {
|
|
const server = new MCPServer();
|
|
|
|
// Override start to skip stdio transport
|
|
server.start = async function() {
|
|
const { createLogger } = require('./dist/utils/logger');
|
|
const logger = createLogger('MCPServer');
|
|
const { config } = require('./dist/config');
|
|
|
|
try {
|
|
logger.info({ config: config.mcp }, 'Starting MCP Server (test mode)');
|
|
|
|
// Connect to NATS
|
|
await this.natsClient.connect();
|
|
logger.info('Connected to NATS');
|
|
|
|
// Initialize tool registry after NATS connection
|
|
await this.toolRegistry.initialize();
|
|
logger.info('Tool registry initialized');
|
|
|
|
// Start module manager
|
|
await this.moduleManager.startAll();
|
|
logger.info('Modules started');
|
|
|
|
// Setup MCP handlers
|
|
this.setupHandlers();
|
|
|
|
logger.info(
|
|
{ host: config.mcp.host, port: config.mcp.port },
|
|
'MCP Server started successfully (test mode - no stdio)',
|
|
);
|
|
|
|
// List available tools
|
|
const tools = await this.toolRegistry.listTools();
|
|
logger.info({ count: tools.length }, 'Available tools:');
|
|
tools.forEach(tool => {
|
|
logger.info({ tool: tool.name, description: tool.description });
|
|
});
|
|
|
|
// Keep server running
|
|
logger.info('Server is running. Press Ctrl+C to stop.');
|
|
} catch (error) {
|
|
logger.error({ error }, 'Failed to start MCP Server');
|
|
process.exit(1);
|
|
}
|
|
};
|
|
|
|
await server.start();
|
|
}
|
|
|
|
test().catch(console.error); |