Skip to main content
Glama
chrisleekr

MCP Server Boilerplate

by chrisleekr
registry.ts777 B
import { Tool, ToolDefinition } from '@/tools/types'; /** * Tool registry implementation */ export class ToolRegistry { private tools = new Map<string, Tool>(); public register<TInput, TOutput>(tool: Tool<TInput, TOutput>): void { this.tools.set(tool.definition.name, tool as Tool); } public unregister(name: string): void { this.tools.delete(name); } public get(name: string): Tool | undefined { return this.tools.get(name); } public list(): ToolDefinition[] { return Array.from(this.tools.values()).map(tool => tool.definition); } public has(name: string): boolean { return this.tools.has(name); } public getAll(): Map<string, Tool> { return new Map(this.tools); } } export const toolRegistry = new ToolRegistry();

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/chrisleekr/mcp-server-boilerplate'

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