软件包文档 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 --stdioHTML:
vscode-html-language-server --stdioCSS:
vscode-css-language-server --stdioJSON:
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 typescriptHTML/CSS/JSON:
npm install -g vscode-langservers-extracted
发展
贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
帮助 LLM 高效访问和获取 Go、Python 和 NPM 中包的结构化文档,通过多语言支持和性能优化增强软件开发。
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityFacilitates 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 -639AGPL 3.0
- Asecurity-licenseAqualityFetches and extracts comprehensive package documentation from multiple programming language ecosystems (JavaScript, Python, Java, etc.) for LLMs like Claude without requiring API keys.Last updated -41615MIT License
- -security-license-qualityA server that provides structured access to markdown documentation from NPM packages, Go Modules, or PyPi packages, enabling informed code generation by exposing these docs as resources or tools.
- -security-license-qualityFetches up-to-date, version-specific documentation and code examples from the source and adds them to your LLM prompts, helping eliminate outdated code generations and hallucinated APIs.
Appeared in Searches
- A service for finding the latest API documentation
- MCP Server that uses npm execAsync functionality
- Tips for Naming Variables and Functions in Go Programming Language
- An MCP for managing documentation, optimizing token usage, and overseeing project development to deployment
- Tools and resources for Python development