npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docusaurus-smg

v0.0.4

Published

Generate StaticMCP files from Docusaurus projects

Downloads

12

Readme

StaticMCP Generator for Docusaurus

A tool to generate StaticMCP files from Docusaurus documentation projects, enabling AI assistants to access and search your documentation content through the Model Context Protocol (MCP).

Features

  • 🚀 Easy Setup: Convert any Docusaurus project to a StaticMCP server with one command
  • 📖 Full Content Access: Extracts all markdown content, frontmatter, and metadata
  • 🔍 Built-in Search: Includes search and listing tools for AI assistants
  • 🎯 Compliant: Follows StaticMCP Standard v0.1 specification
  • 🔄 Flexible Input: Works with both source directories and markdown files

Installation

As a Global CLI Tool

npm install -g docusaurus-smg

As a Project Dependency

npm install docusaurus-smg
# or
yarn add docusaurus-smg

Quick Start

Command Line Usage

# Generate from Docusaurus source directory
docusaurus-smg ./my-docusaurus-site

# Specify output directory and custom options
docusaurus-smg ./docs --output ./mcp-server --name "My Documentation API"

# Generate with custom base URI
docusaurus-smg ./my-site --base-uri "knowledge" --version "2.0.0"

Programmatic Usage

const StaticMCPGenerator = require('docusaurus-smg');

const generator = new StaticMCPGenerator({
  outputDir: './my-mcp-server',
  serverName: 'My Custom Docs Server',
  serverVersion: '1.0.0',
  baseUri: 'docs'
});

await generator.generate('./my-docusaurus-project');
console.log('StaticMCP server generated!');

Command Line Options

| Option | Description | Default | |--------|-------------|---------| | --output <dir> | Output directory for the StaticMCP server | ./staticmcp-output | | --name <name> | Human-readable server name | "Docusaurus StaticMCP Server" | | --version <version> | Server version | "1.0.0" | | --base-uri <uri> | Base URI for resources | "docs" |

Generated Structure

The tool generates a complete StaticMCP server with this structure:

staticmcp-output/
  ├── mcp.json                      # Main manifest file
  ├── resources/                    # Resource files
  │     ├── getting-started.json    # Individual markdown resources
  │     ├── api_reference.json
  │     └── ...
  └── tools/                        # Tool response files
        └── list_docs/
              ├── all.json
              ├── docs.json
              └── blog.json

Available Resources and Tools

Resources

Each markdown file in your Docusaurus project becomes a resource:

  • URI Format: docs://path/to/file (without .md extension)
  • Content: Full markdown content with frontmatter metadata
  • MIME Type: text/markdown

Built-in Tools

1. List Documentation (list_docs)

List available documentation:

{
  "name": "list_docs", 
  "description": "List available documentation",
  "parameters": {
    "type": "string (optional) - docs|blog|all"
  }
}

Configuration Options

Constructor Options

const generator = new StaticMCPGenerator({
  outputDir: './output',           // Output directory
  serverName: 'My Server',         // Server name in manifest
  serverVersion: '1.0.0',          // Server version
  protocolVersion: '2024-11-05',   // MCP protocol version
  baseUri: 'docs'                  // Base URI for resources
});

Examples

Basic Docusaurus Site

# Clone a sample Docusaurus site
git clone https://github.com/facebook/docusaurus.git
cd docusaurus/website

# Generate StaticMCP server
docusaurus-smg . --output ./mcp-server --name "Docusaurus Docs"

Custom Documentation Structure

# For a custom docs folder structure
docusaurus-smg ./my-docs --base-uri "knowledge" --name "Knowledge Base"

Multiple Documentation Types

The generator automatically detects and processes:

  • docs/: Main documentation (mapped to docs:// URIs)
  • blog/: Blog posts (mapped to blog:// URIs)
  • Any other markdown files in the project

Integration with AI Assistants

Once generated, your StaticMCP server can be used with any MCP-compatible AI assistant:

  1. Deploy the server to a web server or CDN
  2. Configure your AI assistant to connect to the StaticMCP server (through a bridge)
  3. Start asking questions about your documentation!

Supported Input Formats

Docusaurus Source Directory

  • Detects docusaurus.config.js or docusaurus.config.ts
  • Processes docs/, blog/, and src/pages directories
  • Extracts frontmatter and content from .md and .mdx files

Standalone Markdown Directory

  • Processes any directory containing markdown files
  • Recursively scans subdirectories
  • Maintains directory structure in resource URIs

Frontmatter Support

The generator extracts and preserves frontmatter:

---
title: Getting Started
description: Learn how to get started with our platform
tags: [tutorial, beginner]
---

# Getting Started

Your content here...

This metadata becomes available in the resource response.

Error Handling

  • Missing directories: Gracefully skips missing docs/ or blog/ folders
  • Invalid markdown: Continues processing other files if one fails
  • Permission issues: Error messages for file system problems