We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jmagar/homelab-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
// src/tools/index.ts
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import type { ServiceContainer } from "../services/container.js";
import { FluxTool, ScoutTool } from "./definitions/index.js";
import { ToolRegistry } from "./registry.js";
/**
* Register all tools with the MCP server using the ToolRegistry pattern
*
* Uses the registry pattern to enable plugin-style tool additions without
* modifying this file. To add a new tool:
*
* 1. Create a ToolDefinition (see src/tools/registry.ts)
* 2. Import your tool definition here
* 3. Call registry.register(YourTool)
*
* @param server - MCP server instance
* @param container - Service container for dependency injection
*
* @example
* ```typescript
* // Add custom tool
* import { MyCustomTool } from "./definitions/my-custom-tool.js";
*
* export function registerTools(server: McpServer, container?: ServiceContainer) {
* if (!container) {
* throw new Error("ServiceContainer is required for tool registration");
* }
*
* const registry = new ToolRegistry(container);
* registry.register(FluxTool);
* registry.register(ScoutTool);
* registry.register(MyCustomTool); // Add your tool here
* registry.registerAll(server);
* }
* ```
*/
export function registerTools(server: McpServer, container?: ServiceContainer): void {
if (!container) {
throw new Error("ServiceContainer is required for tool registration");
}
// Create registry with service container
const registry = new ToolRegistry(container);
// Register built-in tools
registry.register(FluxTool);
registry.register(ScoutTool);
// Register all tools with MCP server
registry.registerAll(server);
}
export { FluxTool, ScoutTool } from "./definitions/index.js";
// Export registry and definitions for external use
export { type ToolDefinition, ToolRegistry } from "./registry.js";