A Model Context Protocol (MCP) tool that provides up-to-date documentation for npm packages directly in your IDE. This tool fetches the latest README documentation from either the package's GitHub repository or the README bundled with the npm package itself. This MCP tool helps your IDE (like Cursor) get the most current documentation for any npm package instead of relying on outdated or incomplet
Add this skill
npx mdskills install meanands/npm-package-docs-mcpWell-documented MCP server providing fresh npm package documentation with clear setup and fallback strategy
1# NPM Package Docs MCP23A Model Context Protocol (MCP) tool that provides up-to-date documentation for npm packages directly in your IDE. This tool fetches the latest README documentation from either the package's GitHub repository or the README bundled with the npm package itself.45<a href="https://glama.ai/mcp/servers/@meanands/npm-package-docs-mcp">6 <img width="380" height="200" src="https://glama.ai/mcp/servers/@meanands/npm-package-docs-mcp/badge" alt="NPM Package Docs MCP server" />7</a>89## What it does1011This MCP tool helps your IDE (like Cursor) get the most current documentation for any npm package instead of relying on outdated or incomplete information. It works by:12131. **GitHub Repository First**: If the package has a GitHub repository, it fetches the README directly from the repository's main branch (trying `master`, `main`, or `develop` branches)142. **NPM Package Fallback**: If no GitHub repository is available, it downloads the package tarball and extracts the README file from the bundled package153. **Real-time Updates**: Always gets the latest documentation, ensuring you have the most current information1617## Why this matters1819- **No more guesswork**: Get accurate, up-to-date documentation instead of relying on potentially outdated IDE suggestions20- **Better development experience**: Understand package APIs and usage patterns with current documentation21- **Reduced errors**: Avoid issues caused by using outdated API references or deprecated methods22- **Seamless integration**: Works directly in your IDE through the MCP protocol2324## Tools Provided2526### `get_docs_for_npm_package`2728**Description**: Retrieves the latest documentation for any npm package2930**Parameters**:31- `packageName` (string): The name of the npm package (e.g., "react", "lodash", "express")3233**Returns**: The README content as text, either from the GitHub repository or the package tarball3435**Example Usage**:36```typescript37// In your IDE, you can now ask for documentation like:38// "Show me the docs for express"39// "What's the latest API for react-router-dom?"40// "Get documentation for axios"41```4243## How it Works44451. **Package Lookup**: Queries the npm registry to get package metadata462. **Repository Detection**: Checks if the package has a GitHub repository URL473. **GitHub Fetch**: If available, fetches README.md from the repository's main branch484. **Tarball Extraction**: If no GitHub repo, downloads and extracts the package tarball to find the README495. **Content Return**: Returns the documentation content to your IDE5051## Installation5253### Prerequisites5455- Node.js (v16 or higher)56- Cursor IDE (or any MCP-compatible IDE)5758### Installation5960#### Add to Cursor6162[](https://cursor.com/en/install-mcp?name=npm-package-docs-mcp&config=eyJjb21tYW5kIjoibnB4IG1lYW5hbmRzL25wbS1wYWNrYWdlLWRvY3MtbWNwIn0%3D)6364#### Add manually to Cursor6566 Edit your Cursor MCP configuration file (usually located at `~/.cursor/mcp.json`):6768 ```json69 {70 "mcpServers": {71 "npm-package-docs-mcp": {72 "command": "npx",73 "args": [74 "meanands/npm-package-docs-mcp"75 ]76 }77 }78 }79 ```80815. **Restart Cursor**: Restart Cursor IDE to load the new MCP server8283## Usage8485Once installed, you can use the tool in Cursor by:86871. Opening the command palette (Cmd/Ctrl + Shift + P)882. Typing your request, for example:89 - "Get docs for express"90 - "Show me the latest react documentation"91 - "What's new in lodash v4?"9293The tool will fetch and display the current documentation for the requested package.9495## Development9697### Running in Development Mode9899```bash100npm run dev101```102103### Building for Production104105```bash106npm run build107```108109### Project Structure110111```112npm-docs-mcp/113├── src/114│ ├── server.ts # Main MCP server implementation115│ └── types/116│ └── index.ts # TypeScript type definitions117├── package.json118├── tsconfig.json119└── README.md120```121122## Contributing123124Contributions are welcome! Please feel free to submit a Pull Request.125126## License127128MIT License - see the LICENSE file for details.129130## Support131132If you encounter any issues or have questions, please open an issue on the GitHub repository.
Full transparency — inspect the skill content before installing.