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

@kaisers-io/openapi-mcp

v0.12.2

Published

Turn any OpenAPI spec into a strict, locally running MCP server

Readme

openapi-mcp

npm CI

openapi-mcp gives an AI agent safe access to an HTTP API. You point it at the API's OpenAPI 3.0, 3.1 or 3.2 description, from a URL or a file, and it runs on your machine as an MCP server: each operation you allow becomes a tool that agents in Claude Code, Codex and other MCP hosts can call. There is no code to generate and nothing to deploy.

Without any configuration, the agent can only read (GET, HEAD and QUERY operations), credentials come only from environment variables, every call is checked against the operation's schema, and a changed API description waits for your approval before the server uses it.

The agent also spends few tokens on the API. With many operations, --tool-mode discover lists a few fixed tools instead of one per operation, and execute_code combines many calls in one program that returns only the result. For six tasks on GitHub's API, one agent spent 2.7 cents per task this way and 23.5 cents with one tool per operation (measurements).

Only use a description you trust. Its operation names and texts reach the model, and a hostile description can try to steer the agent.

Requirements: Node.js 22.19 or later, or 24.11 or later (Node 23 is not supported), on macOS, Linux or Windows. Use the latest patch release of your Node line, because older patches miss its security fixes. On Windows the cache directories are private through your user profile's access control list (owner, SYSTEM, Administrators), not through 0700/0600 modes. Other platforms, such as FreeBSD, are refused because they are untested, not because they are known to be unsafe.

Set it up with your agent

Two agent skills ask what the agent should do with the API, show which operations it may use, store the credentials safely, write the host config after you confirm, and check that the server works:

npx skills add kaisers-io/openapi-mcp

The command finds both skills, configuring-openapi-mcp and debugging-openapi-mcp, and asks which ones to install and for which agents.

Set it up by hand

Preview the tools, without starting a server:

npx -y @kaisers-io/[email protected] tools --spec https://api.example.com/openapi.json

Claude Code (.mcp.json, which expands ${VAR}):

{
  "mcpServers": {
    "shop": {
      "command": "npx",
      "args": [
        "-y",
        "@kaisers-io/[email protected]",
        "serve",
        "--spec",
        "https://api.example.com/openapi.json",
        "--base-url",
        "https://api.example.com",
        "--header-env",
        "Authorization=SHOP_TOKEN"
      ],
      "env": { "SHOP_TOKEN": "${SHOP_TOKEN}" }
    }
  }
}

Codex (~/.codex/config.toml). Codex does not expand ${VAR}; it forwards the variables named in env_vars from the environment you start it in:

[mcp_servers.shop]
command = "npx"
args = [
  "-y", "@kaisers-io/[email protected]", "serve",
  "--spec", "https://api.example.com/openapi.json", "--base-url", "https://api.example.com",
  "--header-env", "Authorization=SHOP_TOKEN",
]
env_vars = ["SHOP_TOKEN"]

--header-env sends the variable's value unchanged, so for a bearer token the variable holds Bearer followed by the token. With a spec from a URL, --base-url is required next to --header-env, so the spec cannot choose where the token goes. Run the same arguments with check instead of serve to see whether the server would start.

On Windows, a host that starts commands without a shell cannot run npx, which is a .cmd script. Use "command": "cmd" with "args": ["/d", "/c", "npx", "-y", ...] there, keep & | < > ^ % out of the arguments, and double the backslashes in JSON paths ("C:\\specs\\shop.json").

Pin an exact version, as above, and never latest: the server runs with your API credentials every time the host starts it. Without --trust-spec-updates, a description fetched with --spec-header-env also needs --cache-key.

Choose what the agent may do

--allow and --deny take selectors, matched regardless of case: method:delete, path:/users/**, route:GET /users/**, operationId:list*, name:get_users_by_id and tag:<glob>. --deny always wins, and any --allow replaces the read-only default. A tool's name is the operationId reduced to [A-Za-z0-9_-] (at most 64 characters), or method and path when there is no usable operationId (get_users_by_id).

Learn more

License

MIT