Skip to main content
Glama
packagist-mcp

packagist-mcp

by Ankur1911

packagist-mcp

A Model Context Protocol server for Packagist, the main registry for PHP and Composer packages. It needs no API key and is read-only.

The tools are shaped around common dependency questions rather than one tool per endpoint. get_package merges three endpoints (package metadata, download counts, security advisories) into one trimmed profile instead of the 200 KB raw package document. audit_requirements takes a whole composer.json and reports, per package, the latest stable release, the newest release your constraint allows, whether an update is blocked by a major version, abandoned status with the replacement, and known advisories that affect the version you would actually get. Packagist's minified version metadata is expanded for you, and Composer constraint syntax (^, ~, wildcards, ranges, ||) is evaluated locally.

Setup

Requires Python 3.12+ and uv.

git clone https://github.com/Ankur1911/packagist-mcp && cd packagist-mcp
uv sync
uv run packagist-mcp          # stdio transport

Add it to any MCP client that launches stdio servers:

{
  "mcpServers": {
    "packagist": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/packagist-mcp", "packagist-mcp"]
    }
  }
}

For HTTP instead of stdio: MCP_TRANSPORT=streamable-http MCP_HOST=127.0.0.1 MCP_PORT=8000 uv run packagist-mcp.

Related MCP server: Dependency Health MCP

Tools

All tools are read-only.

Tool

What it returns

search_packages

Keyword search with optional type and tags filters: name, short description, repository, downloads, favourites, abandoned flag (or replacement). Paged.

get_package

One-call profile: latest stable version with date and age, newer pre-release if any, abandoned status and replacement, licence, keywords, repository and support links, PHP and extension requirements, runtime dependencies, download totals, version counts, and security advisories (total, those affecting the latest stable release, most recent).

list_versions

Release history, newest first: version, date, PHP constraint, and the IDs of advisories that affect that exact version. Pre-releases hidden unless requested.

get_dependencies

Requirements of one version (latest stable by default): PHP and extensions, runtime packages, conflicts, replaces, provides; extended=true adds require-dev and suggest.

security_advisories

Advisories for 1 to 100 packages in one call. Write vendor/name@2.9.0 to split results into those affecting that version and a count of the rest.

audit_requirements

Audit a whole composer.json (text or object) or a {package: constraint} mapping. Problem packages come first; platform requirements (php, ext-*) are listed separately; include_dev adds require-dev.

download_stats

Total, monthly and daily counts plus a series (monthly or daily, all versions or one version).

list_packages

Package names for a vendor (symfony) or a Composer type (phpstan-extension), with repository and abandoned flag.

Configuration

All optional environment variables:

Variable

Default

Meaning

PACKAGIST_BASE_URL

https://packagist.org

Packagist API root (for a mirror)

PACKAGIST_REPO_URL

https://repo.packagist.org

Composer metadata host

PACKAGIST_TIMEOUT

20

Request timeout in seconds

PACKAGIST_RETRIES

2

Retries on HTTP 429, 502, 503, 504 and timeouts

PACKAGIST_CONCURRENCY

4

Maximum simultaneous requests

PACKAGIST_CACHE_TTL

300

Seconds to cache identical requests in memory (0 disables)

PACKAGIST_MAX_CHARS

20000

Responses longer than this are cut with a notice

MCP_TRANSPORT

stdio

stdio or streamable-http

Limits

  • Public packages on packagist.org only. Private repositories and Private Packagist need credentials, which this server does not handle.

  • audit_requirements works from constraints, not composer.lock, so the version your project has installed may differ from the "newest allowed" version reported. Constraints that use branches, aliases or stability flags (dev-main, 1.x-dev, ^1.0 as 2.0) are not analysed; only the latest-release facts are shown. It checks at most 60 packages per call and considers stable releases only.

  • Constraint matching covers the common Composer syntax. Unusual constraints may be reported as not analysed rather than guessed.

  • Advisory data comes from Packagist's database (GitHub Security Advisories and FriendsOfPHP). No advisories found does not mean a package is safe. Advisory ranges are shortened in output when very long.

  • Packagist is a free public service. The server identifies itself with a User-Agent, limits concurrency and caches briefly, but it does not queue requests. Download counts are updated by Packagist on its own schedule.

  • Response size is capped (see PACKAGIST_MAX_CHARS).

Development

uv sync
uv run pytest

Tests mock all HTTP traffic with respx; no network access is needed.

Licence

MIT. Author: Ankur Kapuriya. Not affiliated with or endorsed by Packagist or Private Packagist. Check Packagist's terms of use before heavy automated use.

Available Tools

8 tools
audit_requirementsA
Read-onlyIdempotent

