软件包文档 MCP 服务器
MCP(模型上下文协议)服务器为 LLM 提供跨多种编程语言和语言服务器协议 (LSP) 功能对包文档的有效访问。
特征
- 多语言支持:
- 通过
go doc
获取 Go 软件包 - 通过内置
help()
Python 库 - 通过注册表文档(包括私有注册表)的 NPM 包
- 通过 crates.io 和 docs.rs 获取 Rust 板条箱
- 通过
- 智能文档解析:
- 包含描述、用法和示例的结构化输出
- 重点突出的信息,避免上下文过载
- 支持特定符号/函数查找
- 跨文档的模糊和精确搜索功能
- 高级搜索功能:
- 在包文档中搜索
- 模糊匹配,灵活查询
- 具有相关性评分的上下文感知结果
- 从搜索结果中提取符号
- 语言服务器协议(LSP)支持:
- 代码符号的悬停信息
- 代码补全
- 诊断(错误和警告)
- 目前支持 TypeScript/JavaScript
- 可扩展至其他语言
- 性能优化:
- 内置缓存
- 高效解析
- 最小内存占用
安装
通过 Smithery 安装
要通过Smithery自动安装 Claude Desktop 的 Package Docs:
用法
作为 MCP 服务器
- 添加到您的 MCP 设置配置:
- LSP 功能包括通用语言服务器的默认配置:
- TypeScript/JavaScript:
typescript-language-server --stdio
- HTML:
vscode-html-language-server --stdio
- CSS:
vscode-css-language-server --stdio
- JSON:
vscode-json-language-server --stdio
如果需要,您可以覆盖这些默认值:
- 该服务器提供以下工具:
lookup_go_doc / describe_go_package
获取 Go 包文档
lookup_python_doc / describe_python_package
获取 Python 包文档
describe_rust_package
从 crates.io 和 docs.rs 获取 Rust crate 文档
搜索包文档
在包文档中搜索
lookup_npm_doc / describe_npm_package
从公共和私有注册表获取 NPM 包文档。根据您的 .npmrc 配置自动使用适当的注册表。
该工具读取您的 ~/.npmrc 文件以确定每个包的正确注册表:
- 使用范围注册表配置(例如,@mycompany:registry = ...)
- 支持私有注册表(GitHub Packages、GitLab、Nexus、Artifactory 等)
- 如果没有配置自定义注册表,则回退到默认 npm 注册表
.npmrc 配置示例:
语言服务器协议 (LSP) 工具
启用 LSP 支持后,以下附加工具将可用:
获取悬停
获取文档中某个位置的悬停信息
获取完成信息
获取文档中某个位置的完成建议
获取诊断
获取文档的诊断信息(错误、警告)
LLM 中的使用示例
查找文档
要求
- Node.js >= 20
- Go(用于 Go 包文档)
- Python 3(用于 Python 包文档)
- 互联网连接(用于 NPM 包文档和 Rust 包文档)
- 语言服务器(用于 LSP 功能):
- TypeScript/JavaScript:
npm install -g typescript-language-server typescript
- HTML/CSS/JSON:
npm install -g vscode-langservers-extracted
- TypeScript/JavaScript:
发展
贡献
- 分叉存储库
- 创建你的功能分支(
git checkout -b feature/amazing-feature
) - 提交您的更改(
git commit -m 'Add some amazing feature'
) - 推送到分支(
git push origin feature/amazing-feature
) - 打开拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
帮助 LLM 高效访问和获取 Go、Python 和 NPM 中包的结构化文档,通过多语言支持和性能优化增强软件开发。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityFacilitates searching and accessing programming resources across platforms like Stack Overflow, MDN, GitHub, npm, and PyPI, aiding LLMs in finding code examples and documentation.Last updated -625JavaScriptAGPL 3.0
- AsecurityAlicenseAqualityFetches and extracts comprehensive package documentation from multiple programming language ecosystems (JavaScript, Python, Java, etc.) for LLMs like Claude without requiring API keys.Last updated -4510JavaScriptMIT License
- AsecurityFlicenseAqualityAn MCP server that enables LLMs to understand and analyze code structure through function call graphs, allowing AI assistants to explore relationships between functions and analyze dependencies in Python repositories.Last updated -67Python
- -securityFlicense-qualityA customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.Last updated -Python
Appeared in Searches
- Documentation for a software or library
- Information about Rust programming language or rust corrosion
- How to find technical documentation for third-party libraries or services
- Tool to automate generating project documentation based on user input
- A server/tool for RAG-based documentation scraping and retrieval with SSE support