Query latest package versions from PyPI, npm, crates.io, Docker Hub, and GitHub Actions
Project description
package-query
Query the latest package versions from PyPI, npm, crates.io, Docker Hub, and GitHub Actions — directly from Python or as an MCP server for AI agents.
Installation
# Core library only
uv pip install package-query
# With MCP server support
uv pip install "package-query[mcp]"
Python Usage
import asyncio
from package_query import PackageQuery, PackageInfo
async def main():
pq = PackageQuery()
info: PackageInfo = await pq.query("pypi", "requests")
print(f"{info.name}=={info.version}")
info = await pq.query("npm", "express")
print(f"{info.name}=={info.version}")
info = await pq.query("github-actions", "actions/checkout")
print(f"{info.name}=={info.version}")
asyncio.run(main())
Supported Registries
| Registry | Example Package |
|---|---|
pypi |
requests |
npm |
express |
crates |
serde |
docker |
nginx |
github-actions |
actions/checkout |
MCP Server
The MCP server allows AI agents (Claude, Copilot, Cursor, etc.) to query package versions without web search.
Running the Server
# If installed with [mcp] extra
package-query-mcp
# Or from source
uv run --extra mcp package-query-mcp
IDE Configuration
VS Code / Cursor
Add to your settings.json:
{
"mcp": {
"servers": {
"package-query": {
"command": "uvx",
"args": ["--from", "package-query[mcp]", "package-query-mcp"]
}
}
}
}
Or if installed globally:
{
"mcp": {
"servers": {
"package-query": {
"command": "package-query-mcp"
}
}
}
}
Claude Desktop
Add to ~/.config/Claude/claude_desktop_config.json (Linux) or equivalent:
{
"mcpServers": {
"package-query": {
"command": "uvx",
"args": ["--from", "package-query[mcp]", "package-query-mcp"]
}
}
}
Antigravity IDE
Add to ~/.gemini/antigravity/mcp_config.json:
{
"mcpServers": {
"package-query": {
"command": "uvx",
"args": ["--from", "package-query[mcp]", "package-query-mcp"]
}
}
}
Available Tools
| Tool | Description |
|---|---|
get_package_version |
Get the latest version of a package |
Parameters:
registry(string): One ofpypi,npm,crates,docker,github-actionspackage(string): Package nameinclude_prerelease(bool, optional): Include pre-release versions
Development
# Clone and install all dependencies
git clone https://github.com/henrique-coder/package-query.git
cd package-query
uv sync --upgrade --all-groups --all-extras
just lint
just format
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file package_query-0.1.0.tar.gz.
File metadata
- Download URL: package_query-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
016007fa728f5f2409f13f7d9d87c7c14397809a186a2fb58ebe8b82fb96810f
|
|
| MD5 |
0f7a7e13ebe31e4223e0294232b3adb8
|
|
| BLAKE2b-256 |
5a74b4b4d17d882218b3b8acf649b624317a2271fe29689a27c0b26a23cda324
|
File details
Details for the file package_query-0.1.0-py3-none-any.whl.
File metadata
- Download URL: package_query-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fb81ca969d49c0def7ff19bae5ecb156f4ee53af4096b29d1138e35fc8b307e
|
|
| MD5 |
73527e83e6e144c4c68d3900fafa5118
|
|
| BLAKE2b-256 |
b16d3d3a19add196971f8e80084aa6a2e17883748711ab19c792abf82b5cb5f0
|