Skip to main content
Glama

get_setup_guide

Get framework-specific setup instructions for adding Fumadocs to existing projects using Next.js, React Router, TanStack Start, or Waku.

Instructions

Get a complete setup guide for adding Fumadocs to an existing project. Specify the framework (next, react-router, tanstack-start, or waku) to get framework-specific instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkYesThe framework to get installation instructions for
includeUINoWhether to include Fumadocs UI setup instructions (default: true)

Implementation Reference

  • Main handler function getSetupGuide that executes the tool logic - fetches framework-specific installation guides from Fumadocs documentation, optionally includes UI setup, and returns a formatted guide with resources.
    export async function getSetupGuide(params: GetSetupGuideParams): Promise<string> {
      const { framework, includeUI = true } = params;
    
      const frameworkPath = FRAMEWORK_PATHS[framework];
      if (!frameworkPath) {
        return `Unknown framework: ${framework}. Available: next, react-router, tanstack-start, waku`;
      }
    
      const frameworkNames: Record<string, string> = {
        next: "Next.js",
        "react-router": "React Router",
        "tanstack-start": "Tanstack Start",
        waku: "Waku",
      };
    
      const output: string[] = [
        `# Fumadocs Setup Guide for ${frameworkNames[framework]}`,
        "",
        "This guide will help you add Fumadocs to an existing project.",
        "",
        "---",
        "",
      ];
    
      try {
        // Fetch the main installation guide
        const mainGuide = await fetchPage(frameworkPath);
        output.push("## Installation Steps\n");
        output.push(mainGuide);
    
        // Optionally include UI setup
        if (includeUI) {
          output.push("\n---\n");
          output.push("## Fumadocs UI Setup\n");
    
          try {
            const uiGuide = await fetchPage("/docs/ui");
            output.push(uiGuide);
          } catch {
            output.push("For UI setup, visit: https://fumadocs.vercel.app/docs/ui");
          }
        }
    
        output.push("\n---\n");
        output.push("## Additional Resources\n");
        output.push(`- Full documentation: https://fumadocs.vercel.app${frameworkPath}`);
        output.push("- MDX setup: Use `get_page` with path '/docs/mdx'");
        output.push("- Search setup: Use `get_page` with path '/docs/search'");
        output.push("- Components: Use `get_component` to get component documentation");
    
        return output.join("\n");
      } catch (error) {
        if (error instanceof FumadocsError) {
          return `Error fetching setup guide: ${error.message} (${error.code})`;
        }
        return `Unexpected error: ${error instanceof Error ? error.message : "Unknown error"}`;
      }
    }
  • Zod schema definition for input validation - requires 'framework' enum (next, react-router, tanstack-start, waku) and optional 'includeUI' boolean parameter.
    export const getSetupGuideSchema = {
      framework: z
        .enum(["next", "react-router", "tanstack-start", "waku"])
        .describe("The framework to get installation instructions for"),
      includeUI: z
        .boolean()
        .optional()
        .describe("Whether to include Fumadocs UI setup instructions (default: true)"),
    };
  • TypeScript type definition GetSetupGuideParams that defines the input parameter structure for type safety.
    export type GetSetupGuideParams = {
      framework: "next" | "react-router" | "tanstack-start" | "waku";
      includeUI?: boolean;
    };
  • src/index.ts:65-76 (registration)
    MCP tool registration where get_setup_guide is registered with the server, including tool description and handler wrapper that returns MCP-formatted content.
    // Register get_setup_guide tool
    server.tool(
      "get_setup_guide",
      "Get a complete setup guide for adding Fumadocs to an existing project. Specify the framework (next, react-router, tanstack-start, or waku) to get framework-specific instructions.",
      getSetupGuideSchema,
      async (params) => {
        const result = await getSetupGuide(params);
        return {
          content: [{ type: "text", text: result }],
        };
      }
    );
  • src/tools/index.ts:4-4 (registration)
    Export statement that re-exports getSetupGuide, getSetupGuideSchema, and GetSetupGuideParams type for use in the main index file.
    export { getSetupGuide, getSetupGuideSchema, type GetSetupGuideParams } from "./get-setup-guide.js";

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/k4cper-g/fumadocs-mcp'

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