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

@tyvm/swagger-mcp

v0.0.18

Published

Generate MCP servers from Swagger/OpenAPI specifications

Downloads

217

Readme

Swagger MCP Generator

Generate MCP (Model Context Protocol) servers from Swagger/OpenAPI specifications.

Two Ways to Use

  1. Code Generation - Generate a standalone MCP server package for deployment
  2. Stateless Proxy - Dynamically serve MCP tools from any Swagger spec at runtime (see PROXY.md)

Code Generation Mode

Usage

npx @tyvm/swagger-mcp --url <swagger-url> [--output output-dir] [--file input-file] [--start-stdio]

By default, the output directory is generated based on the domain name of the swagger URL. For example, https://api.dev.knowhow.tyvm.ai/docs/ would create ./generated/api_dev_knowhow_tyvm_ai/.

Examples

# Generate and immediately start the server (creates ./generated/api_example_com/)
npx @tyvm/swagger-mcp --url https://api.example.com/swagger.json --start-stdio

# Generate MCP server from Swagger spec (creates ./generated/api_example_com/)
npx @tyvm/swagger-mcp --url https://api.example.com/swagger.json

Options

  • --start-stdio - Automatically build and start the generated MCP server after generation
    • This will run npm install, npm run build, and then start the server

Environment Variables

Set custom headers for API access:

  • HEADER_AUTHORIZATION - Sets the Authorization header
  • HEADER_<NAME> - Sets any custom header (e.g., HEADER_X_API_KEY)

Generated Files

The tool creates:

  1. package.json - Project configuration with dependencies
  2. tsconfig.json - TypeScript configuration
  3. src/client.ts - HTTP client functions for each API endpoint
  4. src/mcp-server.ts - Complete MCP server implementation
  5. mcp-server.ts - Root-level MCP server for direct use

Using the Generated MCP Server

  1. Add to your MCP client configuration:
  2. Set any env variables for headers as needed
    {
      "name": "knowhow-web",
      "command": "npx",
      "args": [
        "-y",
        "@tyvm/swagger-mcp",
        "--url",
        "https://api.dev.knowhow.tyvm.ai/docs/swagger.json",
        "--start-stdio"
      ],
      "env": {
        "HEADER_AUTHORIZATION": "Bearer xxxxxx"
      }
    }

Features

  • ✅ Generates MCP tools for all Swagger endpoints
  • ✅ Supports authentication headers via environment variables
  • ✅ Proper TypeScript types and validation
  • ✅ Error handling and logging
  • ✅ Compatible with MCP SDK v1.13.3
  • ✅ Handles query parameters, path parameters, and request bodies
  • ✅ Supports complex object types and arrays

Requirements

  • Node.js 18+
  • Internet access to fetch Swagger specifications

License

MIT