Skip to main content
Glama
BoosClues

MCP Server Boilerplate

by BoosClues

get-mcp-docs

Generate documentation for MCP servers built with the MCP Server Boilerplate template to help developers understand and implement custom tools and resource providers for AI assistants.

Instructions

Make an MCP server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the MCP server

Implementation Reference

  • The handler function that implements the logic for the 'get-mcp-docs' tool. It generates a sample MCP server implementation code as a markdown code block and returns it as text content.
    handler: async () => { const response = ` # Main file for the MCP server \`\`\`ts import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; // Create the MCP server const server = new McpServer({ name: "hello-world", version: "1.0.0", }); // Tool: Store conversation with embeddings server.tool( "hello-world", "Say hello to the user", { name: z.string().describe("The name of the user"), }, async ({ name }) => { const response = \`Hello \${name}\`; return { content: [ { type: "text", text: response, }, ], }; } ); // Start the server async function main() { try { const transport = new StdioServerTransport(); await server.connect(transport); console.error("MCP Hello World Server running..."); } catch (error) { console.error("Error starting server:", error); process.exit(1); } } main().catch(console.error); \`\`\` `; return { content: [ { type: "text", text: response, }, ], }; },
  • The input schema for the 'get-mcp-docs' tool using Zod, defining a 'name' parameter (though not used in handler).
    schema: { name: z.string().describe("The name of the MCP server"), },
  • src/tools.ts:98-113 (registration)
    The registerTools function that registers the 'get-mcp-docs' tool (and others) on the MCP server instance by calling server.tool for each.
    export function registerTools(server: McpServer, enabledTools?: string[]) { const toolsToRegister = enabledTools && enabledTools.length > 0 ? tools.filter((tool) => enabledTools.includes(tool.name)) : tools; for (const tool of toolsToRegister) { server.tool(tool.name, tool.description, tool.schema, tool.handler); } console.error( `Registered ${toolsToRegister.length} tools: ${toolsToRegister .map((t) => t.name) .join(", ")}` ); }
  • src/index.ts:22-32 (registration)
    Code that parses the ENABLED_TOOLS environment variable and calls registerTools to register the tools, including 'get-mcp-docs', on the server.
    // Parse ENABLED_TOOLS from environment const enabledToolsEnv = process.env.ENABLED_TOOLS?.trim(); const enabledTools = enabledToolsEnv ? enabledToolsEnv .split(",") .map((t) => t.trim()) .filter(Boolean) : undefined; // Register tools based on configuration registerTools(server, enabledTools);

Other Tools

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/BoosClues/new-MCP-builder'

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