UNPKG

mcp-cve-intelligence-server-lite-test

Version:

Lite Model Context Protocol server for comprehensive CVE intelligence gathering with multi-source exploit discovery, designed for security professionals and cybersecurity researchers - Alpha Release

53 lines 1.51 kB
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { createContextLogger } from '../utils/logger.js'; const logger = createContextLogger('StdioTransportServer'); export class StdioTransportServer { mcpServerFactory; transport; server; constructor(mcpServerFactory) { this.mcpServerFactory = mcpServerFactory; } /** * Create and start the stdio transport */ async start() { logger.info('Creating stdio transport'); this.transport = new StdioServerTransport(); this.server = this.mcpServerFactory(); logger.info('Connecting stdio transport to MCP server'); await this.server.connect(this.transport); logger.info('Stdio transport started and connected'); return this.transport; } /** * Stop the stdio transport */ async stop() { if (this.transport) { logger.info('Stopping stdio transport'); this.transport.close(); this.transport = undefined; this.server = undefined; } } /** * Get the current transport */ getTransport() { return this.transport; } /** * Get the current server */ getServer() { return this.server; } /** * Check if the transport is active */ isActive() { return this.transport !== undefined && this.server !== undefined; } } //# sourceMappingURL=stdio-transport-server.js.map