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
| Name | Required | Description | Default |
|---|---|---|---|
| framework | Yes | The framework to get installation instructions for | |
| includeUI | No | Whether to include Fumadocs UI setup instructions (default: true) |
Implementation Reference
- src/tools/get-setup-guide.ts:20-77 (handler)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"}`; } }
- src/tools/get-setup-guide.ts:5-13 (schema)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)"), };
- src/tools/get-setup-guide.ts:15-18 (schema)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";