NPM Package Docs MCP
Fetches up-to-date documentation for any npm package directly in your IDE by retrieving README files from GitHub repositories or package tarballs. Provides real-time access to current package documentation and API information.
README
NPM Package Docs MCP
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.
What it does
This 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:
- GitHub Repository First: If the package has a GitHub repository, it fetches the README directly from the repository's main branch (trying
master,main, ordevelopbranches) - NPM Package Fallback: If no GitHub repository is available, it downloads the package tarball and extracts the README file from the bundled package
- Real-time Updates: Always gets the latest documentation, ensuring you have the most current information
Why this matters
- No more guesswork: Get accurate, up-to-date documentation instead of relying on potentially outdated IDE suggestions
- Better development experience: Understand package APIs and usage patterns with current documentation
- Reduced errors: Avoid issues caused by using outdated API references or deprecated methods
- Seamless integration: Works directly in your IDE through the MCP protocol
Tools Provided
get_docs_for_npm_package
Description: Retrieves the latest documentation for any npm package
Parameters:
packageName(string): The name of the npm package (e.g., "react", "lodash", "express")
Returns: The README content as text, either from the GitHub repository or the package tarball
Example Usage:
// In your IDE, you can now ask for documentation like:
// "Show me the docs for express"
// "What's the latest API for react-router-dom?"
// "Get documentation for axios"
How it Works
- Package Lookup: Queries the npm registry to get package metadata
- Repository Detection: Checks if the package has a GitHub repository URL
- GitHub Fetch: If available, fetches README.md from the repository's main branch
- Tarball Extraction: If no GitHub repo, downloads and extracts the package tarball to find the README
- Content Return: Returns the documentation content to your IDE
Installation
Prerequisites
- Node.js (v16 or higher)
- Cursor IDE (or any MCP-compatible IDE)
Installation
Add to Cursor
Add manually to Cursor
Edit your Cursor MCP configuration file (usually located at ~/.cursor/mcp.json):
{
"mcpServers": {
"npm-package-docs-mcp": {
"command": "npx",
"args": [
"meanands/npm-package-docs-mcp"
]
}
}
}
- Restart Cursor: Restart Cursor IDE to load the new MCP server
Usage
Once installed, you can use the tool in Cursor by:
- Opening the command palette (Cmd/Ctrl + Shift + P)
- Typing your request, for example:
- "Get docs for express"
- "Show me the latest react documentation"
- "What's new in lodash v4?"
The tool will fetch and display the current documentation for the requested package.
Development
Running in Development Mode
npm run dev
Building for Production
npm run build
Project Structure
npm-docs-mcp/
├── src/
│ ├── server.ts # Main MCP server implementation
│ └── types/
│ └── index.ts # TypeScript type definitions
├── package.json
├── tsconfig.json
└── README.md
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。