swagger-connect-mcp
Provides tools for discovering and exploring Swagger/OpenAPI API documentation, including listing sources and operations, inspecting operation details, and retrieving schemas.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
swagger-connect-mcp
将 Swagger/OpenAPI 文档连接到 Codex、Claude Code、Qoder、Trae、Cursor、OpenCode 和 CodeBuddy。
中文
要求
Node.js >= 20
npm 或 pnpm
安装
npm install --save-dev swagger-connect-mcppnpm 项目使用:
pnpm add -D swagger-connect-mcp初始化
在业务项目根目录执行。tool 支持:codex、claude-code、qoder、trae、cursor、opencode、codebuddy、all。
按需配置单个 Agent:
# Codex
npx swagger-connect-mcp init --tool codex --url https://example.com/v3/api-docs
# Claude Code
npx swagger-connect-mcp init --tool claude-code --url https://example.com/v3/api-docs
# Qoder
npx swagger-connect-mcp init --tool qoder --url https://example.com/v3/api-docs
# Trae
npx swagger-connect-mcp init --tool trae --url https://example.com/v3/api-docs
# Cursor
npx swagger-connect-mcp init --tool cursor --url https://example.com/v3/api-docs
# OpenCode
npx swagger-connect-mcp init --tool opencode --url https://example.com/v3/api-docs
# CodeBuddy
npx swagger-connect-mcp init --tool codebuddy --url https://example.com/v3/api-docs任意命令增加 --with-instructions 可同时生成对应 Agent 的联调规则;使用 all 可生成全部配置。
同时生成所有 Agent 配置和联调规则:
npx swagger-connect-mcp init \
--tool all \
--with-instructions \
--url https://example.com/v3/api-docsinit 会生成或合并:
swagger-mcp.config.json
对应 Agent 的 MCP 配置
使用 --with-instructions 时生成 AGENTS.md、CLAUDE.md、CODEBUDDY.md 或对应规则文件
不会执行 postinstall,安装包不会自动修改业务项目。
多个 Swagger 文档
npx swagger-connect-mcp add billing \
--url https://example.com/billing/v3/api-docs \
--base-url https://example.com/billing
npx swagger-connect-mcp remove billing配置示例:
{
"sources": {
"default": {
"url": "https://example.com/v3/api-docs"
},
"billing": {
"url": "https://example.com/billing/v3/api-docs",
"baseUrl": "https://example.com/billing"
}
},
"allowRequests": false
}支持 OpenAPI 3.x、Swagger 2.0、JSON、YAML 和 Swagger UI 地址。
认证
不要提交明文 token,使用环境变量引用:
{
"sources": {
"private": {
"url": "https://example.com/v3/api-docs",
"headers": {
"Authorization": "Bearer ${SWAGGER_TOKEN}"
}
}
}
}$env:SWAGGER_TOKEN = "your-token"MCP 工具
默认只读:
swagger_list_sources
swagger_list_operations
swagger_get_operation
swagger_get_schema
swagger:///openapi
兼容工具:fetch_swagger_info、list_endpoints、get_endpoint_details、validate_api_response。
业务接口请求默认关闭。设置 allowRequests 为 true 后才提供 swagger_request 和 execute_api_request。
简洁用法
生成 AGENTS.md 后,只需要告诉 code agent:
按 Swagger 联调结算单详情接口,接入当前页面,不要猜字段。开发与发布
npm run build
npm test
npm pack --dry-run
npm publish --registry=https://registry.npmjs.orgRelated MCP server: Swagger MCP Server
English
Requirements
Node.js >= 20
npm or pnpm
Install
npm install --save-dev swagger-connect-mcpFor pnpm projects:
pnpm add -D swagger-connect-mcpInitialize
Run from the target project root. Supported tools: codex, claude-code, qoder, trae, cursor, opencode, codebuddy, and all.
Configure one Agent as needed:
# Codex
npx swagger-connect-mcp init --tool codex --url https://example.com/v3/api-docs
# Claude Code
npx swagger-connect-mcp init --tool claude-code --url https://example.com/v3/api-docs
# Qoder
npx swagger-connect-mcp init --tool qoder --url https://example.com/v3/api-docs
# Trae
npx swagger-connect-mcp init --tool trae --url https://example.com/v3/api-docs
# Cursor
npx swagger-connect-mcp init --tool cursor --url https://example.com/v3/api-docs
# OpenCode
npx swagger-connect-mcp init --tool opencode --url https://example.com/v3/api-docs
# CodeBuddy
npx swagger-connect-mcp init --tool codebuddy --url https://example.com/v3/api-docsAdd --with-instructions to generate integration rules for the selected Agent. Use all to generate every configuration.
All agents with integration instructions:
npx swagger-connect-mcp init \
--tool all \
--with-instructions \
--url https://example.com/v3/api-docsinit creates or merges swagger-mcp.config.json, the selected agent configuration, and—when --with-instructions is used—AGENTS.md, CLAUDE.md, CODEBUDDY.md, or native rule files.
There is no postinstall script. Installing the package does not modify the project automatically.
Multiple Swagger documents
npx swagger-connect-mcp add billing \
--url https://example.com/billing/v3/api-docs \
--base-url https://example.com/billing
npx swagger-connect-mcp remove billingExample:
{
"sources": {
"default": { "url": "https://example.com/v3/api-docs" },
"billing": {
"url": "https://example.com/billing/v3/api-docs",
"baseUrl": "https://example.com/billing"
}
},
"allowRequests": false
}Supports OpenAPI 3.x, Swagger 2.0, JSON, YAML, and Swagger UI URLs.
Authentication
Use environment variables instead of committing tokens:
{
"sources": {
"private": {
"url": "https://example.com/v3/api-docs",
"headers": {
"Authorization": "Bearer ${SWAGGER_TOKEN}"
}
}
}
}$env:SWAGGER_TOKEN = "your-token"MCP tools
Read-only tools:
swagger_list_sources
swagger_list_operations
swagger_get_operation
swagger_get_schema
swagger:///openapi
Compatibility aliases: fetch_swagger_info, list_endpoints, get_endpoint_details, validate_api_response.
Business API requests are disabled by default. Set allowRequests to true to enable swagger_request and execute_api_request.
Short prompt
After generating AGENTS.md:
Integrate the settlement detail API using Swagger. Do not guess fields.Development and publishing
npm run build
npm test
npm pack --dry-run
npm publish --registry=https://registry.npmjs.orgLicense
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Discover, compare, route, and execute machine-accessible capabilities for AI agents.
Discover, compare, and monitor 1,400+ APIs directly from your AI coding agent.
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
Publish your API docs so AI assistants can look up endpoints and call your API correctly.
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.1420 npm2MIT
- FlicenseNot gradedqualityDmaintenanceBrings OpenAPI/Swagger documentation into AI assistants, enabling endpoint discovery, deep inspection, cURL generation, and TypeScript type generation.-
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with access to OpenAPI specifications, enabling API discovery, schema retrieval, and direct API execution with support for OAuth 2.0 and other authentication methods.5 npm1MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with accurate OpenAPI contract details to prevent hallucinated API calls, supporting multi-version pinning, endpoint discovery, and request validation.42 npmApache 2.0