Swagger/Postman

Provides an MCP server that loads OpenAPI/Swagger specs or Postman collections and exposes 4 strategic tools for API discovery, details, search, and execution.
  • typescript

0

GitHub Stars

typescript

Language

5 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mcp-mirror-alangreyjoy_swag-mcp": {
      "command": "./start-mcp.sh",
      "args": [],
      "env": {
        "PORT": "3000",
        "API_TOKEN": "YOUR_TOKEN",
        "API_PASSWORD": "YOUR_PASSWORD",
        "API_USERNAME": "YOUR_USERNAME",
        "DEFAULT_SWAGGER_URL": "https://petstore.swagger.io/v2/swagger.json",
        "DEFAULT_API_BASE_URL": "https://api.example.com"
      }
    }
  }
}

You can load OpenAPI/Swagger specifications or Postman collections and interact with them through four strategic MCP tools. This enables AI agents to discover endpoints, inspect details, search, and execute requests in a concise, controlled way without needing hundreds of individual tools.

How to use

Use an MCP client to connect to the server via stdio. You’ll work with four strategic tools in either OpenAPI/Swagger mode or Postman collection mode. In OpenAPI mode, you can list endpoints, view endpoint details, search endpoints by keyword, and make API calls. In Postman mode, you can list requests, view request details, search requests, and execute a request from the collection. This setup enables dynamic API interaction while keeping tool options focused and performant.

How to install

Prerequisites you need before starting:

  • Node.js v18 or higher

  • Yarn package manager

  • TypeScript

Step-by-step setup you can follow to get up and running:

# Clone the repository
git clone <repository-url>
cd swag-mcp

# Install dependencies
npm install
# or
yarn install

# Build the project
npm run build
# or
yarn build

# Make the start script executable (Linux/macOS)
chmod +x start-mcp.sh

Configuration and startup

Configure your MCP server to load either an OpenAPI/Swagger specification or a Postman collection. The following examples show configurations you can place in your config.json.

{
  "api": {
    "type": "openapi",
    "openapi": {
      "url": "https://petstore.swagger.io/v2/swagger.json",
      "apiBaseUrl": "https://petstore.swagger.io/v2",
      "defaultAuth": {
        "type": "apiKey",
        "apiKey": "special-key",
        "apiKeyName": "api_key",
        "apiKeyIn": "header"
      }
    }
  },
  "log": {
    "level": "info"
  }
}
{
  "api": {
    "type": "postman",
    "postman": {
      "collectionUrl": "https://www.postman.com/collections/your-collection-id",
      "collectionFile": "./examples/postman-collection.json",
      "environmentUrl": "https://www.postman.com/environments/your-environment-id",
      "environmentFile": "./examples/postman-environment.json",
      "defaultAuth": {
        "type": "bearer",
        "token": "your-api-token-here"
      }
    }
  },
  "log": {
    "level": "info"
  }
}

Security and usage notes

This server is intended for personal use. Do not expose it to the public internet. If the API you connect to requires authentication, keep the MCP server isolated from public access and rely on your chosen authentication method for each request.

Available tools

list_endpoints

List all available API endpoints with methods and paths.

get_endpoint_details

Provide detailed information for a specific endpoint given method and path.

search_endpoints

Search endpoints by a keyword across path, summary, or description.

make_api_call

Execute an API call to any endpoint with proper authentication and parameter handling.

list_requests

List all requests in the Postman collection.

get_request_details

Provide detailed information for a specific request in the collection.

search_requests

Search requests by keyword in the collection.

make_request

Execute a specific request from the Postman collection.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational