UNPKG

@yeepay/awesome-components-mcp

Version:

MCP server providing access to awesome-components documentation and integration guides with dual-mode operation: direct fetch and GitLab MCP instruction generation

41 lines (40 loc) 2.53 kB
#!/usr/bin/env node "use strict"; /** * Awesome Components MCP Server * * This is the main entry point for the Awesome Components MCP (Model Context Protocol) server. * The server provides access to the awesome-components documentation and integration guides. */ Object.defineProperty(exports, "__esModule", { value: true }); const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js"); const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js"); const config_1 = require("./config"); const componentsDiscovery_1 = require("./tools/componentsDiscovery"); const getComponentsGuide_1 = require("./tools/getComponentsGuide"); async function main() { console.log('Awesome Components MCP Server starting...'); // Create MCP server instance const server = new mcp_js_1.McpServer({ name: config_1.config.name, version: config_1.config.version }); console.log(`MCP Server "${config_1.config.name}" v${config_1.config.version} initialized`); // Register the components_discovery tool server.tool("components_discovery", "Discover and categorize all available components from the main llms.txt file. Use this tool to get an overview of all components, their types, and paths. Returns structured JSON data with component metadata and categorization. This tool is ideal for exploring what components are available before retrieving specific component guides.", {}, componentsDiscovery_1.componentsDiscoveryTool); // Register the get_components_guide tool server.tool("get_components_guide", "Retrieve detailed integration guide for a specific component. Use this tool when you need the complete documentation, setup instructions, or implementation details for a particular component. Provide the component path (e.g., 'yeepay/dynamicpassword/llms.txt') to get its comprehensive guide. Supports both relative paths from the repository and absolute URLs for external components.", { path: getComponentsGuide_1.getComponentsGuideSchema.shape.path }, getComponentsGuide_1.getComponentsGuideTool); console.log('Registered tools: components_discovery, get_components_guide'); // Create stdio transport for command-line usage const transport = new stdio_js_1.StdioServerTransport(); // Connect server to transport await server.connect(transport); console.log(`MCP Server running and listening for requests`); } // Start the server main().catch((error) => { console.error('Failed to start MCP server:', error); process.exit(1); });