Read Docs MCP
About
Enables AI agents to access and understand package documentation from local or remote repositories.
Details
- Author
- ZebraRoy
- Downloads
- 352
- Categories
- Developer Tools, Knowledge Base, Other
Jump to
- Dual usage modes: read existing documentation or create documentation structure
- Automatically generates MCP tools from documentation structure
- Supports multiple documentation modules (hooks, components, utilities, etc.)
- Configurable naming patterns for documentation files and module folders
- Provides listing, overview, and detailed documentation access per module
- Falls back to package.json for version information when not specified in config
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Read Docs MCPCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
read-docs-mcp is invoked via npx -y read-docs-mcp with optional command-line arguments such as --name, --git-repo-path, --branch, --docs-path, and --clone-location. It can be configured in Cursor by adding a JSON block to the Cursor settings under mcpServers. For Read Documentation Mode, provide both --name and --git-repo-path; omit them to use Create Documentation Mode.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"read docs mcp": {
"read-docs-{name}": {
"command": "npx",
"args": [
"-y",
"read-docs-mcp",
"--git-repo-path=https://github.com/user/repo",
"--name=YourLibName"
]
}
}
}
}
McpServers
{
"read-docs-{name}": {
"command": "npx",
"args": [
"-y",
"read-docs-mcp",
"--git-repo-path=https://github.com/user/repo",
"--name=YourLibName"
]
}
}
A Model Context Protocol (MCP) server that enables AI agents to access and understand package documentation through a structured interface.
- Automatically generates MCP tools from documentation structure
- Supports multiple documentation modules (hooks, components, utilities, etc.)
- Configurable naming patterns for documentation files and module folders
- Provides listing, overview, and detailed documentation access
- Dynamic tool generation based on configured modules
- Fallback to package.json for version information
- Customizable documentation path
- Fuzzy search capability to find files by keyword with smart prioritization
This MCP server has two distinct usage modes:
-
Read Documentation Mode(read-docs-{name}): When bothnameandgit-repo-pathare provided, the server functions as a document reader for the specified repository, generating tools to access the documentation.
Create Documentation Mode(create-read-docs): When no repository information is provided, the server functions as a guide for creating documentation structure, providing instructions on how to set up documentation files.
The MCP supports the following command-line arguments:
- --name: Name of the package/library (required for Read Documentation Mode)
- --git-repo-path: Path to the git repository (http or ssh) (required for Read Documentation Mode)
- If not provided, the MCP server will only provide construction instructions
- Recommended for private repositories
- Supports GitHub, GitLab, Bitbucket, and generic Git hosting
- Options:normal(default),two-step
- SeeOperating Modessection for details
- Set totrueto enable reading source files from the repository
- Default:false
- When enabled, adds a tool to read source code files for additional implementation details
This MCP requires direct cloning of the target git repository. You must ensure you have proper access to the repository before using this tool. For private repositories, you have several authentication options:
- Using Personal Access Token (Recommended): Pass your personal access token using the--personal-tokenargument. This is the most reliable method and works with all major Git hosting providers.
- SSH Keys: Configure SSH keys on your local machine for SSH URLs
- Git Credential Storage: Configure Git credential storage on your machine for HTTPS URLs
# With HTTPS URL npx -y read-docs-mcp --name=MyDocs --git-repo-path=https://github.com/user/private-repo --personal-token=your_personal_access_token_here # With SSH URL (automatically converted to HTTPS) npx -y read-docs-mcp --name=MyDocs --git-repo-path=git@gitlab.service-hub.tech:frontend/private-repo.git --personal-token=your_personal_access_token_here
The MCP supports personal access tokens for both HTTPS and SSH URLs:
- GitHub: Uses the token directly in the HTTPS URL
- GitLab(including self-hosted): Uses OAuth2 format with the token
- Bitbucket: Uses token-auth format
- Generic Git Hosting: Uses OAuth2 format (GitLab-style)
SSH URLs:When a personal token is provided, SSH URLs are automatically converted to HTTPS with proper authentication:
- SSH:git@gitlab.service-hub.tech:frontend/repo.git
- HTTPS:https://oauth2:token@gitlab.service-hub.tech/frontend/repo.git
Without proper authentication, the MCP will fail to clone private repositories.
You can specify different modes when running the MCP server using the --mode argument:
npx -y read-docs-mcp --name=MyDocs --git-repo-path=https://github.com/user/repo # or explicitly: npx -y read-docs-mcp --name=MyDocs --git-repo-path=https://github.com/user/repo --mode=normal
In normal mode, the server creates individual tools for each module and operation (e.g., get-hooks-list, get-hooks-details, get-components-list, etc.).
npx -y read-docs-mcp --name=MyDocs --git-repo-path=https://github.com/user/repo --mode=two-step
In two-step mode, instead of creating individual tools for each module, the server creates these 5 generic tools:
- get-overview- Get overview of the project (same as normal mode)
- get-overall-list- Get a list of all available modules
- get-module-overview- Get overview of a specific module (takes module name as parameter)
- get-module-list- Get list of items in a specific module (takes module name as parameter)
- get-module-detail- Get details of a specific item in a module (takes module and item name as parameters)
This approach reduces the total number of tools significantly when you have many modules, making the MCP server more efficient and easier to manage.
To use this MCP in Cursor, add the following configuration to your Cursor settings:
{ "mcpServers": { "read-docs-{name}": { "command": "npx", "args": [ "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/repo", "--name=YourLibName" ] } } }
Read Documentation Mode with Source Access (Mac/Linux)
{ "mcpServers": { "read-docs-{name}": { "command": "npx", "args": [ "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/repo", "--name=YourLibName", "--include-src=true" ] } } }
{ "mcpServers": { "create-read-docs": { "command": "npx", "args": ["-y", "read-docs-mcp"] } } }
{ "mcpServers": { "read-docs-{name}": { "command": "cmd", "args": [ "/c", "npx", "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/repo", "--name=YourLibName" ] } } }
Read Documentation Mode with Source Access (Windows)
{ "mcpServers": { "read-docs-{name}": { "command": "cmd", "args": [ "/c", "npx", "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/repo", "--name=YourLibName", "--include-src=true" ] } } }
{ "mcpServers": { "create-read-docs": { "command": "cmd", "args": ["/c", "npx", "-y", "read-docs-mcp"] } } }
If you want to specify a custom documentation directory:
{ "mcpServers": { "read-docs-{name}": { "command": "npx", "args": [ "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/repo", "--name=YourLibName", "--docs-path=documentation" ] } } }
To use two-step mode for better efficiency with large documentation sets:
{ "mcpServers": { "read-docs-{name}": { "command": "npx", "args": [ "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/repo", "--name=YourLibName", "--mode=two-step" ] } } }
To access private repositories using a personal access token:
{ "mcpServers": { "read-docs-{name}": { "command": "npx", "args": [ "-y", "read-docs-mcp", "--git-repo-path=https://github.com/user/private-repo", "--name=YourLibName", "--personal-token=your_personal_access_token_here" ] } } }
For self-hosted GitLab instances using SSH URLs:
{ "mcpServers": { "read-docs-{name}": { "command": "npx", "args": [ "-y", "read-docs-mcp", "--git-repo-path=git@gitlab.some-host.com:some-group/your-repo.git", "--name=YourLibName", "--personal-token=your_gitlab_access_token_here" ] } } }
Security Note: Store your personal access token securely. Consider using environment variables instead of hardcoding the token in your configuration.
The MCP server expects the following structure for Read Documentation Mode:
repository/ ├── docs/ (configurable) │ ├── read-docs-mcp.json │ ├── hooks/ │ │ ├── read-module-docs-mcp.json │ │ ├── list.md │ │ ├── overview.md │ │ ├── use-state.md │ │ └── ... │ ├── components/ │ │ ├── read-module-docs-mcp.json │ │ └── ... │ └── ... └── package.json
{ "name": "SomeLibrary", "description": "A library for some purpose", "version": "1.0.1", "moduleList": ["hooks", "components", "directives", "utils"], "fileName": "overview.md", "moduleFolderNamingPattern": "kebab" }
- name,description: Used in MCP server construction
- version: If not provided, falls back to version in package.json, or defaults to "0.1.0"
- moduleList: List of documentation modules; if not provided, all folders in the docs directory are used
- fileName: The file to use for the overview. If not provided, defaults to "overview.md"
- moduleFolderNamingPattern: Naming pattern for module folders. Can be "kebab", "camel", "snake", "pascal", or "original". Default is "kebab"
The following naming patterns are supported for module folders and detail files:
-
kebab-case(default): Words are lowercase and separated by hyphens
- Example: "form-control", "use-state", "data-table"
camelCase: First word is lowercase, subsequent words are capitalized with no separators
- Example: "formControl", "useState", "dataTable"
snake_case: Words are lowercase and separated by underscores
- Example: "form_control", "use_state", "data_table"
PascalCase: Each word is capitalized with no separators
- Example: "FormControl", "UseState", "DataTable"
original: Uses the name exactly as provided in the moduleList, with no conversion
- Example: Names in moduleList will be used as-is for directory names
Module Configuration: read-module-docs-mcp.json
{ "get-all": { "name": "get-hook-list", "description": "Get a list of hooks", "fileName": "list.md" }, "get-details": { "name": "get-hook-details", "description": "Get details of a hook", "paramDescription": "A hook name", "namingPattern": "kebab" }, "get-overview": { "name": "get-hook-overview", "description": "Get an overview of the hook module", "fileName": "overview.md" } }
When you have set up the MCP server with a repository, you can use it to explore documentation:
Using the read-docs-{YourLibName} MCP, I'd like to explore the documentation for {YourLibName}. Can you: 1. Get an overview of the available modules 2. Show me the list of hooks available 3. Provide details on a specific hook 4. Give me an overview of the components module
When you use the MCP server without a repository, you can ask for help creating documentation:
Using the create-read-docs MCP, I need to create documentation for my library that can be used with read-docs-mcp. Can you help me set up the required structure and files?
Example Prompts for Read Documentation Mode
Using the read-docs-{PackageName} MCP, I'd like to explore the documentation for [Package Name]. Can you: 1. Get an overview of the available modules 2. Show me the list of hooks available 3. Provide details on the useAuth hook 4. Give me an overview of the components module I'm particularly interested in understanding how authentication works in this library.
Using the read-docs-{PackageName} MCP, I need to implement a form with validation using the [Package Name] library. Please: 1. Show me the available components 2. Get details on the Form component 3. Get details on the Input component 4. Explain how to use form validation with these components If there are any code examples in the documentation, please highlight those.
Using the read-docs-{PackageName} MCP, I'm looking for documentation about authentication in the library. Can you: 1. Use fuzzy search to find all files related to "auth" 2. Based on the search results, get the details for the most relevant authentication documentation 3. Show me how to implement authentication using the library The fuzzy search should help us quickly locate the relevant documentation files.
Reading Source Code for Implementation Details
Using the read-docs-{PackageName} MCP (configured with --include-src=true), I need to understand how the useAuth hook is implemented. Please: 1. First, get the documentation details for the useAuth hook 2. Based on the documentation, read the source code file for useAuth to understand the implementation 3. Explain how the authentication flow works based on both the documentation and source code Remember to prioritize the documentation first, then use source code only for additional implementation details.
Example Prompts for Create Documentation Mode
Using the create-read-docs MCP, I need to set up documentation for my React component library. Can you help me create the folder structure and necessary configuration files?
Using the create-read-docs MCP, I've started creating documentation for my utility functions. How should I structure the detailed documentation for individual utility functions?
The MCP dynamically generates tools based on the documentation structure and operating mode. All tools are prefixed with the package name to avoid conflicts when multiple read-docs-mcp instances are used.
In normal mode, for each module in themoduleList, up to three tools can be generated, plus an optional source file reading tool:
- Content of the list file (default:list.md)
Get details about a specific item in the module.
- name(string): Name of the item to get details for
- Content of the details file, named according to thenamingPattern(default is kebab-case)
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





