Skip to main content
Glama
ThaLoc0one

Documentation MCP Server

by ThaLoc0one

docs_preview

Preview documentation locally by starting a development server. Supports Docusaurus, MkDocs, and Sphinx frameworks with configurable port and docs directory.

Instructions

Start local development server to preview documentation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docsPathYesPath to documentation directory
frameworkYesDocumentation framework used
portNoPort number (default: 3000 for Docusaurus, 8000 for MkDocs/Sphinx)

Implementation Reference

  • The handler function 'preview' that executes the docs_preview tool logic. Returns instructions for starting a local dev server (Docusaurus, MkDocs, or Sphinx) with framework-specific commands and port configuration.
    export async function preview(args: any) {
      const { docsPath, framework, port } = args as PreviewArgs;
    
      const defaultPorts: Record<string, number> = {
        docusaurus: 3000,
        mkdocs: 8000,
        sphinx: 8000,
      };
    
      const selectedPort = port || defaultPorts[framework] || 3000;
    
      const instructions: Record<string, string> = {
        docusaurus: `👀 Starting Docusaurus Preview:
    
    1. Navigate to docs:
       cd ${docsPath}
    
    2. Start dev server:
       npm start
    
    3. Server will run on: http://localhost:${selectedPort}
    
    4. Features:
       - Hot reload
       - Fast refresh
       - Search
       - Navigation
    
    Press Ctrl+C to stop the server.`,
        mkdocs: `👀 Starting MkDocs Preview:
    
    1. Navigate to project:
       cd ${docsPath}
    
    2. Start dev server:
       mkdocs serve -a localhost:${selectedPort}
    
    3. Server will run on: http://localhost:${selectedPort}
    
    4. Features:
       - Auto-reload on save
       - Live preview
       - Search
    
    Press Ctrl+C to stop the server.`,
        sphinx: `👀 Starting Sphinx Preview:
    
    1. Build the docs:
       cd ${docsPath}
       make html
    
    2. Start simple HTTP server:
       cd _build/html
       python -m http.server ${selectedPort}
    
    3. Server will run on: http://localhost:${selectedPort}
    
    4. For auto-rebuild, use sphinx-autobuild:
       pip install sphinx-autobuild
       sphinx-autobuild . _build/html --port ${selectedPort}
    
    Press Ctrl+C to stop the server.`,
      };
    
      const instruction = instructions[framework] || "Framework not supported";
    
      return {
        content: [
          {
            type: "text",
            text: instruction,
          },
        ],
      };
    }
  • The input schema definition for the 'docs_preview' tool, specifying required inputs: docsPath (string), framework (enum: docusaurus/mkdocs/sphinx), and optional port (number).
    name: "docs_preview",
    description: "Start local development server to preview documentation",
    inputSchema: {
      type: "object",
      properties: {
        docsPath: {
          type: "string",
          description: "Path to documentation directory",
        },
        framework: {
          type: "string",
          description: "Documentation framework used",
          enum: ["docusaurus", "mkdocs", "sphinx"],
        },
        port: {
          type: "number",
          description: "Port number (default: 3000 for Docusaurus, 8000 for MkDocs/Sphinx)",
        },
      },
      required: ["docsPath", "framework"],
    },
  • src/index.ts:312-313 (registration)
    The case handler in the CallToolRequestSchema switch that dispatches to the 'preview' function when tool name is 'docs_preview'.
    case "docs_preview":
      return await preview(args);
  • The PreviewArgs interface defining the shape of the documentation preview arguments (docsPath, framework, optional port).
    interface PreviewArgs {
      docsPath: string;
      framework: string;
      port?: number;
    }
  • src/index.ts:16-16 (registration)
    The import of the 'preview' function from './tools/preview.js' into the main server file.
    import { preview } from "./tools/preview.js";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It says 'start local development server' but does not disclose that the server may block the process, require manual stopping, or impact other tools. Missing side effects and lifecycle details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no redundancy. Front-loaded with verb and noun. Every word is meaningful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks critical behavioral context for a server-starting tool: no mention of how to stop the server, what URL is returned, or if it blocks. Output schema is absent, so description should compensate but does not.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds no extra meaning beyond the parameter names and descriptions in the schema. Port defaults are already in schema description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'start', the resource 'local development server', and the purpose 'preview documentation'. It effectively distinguishes from sibling tools like docs_build_static (build) and docs_create_page (create).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage during development for previewing, but does not explicitly state when to use this tool versus alternatives like docs_build_static. No when-not or alternative names are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/ThaLoc0one/documentation-mcp-server'

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