Swagger Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Swagger Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
An MCP (Model Context Protocol) server that reads Swagger/OpenAPI specs and lets MCP clients explore API schemas and descriptions through natural language.
The core idea: register a project once, and the whole team can query it conversationally — no need to re-upload specs every time.
| Client | MCP Support | STDIO | Streamable HTTP |
|---|---|---|---|
| Claude Desktop | O | O | O |
| Claude Code | O | O | O |
| Cursor | O | O | O |
| Gemini (Google) | O | — | O |
| ChatGPT (OpenAI) | X | — | — |
Streamable HTTP mode is recommended for clients that only support URL-based connections (e.g., Gemini).
git clone https://github.com/yunhwane/swagger-mcp.git
cd swagger-mcp
npm install
npm run buildTwo transport modes are available: STDIO (default) and Streamable HTTP.
#### Option A: STDIO (default)
Claude Desktop — edit claude_desktop_config.json:
{
"mcpServers": {
"swagger-mcp": {
"command": "node",
"args": ["/absolute/path/to/swagger-mcp/dist/index.js"]
}
}
}Claude Code — add .mcp.json in your project root:
{
"mcpServers": {
"swagger-mcp": {
"command": "node",
"args": ["/absolute/path/to/swagger-mcp/dist/index.js"]
}
}
}#### Option B: Streamable HTTP
Start the HTTP server separately, then point your client to the URL. This mode is ideal for development — tsx watch auto-restarts on code changes without requiring manual MCP reconnection.
# Start the server (dev mode with hot reload)
npm run dev:http
# Or production mode
npm run build && npm run start:httpClaude Code — add .mcp.json in your project root:
{
"mcpServers": {
"swagger-mcp": {
"url": "http://localhost:3000/mcp"
}
}
}Gemini CLI — edit ~/.gemini/settings.json:
{
"mcpServers": {
"swagger-mcp": {
"url": "http://localhost:3000/mcp"
}
}
}The HTTP server listens on port 3000 by default (override with PORT env var).
Once connected, just ask your MCP client:
"Register the Petstore API from https://petstore3.swagger.io/api/v3/openapi.json and explore its endpoints."
Or walk through the drill-down workflow:
1. add_project → Register "petstore" with the spec URL
2. list_services → See registered services and their API groups
3. list_apis → Browse all endpoints for "petstore"
4. describe_api → "GET /pet/{petId}" → see parameters, request/response schemas
5. describe_component → "#/components/schemas/Pet" → drill into a specific schemahttps://petstore3.swagger.io/api/v3/openapi.json."GET /pet/{petId} endpoint."Pet schema have?"$ref resolution — keeps responses concise while letting the LLM decide which schemas to explore~/.swagger-mcp/registry.jsonhelp tool for discoverability| Tool | Description | Inputs |
|---|---|---|
help | Show available tools and recommended workflow | — |
add_project | Register a new OpenAPI project (URL) | projectId, name, source |
list_projects | List all registered projects | — |
list_services | List registered services with their API groups (tags) | — |
list_apis | List all API endpoints for a service | serviceName |
describe_api | Get detailed info about a specific endpoint (parameters, request body, responses) | serviceName, path, method |
describe_component | Look up component schemas by $ref paths | serviceName, refs |
diff_apis | Compare saved snapshot (or registered spec) against a new source, with breaking change detection | serviceName, newSource |
The center tools (list_services → list_apis → describe_api → describe_component) use shallow resolution: endpoint schemas are expanded one level, but component $refs are preserved. This lets the LLM decide which schemas to drill into, keeping responses concise and navigable.
A reusable unit representing an API spec source. Each project has a projectId, name, and source URL. Project metadata is persisted to ~/.swagger-mcp/registry.json.
Example: "petstore" project pointing to https://petstore3.swagger.io/api/v3/openapi.jsonParsed OpenAPI documents are cached in-memory (LRU, max 20 entries, 5-minute TTL) to avoid re-fetching on every query.
When a project is registered via add_project, the spec is automatically normalized and saved as a snapshot. Each call to diff_apis that detects changes also saves a new snapshot. Snapshots are stored in ~/.swagger-mcp/snapshots/<projectId>/ (max 5 per project, deduplicated by content hash).
diff_apis compares the latest saved snapshot against a new spec source. If no snapshot exists, it falls back to fetching from the registered URL. The diff engine detects:
$ref changes┌─────────────────────────────────────────────┐
│ MCP Client │
│ (Claude Desktop / Code / Cursor / Gemini) │
└──────────────────┬──────────────────────────┘
│ MCP Protocol
│ (STDIO or Streamable HTTP)
┌──────────────────▼──────────────────────────┐
│ swagger-mcp Server │
│ │
│ ┌────────────┐ ┌────────────┐ ┌─────────┐ │
│ │ Project │ │ Center │ │ Diff │ │
│ │ Tools (2) │ │ Tools (4) │ │ Tool (1)│ │
│ └─────┬──────┘ └─────┬──────┘ └────┬────┘ │
│ │ │ │ │
│ ┌─────▼──────┐ ┌─────▼─────────────▼────┐ │
│ │ Registry │ │ Spec Cache │ │
│ │ (~/.swagger│ │ (in-memory LRU) │ │
│ │ -mcp/) │ │ │ │
│ └────────────┘ └─────────┬──────────────┘ │
│ │ │
│ ┌─────────▼──────────────┐ │
│ │ Loader + Normalizer │ │
│ │ (fetch, parse, │ │
│ │ resolve $refs) │ │
│ └────────────────────────┘ │
└──────────────────────────────────────────────┘$ref references recursively with circular ref detectionnoUncheckedIndexedAccess)@modelcontextprotocol/sdkzodtsup (ESM-only, target node20)vitestnpm run dev # Run STDIO mode with tsx
npm run dev:http # Run HTTP mode with tsx watch (auto-reload)
npm run build # Build with tsup → dist/
npm run check # TypeScript type check
npm run start:http # Run HTTP mode in production
npm test # Run all tests (vitest)
# Test with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsThis project follows the Red-Green-Refactor cycle:
tests/ mirrors src/ structure)Always run npm run check && npm test before finishing a change.
src/
├── index.ts # STDIO entry point
├── http.ts # Streamable HTTP entry point
├── http-handler.ts # HTTP request handler (session management, DNS rebinding protection)
├── server.ts # Shared McpServer creation (tool registration)
├── registry.ts # Project registry state management
├── loader.ts # OpenAPI spec fetcher (URL/file, JSON/YAML)
├── normalizer.ts # $ref resolution and spec normalization
├── differ.ts # Spec diff engine (endpoints, responses, requestBody, schemas)
├── snapshot-store.ts # Persistent snapshot storage for diff comparisons
├── spec-cache.ts # In-memory LRU cache for parsed specs
├── types.ts # TypeScript type definitions
└── tools/
├── project.ts # add_project, list_projects
├── center.ts # list_services, list_apis, describe_api, describe_component
├── diff.ts # diff_apis
└── help.ts # help
tests/ # Mirrors src/ structure (vitest)
├── tools/ # Tool unit tests
├── fixtures/ # Test OpenAPI specs (petstore variants)
└── *.test.ts # Unit tests for loader, normalizer, registry, etc.MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.