{"id":24125633,"url":"https://github.com/sammcj/mcp-package-docs","last_synced_at":"2025-07-18T01:15:22.009Z","repository":{"id":270188433,"uuid":"909589067","full_name":"sammcj/mcp-package-docs","owner":"sammcj","description":"An MCP server that provides LLMs with efficient access to package documentation across multiple programming languages","archived":false,"fork":false,"pushed_at":"2025-04-23T23:02:43.000Z","size":172,"stargazers_count":73,"open_issues_count":2,"forks_count":17,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T10:47:06.177Z","etag":null,"topics":["ai","docs","documentation","go","javascript","llm","mcp","node","npm","pip","python"],"latest_commit_sha":null,"homepage":"https://smcleod.net","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammcj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["sammcj"],"buy_me_a_coffee":"sam.mcleod"}},"created_at":"2024-12-29T07:02:55.000Z","updated_at":"2025-06-21T10:08:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"e60e6af0-a073-464a-995b-252420e19714","html_url":"https://github.com/sammcj/mcp-package-docs","commit_stats":null,"previous_names":["sammcj/mcp-package-docs"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/sammcj/mcp-package-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammcj%2Fmcp-package-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammcj%2Fmcp-package-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammcj%2Fmcp-package-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammcj%2Fmcp-package-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammcj","download_url":"https://codeload.github.com/sammcj/mcp-package-docs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammcj%2Fmcp-package-docs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265685723,"owners_count":23811198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","docs","documentation","go","javascript","llm","mcp","node","npm","pip","python"],"created_at":"2025-01-11T15:22:05.810Z","updated_at":"2025-07-18T01:15:22.000Z","avatar_url":"https://github.com/sammcj.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sammcj","https://buymeacoffee.com/sam.mcleod"],"categories":["Developer Tools","Content Creation","Developer Tools Mcp Servers"],"sub_categories":["How to Submit"],"readme":"# Package Documentation MCP Server\n\nAn MCP (Model Context Protocol) server that provides LLMs with efficient access to package documentation across multiple programming languages and language server protocol (LSP) capabilities.\n\n**_Note: I am not actively maintaining the codebase at present. While it doesn't provide access to private package documentation - the [Context7](https://github.com/upstash/context7) MCP server and service meets my needs which are mostly for public package documentation. I personally use Context7 via my [mcp-devtools](https://github.com/sammcj/mcp-devtools) MCP server which is actively maintained._**\n\n## Features\n\n- **Multi-Language Support**:\n  - Go packages via `go doc`\n  - Python libraries via built-in `help()`\n  - NPM packages via registry documentation (including private registries)\n  - Rust crates via crates.io and docs.rs\n\n- **Smart Documentation Parsing**:\n  - Structured output with description, usage, and examples\n  - Focused information to avoid context overload\n  - Support for specific symbol/function lookups\n  - Fuzzy and exact search capabilities across documentation\n\n- **Advanced Search Features**:\n  - Search within package documentation\n  - Fuzzy matching for flexible queries\n  - Context-aware results with relevance scoring\n  - Symbol extraction from search results\n\n- **Language Server Protocol (LSP) Support**:\n  - Hover information for code symbols\n  - Code completions\n  - Diagnostics (errors and warnings)\n  - Currently supports TypeScript/JavaScript\n  - Extensible for other languages\n\n- **Performance Optimised**:\n  - Built-in caching\n  - Efficient parsing\n  - Minimal memory footprint\n\n## Installation\n\nNote: I do not recommend using `npx -y` to run your MCP servers in production as you're esentially trusting whatever package you're downloading off the internet at that moment in time. I highly recommend cloning the repository locally or building into a container image.\n\n```bash\nnpx -y mcp-package-docs\n```\n\n## Usage\n\n### As an MCP Server\n\n1. Add to your MCP settings configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"package-docs\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-package-docs\"],\n      \"env\": {\n        \"ENABLE_LSP\": \"true\" // Optional: Enable Language Server Protocol support\n      }\n    }\n  }\n}\n```\n\n2. The LSP functionality includes default configurations for common language servers:\n\n- TypeScript/JavaScript: `typescript-language-server --stdio`\n- HTML: `vscode-html-language-server --stdio`\n- CSS: `vscode-css-language-server --stdio`\n- JSON: `vscode-json-language-server --stdio`\n\nYou can override these defaults if needed:\n\n```json\n{\n  \"mcpServers\": {\n    \"package-docs\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-package-docs\"],\n      \"env\": {\n        \"ENABLE_LSP\": \"true\",\n        \"TYPESCRIPT_SERVER\": \"{\\\"command\\\":\\\"/custom/path/typescript-language-server\\\",\\\"args\\\":[\\\"--stdio\\\"]}\"\n      }\n    }\n  }\n}\n```\n\n3. The server provides the following tools:\n\n#### lookup_go_doc / describe_go_package\n\nFetches Go package documentation\n```typescript\n{\n  \"name\": \"describe_go_package\",\n  \"arguments\": {\n    \"package\": \"encoding/json\", // required\n    \"symbol\": \"Marshal\"        // optional\n  }\n}\n```\n\n#### lookup_python_doc / describe_python_package\n\nFetches Python package documentation\n```typescript\n{\n  \"name\": \"describe_python_package\",\n  \"arguments\": {\n    \"package\": \"requests\",    // required\n    \"symbol\": \"get\"          // optional\n  }\n}\n```\n\n#### describe_rust_package\n\nFetches Rust crate documentation from crates.io and docs.rs\n```typescript\n{\n  \"name\": \"describe_rust_package\",\n  \"arguments\": {\n    \"package\": \"serde\",      // required: crate name\n    \"version\": \"1.0.219\"     // optional: specific version\n  }\n}\n```\n\n#### search_package_docs\n\nSearch within package documentation\n```typescript\n{\n  \"name\": \"search_package_docs\",\n  \"arguments\": {\n    \"package\": \"requests\",    // required: package name\n    \"query\": \"authentication\", // required: search query\n    \"language\": \"python\",     // required: \"go\", \"python\", \"npm\", \"swift\", or \"rust\"\n    \"fuzzy\": true            // optional: enable fuzzy matching (default: true)\n  }\n}\n```\n\n#### lookup_npm_doc / describe_npm_package\n\nFetches NPM package documentation from both public and private registries. Automatically uses the appropriate registry based on your .npmrc configuration.\n\n```typescript\n{\n  \"name\": \"describe_npm_package\",\n  \"arguments\": {\n    \"package\": \"axios\",      // required - supports both scoped (@org/pkg) and unscoped packages\n    \"version\": \"1.6.0\"       // optional\n  }\n}\n```\n\nThe tool reads your ~/.npmrc file to determine the correct registry for each package:\n\n- Uses scoped registry configurations (e.g., @mycompany:registry=...)\n- Supports private registries (GitHub Packages, GitLab, Nexus, Artifactory, etc.)\n- Falls back to the default npm registry if no custom registry is configured\n\nExample .npmrc configurations:\n\n```npmrc\nregistry=https://nexus.mycompany.com/repository/npm-group/\n@mycompany:registry=https://nexus.mycompany.com/repository/npm-private/\n@mycompany-ct:registry=https://npm.pkg.github.com/\n```\n\n### Language Server Protocol (LSP) Tools\n\nWhen LSP support is enabled, the following additional tools become available:\n\n#### get_hover\n\nGet hover information for a position in a document\n```typescript\n{\n  \"name\": \"get_hover\",\n  \"arguments\": {\n    \"languageId\": \"typescript\", // required: language identifier (e.g., \"typescript\", \"javascript\")\n    \"filePath\": \"src/index.ts\", // required: path to the source file\n    \"content\": \"const x = 1;\",  // required: content of the file\n    \"line\": 0,                  // required: zero-based line number\n    \"character\": 6,             // required: zero-based character position\n    \"projectRoot\": \"/path/to/project\" // optional: project root directory\n  }\n}\n```\n\n#### get_completions\n\nGet completion suggestions for a position in a document\n```typescript\n{\n  \"name\": \"get_completions\",\n  \"arguments\": {\n    \"languageId\": \"typescript\", // required: language identifier\n    \"filePath\": \"src/index.ts\", // required: path to the source file\n    \"content\": \"const arr = []; arr.\",  // required: content of the file\n    \"line\": 0,                  // required: zero-based line number\n    \"character\": 16,            // required: zero-based character position\n    \"projectRoot\": \"/path/to/project\" // optional: project root directory\n  }\n}\n```\n\n#### get_diagnostics\n\nGet diagnostic information (errors, warnings) for a document\n```typescript\n{\n  \"name\": \"get_diagnostics\",\n  \"arguments\": {\n    \"languageId\": \"typescript\", // required: language identifier\n    \"filePath\": \"src/index.ts\", // required: path to the source file\n    \"content\": \"const x: string = 1;\",  // required: content of the file\n    \"projectRoot\": \"/path/to/project\" // optional: project root directory\n  }\n}\n```\n\n### Example Usage in an LLM\n\n#### Looking up Documentation\n\n```typescript\n// Looking up Go documentation\nconst goDocResult = await use_mcp_tool({\n  server_name: \"package-docs\",\n  tool_name: \"describe_go_package\",\n  arguments: {\n    package: \"encoding/json\",\n    symbol: \"Marshal\"\n  }\n});\n\n// Looking up Python documentation\nconst pythonDocResult = await use_mcp_tool({\n  server_name: \"package-docs\",\n  tool_name: \"describe_python_package\",\n  arguments: {\n    package: \"requests\",\n    symbol: \"post\"\n  }\n});\n\n// Looking up Rust documentation\nconst rustDocResult = await use_mcp_tool({\n  server_name: \"package-docs\",\n  tool_name: \"describe_rust_package\",\n  arguments: {\n    package: \"serde\"\n  }\n});\n\n// Searching within documentation\nconst searchResult = await use_mcp_tool({\n  server_name: \"package-docs\",\n  tool_name: \"search_package_docs\",\n  arguments: {\n    package: \"serde\",\n    query: \"serialize\",\n    language: \"rust\",\n    fuzzy: true\n  }\n});\n\n// Using LSP for hover information (when LSP is enabled)\nconst hoverResult = await use_mcp_tool({\n  server_name: \"package-docs\",\n  tool_name: \"get_hover\",\n  arguments: {\n    languageId: \"typescript\",\n    filePath: \"src/index.ts\",\n    content: \"const axios = require('axios');\\naxios.get\",\n    line: 1,\n    character: 7\n  }\n});\n```\n\n## Requirements\n\n- Node.js \u003e= 20\n- Go (for Go package documentation)\n- Python 3 (for Python package documentation)\n- Internet connection (for NPM package documentation and Rust crate documentation)\n- Language servers (for LSP functionality):\n  - TypeScript/JavaScript: `npm install -g typescript-language-server typescript`\n  - HTML/CSS/JSON: `npm install -g vscode-langservers-extracted`\n\n## Development\n\n```bash\n# Install dependencies\nnpm i\n\n# Build\nnpm run build\n\n# Watch mode\nnpm run watch\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammcj%2Fmcp-package-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammcj%2Fmcp-package-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammcj%2Fmcp-package-docs/lists"}