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

docfy-mcp

v0.4.1

Published

MCP server exposing a nestjs-docfy-documented OpenAPI catalog as tools for coding agents

Readme

docfy-mcp

An MCP (stdio) server that exposes an OpenAPI catalog as tools for coding agents (Claude Code, Cursor, etc.) to query while implementing a client — without leaving the editor to open a browser.

Works best with a catalog already documented via nestjs-docfy, but accepts any valid OpenAPI 3.0/3.1 spec.

Tools

  • list_endpoints — lists all endpoints (method + path + summary). Accepts an optional filter (case-insensitive substring match on path/summary/tags).
  • get_endpoint — takes method + path, returns the full "Copy for AI" text block (Purpose, Request, Parameters, Validation, Success Response, Error Responses).
  • lint_spec — checks the loaded catalog for spec-quality issues: missing summary/description, missing tags, missing 4xx/5xx responses, undocumented response descriptions, duplicate operation IDs.
  • diff_specs — compares the loaded catalog against another spec (path or url, e.g. a previous version from production or a git tag) and reports added/removed endpoints and breaking vs. informational field changes.
  • contract_test — fires a real request at every endpoint (or a filtered subset) of an already-running server built from the loaded spec, and validates each live response against its declared schema. Takes baseUrl, optional headers (repeatable "Name: value" strings, e.g. auth), and an optional filter.

Usage

Published on npm — no need to clone or build:

# from a static file
npx docfy-mcp --spec ./openapi.json

# from a NestJS server running locally
npx docfy-mcp --url http://localhost:3000/docs-json

The JSON path isn't a fixed convention — it depends on what the project passed to SwaggerModule.setup() (/api-json, /docs-json, /swagger-json, ...). If --url returns 404, docfy-mcp probes the most common paths on the same origin and suggests any that looks like a real OpenAPI document.

For specs behind auth, repeat --header as many times as needed:

npx docfy-mcp --url https://api.example.com/api-json --header "Authorization: Bearer xyz"

Why --url doesn't use swagger-parser's HTTP resolver: --url fetches the spec directly instead of delegating to swagger-parser's resolver. By default, swagger-parser's safeUrlResolver blocks local/private URLs as an SSRF protection — which would break the most common use case here: pointing at a local NestJS dev server.

Local development

npm install && npm run build
node dist/cli.js --spec/--url ...
# or, via tsx:
npm run dev

Registering as a local MCP server (Claude Code / Cursor)

Add a .mcp.json at the root of the project where the MCP client will run:

{
  "mcpServers": {
    "docfy": {
      "command": "npx",
      "args": ["-y", "docfy-mcp", "--url", "http://localhost:3000/docs-json"]
    }
  }
}

Restart the MCP client — the list_endpoints and get_endpoint tools should appear in the available tools list.