npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dart-pub-mcp

v0.1.1

Published

MCP server exposing pub.dev and local pub cache package information.

Readme

dart-pub-mcp

Model Context Protocol (MCP) server that exposes metadata, release notes, documentation assets, and source files from the public pub.dev registry as well as the local Dart/Flutter pub cache.

Features

  • Mirrors official pub.dev API endpoints documented at pub.dev/help/api for package metadata, scores, and publisher information.
  • Streams package archives from pub.dev to expose READMEs, changelogs, and arbitrary source files.
  • Reads files already downloaded into the local pub cache (defaults to ~/.pub-cache, override with PUB_CACHE).
  • Provides discovery helpers for packages, versions, and file listings to guide MCP clients.

Supported resources

Remote resources (pub.dev:// URIs):

  • pub.dev://package/{package} – package summary (JSON from /api/packages/{package}).
  • pub.dev://package/{package}/score – scoring metadata (/api/packages/{package}/score).
  • pub.dev://package/{package}/publisher – publisher info (/api/packages/{package}/publisher).
  • pub.dev://package/{package}/version/{version} – version metadata (/api/packages/{package}/versions/{version}). Use latest for the most recent release.
  • pub.dev://package/{package}/version/{version}/files – JSON list of files contained in the published archive.
  • pub.dev://package/{package}/version/{version}/file/{+filePath} – raw file contents from the archive (e.g. .../file/README.md or .../file/lib/src/foo.dart).

Local cache resources (pubcache:// URIs):

  • pubcache://package/{package}/versions – versions available locally, grouped by hosting source.
  • pubcache://package/{package}/version/{version}/files – JSON list of files on disk for a cached version.
  • pubcache://package/{package}/version/{version}/file/{+filePath} – raw file from the local pub cache.

Installation

npm install

Running the server

npm start

The server communicates over stdio, so you can connect with any MCP-compatible client (Claude Desktop, Claude Code, Cursor, the MCP Inspector, etc.). Use the resource URIs above to request data once connected.

Client configuration examples

Below are sample configurations that call the server via npx (useful once the package is published to npm). Replace X.Y.Z with the desired version or omit it to always pull the latest.

Claude Code / Claude Desktop (Claude CLI)

claude mcp add dart-pub-mcp \
  --transport stdio \
  --command npx \
  --arg dart-pub-mcp@latest \
  --arg start

Gemini Code Assist (VS Code google-gemini.json)

{
  "mcpServers": [
    {
      "name": "dart-pub-mcp",
      "type": "stdio",
      "command": "npx",
      "args": ["dart-pub-mcp@latest", "start"]
    }
  ]
}

OpenAI Codex / o1-coder (VS Code openai.json)

{
  "mcpServers": {
    "dart-pub-mcp": {
      "command": "npx",
      "args": ["dart-pub-mcp@latest", "start"],
      "transport": "stdio"
    }
  }
}

Environment variables

  • PUB_CACHE – custom location of the pub cache. If unset, the server falls back to ~/.pub-cache.

Development

# Type checks & build artefacts
npm run build

# Run automated tests
npm test

# Verify publishable package contents (dry run)
npm run pack:test

# Watch mode for local iteration
npm run dev

The repository uses TypeScript with tsx for local development. Build output is emitted to dist/.

See CONTRIBUTING.md for contribution guidelines and AGENTS.md for MCP client integration details.

Publishing Releases

This repository uses automated NPM publishing via GitHub Actions. For information on setting up releases and configuring the NPM_TOKEN secret, see .github/NPM_RELEASE_SETUP.md.

Notes on the pub.dev API

The implementation follows the publicly documented endpoints at pub.dev/help/api:

  • /api/package-name-completion-data – used for lightweight package discovery inside the MCP resource template.
  • /api/packages/<package>/score and /api/packages/<package>/publisher – expose score and publisher metadata.
  • /api/package-names – available for exhaustive package listings (not currently auto-exposed to avoid large payloads, but the helper is implemented).

For package version metadata and archives we rely on the Hosted Pub Repository Specification v2 that the pub CLI uses. This provides /api/packages/<package> and /api/packages/<package>/versions/<version>, along with archive_url pointers that the server streams to surface files such as README.md and CHANGELOG.md.

License

Released under the ISC license. See LICENSE.