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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-docs-mcp

v1.0.6

Published

MCP server providing AI agents with semantic search over React documentation

Readme

React Docs MCP Server

AI-powered semantic search over React documentation for Claude, Cursor, and other MCP clients.

🚀 Installation (One Command)

Claude Code

claude mcp add --transport stdio react-docs -- npx react-docs-mcp

Claude Desktop

Edit: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "react-docs": {
      "command": "npx",
      "args": ["-y", "react-docs-mcp"]
    }
  }
}

Cursor

SettingsCursor settingsTools and MCP → Add server:

{
  "mcpServers": {
    "react-docs": {
      "command": "npx",
      "args": ["-y", "react-docs-mcp"]
    }
  }
}

That's it! Restart your editor and ask about React.


Features

  • 🔍 Semantic Search: AI-powered search using embeddings for conceptual matches
  • ⚡ Fast Results: In-memory vector search with hybrid keyword+semantic ranking
  • 📦 Zero Config: Works with npx - no installation needed
  • 🤖 Local AI: Runs embeddings locally (no API costs)
  • 📝 Concise Responses: Returns summaries instead of full documentation
  • 🔄 Auto-sync: Pulls latest docs from react.dev automatically

Configuration

For Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "react-docs": {
      "command": "node",
      "args": ["/absolute/path/to/reactDocsMcp/dist/index.js"]
    }
  }
}

For Claude Code

Add to your MCP settings configuration:

{
  "mcpServers": {
    "react-docs": {
      "command": "node",
      "args": ["/absolute/path/to/reactDocsMcp/dist/index.js"]
    }
  }
}

Usage

Once configured, the server provides the following capabilities to AI agents:

Tools

search_react_docs

Search across React documentation.

Parameters:

  • query (required): Search query string
  • section (optional): Filter by section (learn, reference, blog, community)
  • limit (optional): Maximum number of results (default: 10, max: 50)

Example:

Search for "useState hook" in the learn section

get_doc

Get a specific documentation page.

Parameters:

  • path (required): Document path (e.g., "learn/hooks/useState")

Example:

Get the useState documentation

list_sections

List all available documentation sections.

Example:

What sections are available?

update_docs

Pull latest documentation from the Git repository.

Example:

Update the React documentation

Resources

The server exposes documentation as resources with the URI pattern:

react-docs://{section}/{path}

Examples:

  • react-docs://learn - List all learn section docs
  • react-docs://learn/hooks/useState - Get useState documentation
  • react-docs://reference/react/Component - Get Component API reference

Development

Run in Development Mode

npm run dev

Build

npm run build

Project Structure

reactDocsMcp/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── docsManager.ts        # Git & file operations
│   ├── markdownParser.ts     # Markdown parsing
│   ├── searchEngine.ts       # Search implementation
│   ├── types.ts              # TypeScript types
│   └── config.ts             # Configuration
├── dist/                     # Compiled output
└── TECHNICAL_SPEC.md         # Technical documentation

How It Works

  1. Initialization: On first run, clones the official React documentation repository
  2. Indexing: Parses all markdown files and builds an in-memory search index
  3. Search: Provides keyword-based search with relevance scoring
  4. Updates: Can pull latest changes from the repository and re-index

Troubleshooting

Server won't start

  • Ensure Node.js 18+ is installed
  • Check that the build completed successfully (npm run build)
  • Verify the path in your MCP configuration is absolute and correct

No search results

  • The repository may still be cloning (check console output)
  • Try running update_docs tool to refresh the index

Git clone fails

  • Check internet connection
  • Verify Git is installed and accessible
  • Check firewall/proxy settings

Technical Details

For detailed technical information, see TECHNICAL_SPEC.md.

License

MIT

Contributing

This is a personal project for connecting React documentation to AI coding agents. Feel free to fork and modify for your own use.