Skip to main content
Glama
server.ts1.14 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { loadTools } from "./toolLoader.js"; // Create server instance const server = new McpServer({ name: "Apache OFBiz MCP Server (stdio)", version: "0.1.0", }); // Load and register tools from external files async function registerTools() { try { const tools = await loadTools(); for (const tool of tools) { server.registerTool( tool.name, tool.metadata, tool.handler ); console.error(`Registered tool: ${tool.name}`); } } catch (error) { console.error("Error loading tools:", error); throw error; } } // Start the server async function main() { await registerTools(); const transport = new StdioServerTransport(); await server.connect(transport); console.error("Apache OFBiz MCP Server running on stdio"); } main().catch((error) => { console.error("Fatal error in main():", error); process.exit(1); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jacopoc/mcp-for-apache-ofbiz'

If you have feedback or need assistance with the MCP directory API, please join our Discord server