AI-powered semantic search over React documentation for Claude, Cursor, and other MCP clients.
claude mcp add --transport stdio react-docs -- npx react-docs-mcp
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"]
}
}
}
Settings β Cursor settings β Tools and MCP β Add server:
{
"mcpServers": {
"react-docs": {
"command": "npx",
"args": ["-y", "react-docs-mcp"]
}
}
}
That's it! Restart your editor and ask about React.
- π 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
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"]
}
}
}
Add to your MCP settings configuration:
{
"mcpServers": {
"react-docs": {
"command": "node",
"args": ["/absolute/path/to/reactDocsMcp/dist/index.js"]
}
}
}
Once configured, the server provides the following capabilities to AI agents:
Search across React documentation.
Parameters:
query
(required): Search query stringsection
(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 a specific documentation page.
Parameters:
path
(required): Document path (e.g., "learn/hooks/useState")
Example:
Get the useState documentation
List all available documentation sections.
Example:
What sections are available?
Pull latest documentation from the Git repository.
Example:
Update the React documentation
The server exposes documentation as resources with the URI pattern:
react-docs://{section}/{path}
Examples:
react-docs://learn
- List all learn section docsreact-docs://learn/hooks/useState
- Get useState documentationreact-docs://reference/react/Component
- Get Component API reference
npm run dev
npm run build
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
- Initialization: On first run, clones the official React documentation repository
- Indexing: Parses all markdown files and builds an in-memory search index
- Search: Provides keyword-based search with relevance scoring
- Updates: Can pull latest changes from the repository and re-index
- 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
- The repository may still be cloning (check console output)
- Try running
update_docs
tool to refresh the index
- Check internet connection
- Verify Git is installed and accessible
- Check firewall/proxy settings
For detailed technical information, see TECHNICAL_SPEC.md.
MIT
This is a personal project for connecting React documentation to AI coding agents. Feel free to fork and modify for your own use.