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

openapi-spec-mcp-serve

v1.0.3

Published

MCP server for reading, writing, and managing OpenAPI specification files

Readme

openapi-spec-mcp-serve

An MCP (Model Context Protocol) server for reading, writing, and managing OpenAPI specification files. Connect it to Claude Desktop, Claude Code, or any MCP-compatible client to let AI assistants directly create and edit your openapi.yml.

Quick Start

npx openapi-spec-mcp-serve

Features

  • Read & write the full spec in YAML or JSON
  • Manage paths — add, get, update, delete individual endpoints and HTTP methods
  • Manage schemas — add, update, delete reusable component schemas
  • Validate your spec against the OpenAPI 3.x standard before every write
  • Auto-backup — saves openapi.yml.bak before every destructive operation
  • Safe by default — rejects writes that would produce an invalid spec

Tools

| Tool | Description | |---|---| | initialize_spec | Create a new empty OpenAPI 3.1.0 spec | | read_spec | Read the full spec (YAML or JSON) | | write_spec | Overwrite the entire spec | | validate_spec | Validate against OpenAPI 3.x standard | | update_info | Update title, version, description, contact, license | | add_server | Add a server URL | | list_paths | List all paths and methods (filterable by method or tag) | | get_path | Get a specific path or operation | | add_path | Add a new endpoint | | update_path | Merge updates into an existing operation | | delete_path | Delete a path or single method | | list_schemas | List all component schemas | | get_schema | Get a specific schema | | add_schema | Add a reusable schema to components/schemas | | update_schema | Merge updates into an existing schema | | delete_schema | Remove a schema |

Installation

npx openapi-spec-mcp-serve

Or install globally:

npm install -g openapi-spec-mcp-serve
openapi-spec-mcp-serve

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "openapi-spec-manager": {
      "command": "npx",
      "args": ["openapi-spec-mcp-serve"],
      "env": {
        "OPENAPI_FILE_PATH": "/absolute/path/to/your/openapi.yml"
      }
    }
  }
}

Claude Code

claude mcp add openapi-spec-manager \
  -e OPENAPI_FILE_PATH=/path/to/openapi.yml \
  -- npx openapi-spec-mcp-serve

Environment Variables

| Variable | Default | Description | |---|---|---| | OPENAPI_FILE_PATH | ./openapi.yml | Path to the OpenAPI spec file to manage |

Example Prompts

Once connected to Claude, you can say:

  • "Initialize a new OpenAPI spec for a Users API v1.0"
  • "Add a POST /users endpoint that creates a user with name and email"
  • "Add a User schema to components with id, email, and name fields"
  • "List all my API endpoints"
  • "Update the GET /users description to mention pagination"
  • "Validate my spec and fix any errors"
  • "Add https://api.example.com/v1 as the production server"

Development

npm run dev   # watch mode (tsc --watch)
npm run build # production build

Project Structure

src/
├── index.ts          # MCP server entry point & tool registration
├── lib/
│   ├── types.ts      # Shared TypeScript types & result helpers
│   ├── parser.ts     # YAML read/write/backup helpers
│   └── validator.ts  # OpenAPI spec validation via swagger-parser
└── tools/
    ├── read.ts       # read_spec
    ├── write.ts      # write_spec, initialize_spec, update_info, add_server
    ├── paths.ts      # list/get/add/update/delete paths
    ├── schemas.ts    # list/get/add/update/delete schemas
    └── validate.ts   # validate_spec