Audit a project's dependencies in one call. Pass the text of a composer.json (or a mapping of package to constraint). For each package it reports the latest stable version, the newest version your constraint allows, whether an update is available or blocked by a major-version constraint, whether the package is abandoned (and its replacement), and known security advisories that affect the newest allowed version. Problem packages are listed first. Platform requirements (php, ext-*) are listed separately. Constraints with branches or aliases (dev-main, 'x as y') are not analysed. It reads constraints, not composer.lock, so installed versions may differ. Capped at 60 packages.

Inputs: include_dev, requirements, composer_json.

download_statsA
Read-onlyIdempotent

Download counts for a package: all-time, monthly and daily totals plus a time series. Series is for all versions, or one version if given, with daily or monthly points (most recent N). Useful for adoption trends and for how fast a new release is rolling out.

Inputs: name (required), period, points, version.

get_dependenciesA
Read-onlyIdempotent

Requirements of one package version: PHP version and extensions (platform), runtime packages (require), conflicts, replaces and provides; require-dev and suggestions with extended=true. Defaults to the latest stable release; pass a version such as '2.9.1' for another. Use it to check PHP compatibility or what installing a package pulls in.

Inputs: name (required), version, extended.

get_packageA
Read-onlyIdempotent

One-call profile of a Composer package: description, latest stable version with release date and age in days, any newer pre-release, abandoned status (with replacement), licence, keywords, repository and support links, PHP/extension requirements, runtime dependencies, download totals (total/monthly/daily), version counts and security advisories (total, those affecting the latest stable release, and the most recent). Combines three Packagist endpoints and avoids the very large raw package document. Use list_versions for release history.

Inputs: name (required).

list_packagesA
Read-onlyIdempotent

List package names by vendor ('symfony', 'laravel') or by Composer package type ('phpstan-extension', 'composer-plugin'), with repository URL and abandoned flag. Use it to survey a vendor's packages; for keyword discovery use search_packages.

Inputs: type, limit, vendor.

list_versionsA
Read-onlyIdempotent

Release history of a package, newest first: version, release date, PHP constraint, and the IDs of any security advisories that affect that exact version (or an abandoned marker). Pre-releases are hidden unless requested. Use it to choose a safe version or to see how often a package ships.

Inputs: name (required), limit, include_prereleases.

search_packagesA
Read-onlyIdempotent

Search Packagist for PHP/Composer packages by keyword. Returns name, short description, repository URL, total downloads, favourites and an abandoned flag (true, or the replacement package name), sorted by relevance. Optional filters: type (e.g. 'library', 'symfony-bundle', 'composer-plugin', 'wordpress-plugin') and tags. Use get_package for the full profile of one result.

Inputs: query (required), page, tags, type, +1 more.

security_advisoriesA
Read-onlyIdempotent

Known security advisories for one or many packages in one call (title, CVE, severity, affected version range, report date, link). Append '@version' to a package, e.g. 'monolog/monolog@2.9.0', and the advisories are split into those that affect that version and a count of others, using Composer's range syntax. Data comes from Packagist's advisory database (GitHub Security Advisories and FriendsOfPHP). An empty result means no known advisories, not proof of safety.

Inputs: packages (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a clearly distinct aspect of the Packagist domain: search, package profile, versions, dependencies, advisories, project audit, download trends, and vendor/type listing. Although get_package summarizes some data also available from security_advisories or download_stats, its role as a one-call profile is clear and the descriptions explicitly direct agents to the specialized tools for detail.

    Naming Consistency4/5

    The set is consistently snake_case and mostly follows a verb_noun pattern such as search_packages, get_package, list_versions, get_dependencies, audit_requirements, and list_packages. The two noun-oriented names security_advisories and download_stats are minor deviations but remain readable and predictable.

    Tool Count5/5

    Eight tools is well-scoped for a read-only package registry server. Each tool covers a meaningful workflow area without excessive fragmentation.

    Completeness5/5

    The surface covers discovery, package details, release history, dependency inspection, vulnerability lookup, project auditing, download statistics, and vendor/type listing. For a read-only Packagist metadata server, this is a complete lifecycle of information needs with no obvious dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables users to look up package versions, scan for vulnerabilities, and analyze dependencies across multiple registries (npm, Maven, PyPI, etc.) using exact version recommendations for security.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables checking whether software packages are deprecated, archived, stale, active, or unknown with supporting evidence, auditing dependency manifests, and looking up runtime support and end-of-life dates.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables keyless, read-only package intelligence across multiple ecosystems, including metadata lookup, dependency graphs, vulnerability advisories, lockfile audits, license checks, scorecards, and package comparisons. Supports stdio and local stateless Streamable HTTP transports.
      10
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables read-only search and exploration of Artifact Hub's cloud-native packages, including package details, security reports, changelogs, chart values, and repositories, without requiring an API key.
      6
      MIT