Skip to main content
Glama

Swagger MCP

一个独立的 stdio MCP 服务,用于在任意业务项目中维护多后端服务的 Swagger/OpenAPI 本地缓存,并提供离线接口检索能力。

后端 Swagger JSON 地址通常固定,但开发时不应每次查询接口都访问远程服务。Swagger MCP 用服务名定位文档,默认只查询本地缓存;只有明确执行刷新工具时,才会重新请求远程 Swagger JSON。

核心行为

  • MCP 工具本体可被多个项目复用。

  • 每个业务项目拥有自己的 .swagger-mcp 配置和缓存。

  • 查询类工具只读本地缓存,不会自动联网更新。

  • refresh_service 和 refresh_all_services 是仅有的远程 Swagger 拉取入口。

  • 服务以稳定名称调用,例如 service1、service2,不需要重复提供 URL。

  • 成功刷新后,服务配置中的 updatedAt 会记录缓存更新时间。

Related MCP server: ls-apis-mcp

架构

<installation-dir>/                       # MCP 工具本体
  bin\
  src\

<workspace>/                              # 被接入的业务项目
  .swagger-mcp\
    config.json                           # 服务名称、URL 与更新时间
    cache\
      service1.openapi.json               # 本地 Swagger/OpenAPI 缓存
      service2.openapi.json

swagger-mcp 不属于业务项目源码。.swagger-mcp 则是该业务项目独有的运行时状态,不同项目可以有不同的服务清单、环境地址和缓存版本。

Requirements

  • Node.js 18 或更高版本

  • 支持 stdio MCP 的客户端,例如 Codex

当前实现仅依赖 Node.js 内置模块。

快速开始

1. 安装 npm 包

npm install -g @hanzc0106/swagger-mcp

从源码运行和参与开发的方式见开发与测试。

从源码验证

git clone https://github.com/hanzc0106/swagger-mcp.git <your-path>/swagger-mcp
cd <your-path>/swagger-mcp
npm test

2. 注册到 Codex

以下命令会注册一个名为 swagger-local 的全局 stdio MCP。注册只声明工具本体,不绑定任何业务项目:

codex mcp add swagger-local -- swagger-mcp

验证注册结果:

codex mcp get swagger-local
codex mcp list

注册后请重启 Codex 或新建任务,使客户端重新启动 MCP 并发现 tools。

等价的 Codex TOML 配置如下:

[mcp_servers.swagger-local]
type = "stdio"
command = "swagger-mcp"
args = []

也可以使用 npx 启动固定版本,无需全局安装:

codex mcp add swagger-local -- npx -y @hanzc0106/swagger-mcp@0.1.0

业务项目是工具调用时的运行时上下文,而不是 Codex 全局 MCP 配置的一部分。所有项目相关 tools 都要求提供绝对路径 workspace,因此一个 MCP 注册可服务多个项目,各项目分别维护自己的 .swagger-mcp 目录。

3. 初始化业务项目

在 Agent 中调用 init_project 并提供业务项目的绝对路径。它将创建:

init_project(workspace = "<workspace>")
<workspace>/.swagger-mcp/
  config.json
  cache/

注意:如果项目根目录中已经存在名为 .swagger-mcp 的文件,它会与需要创建的同名目录冲突。请先迁移或重命名旧文件,工具不会覆盖它。

4. 添加并刷新服务

先添加固定的 Swagger JSON 地址:

add_service(
  workspace = "<workspace>",
  service = "service1",
  url = "https://example.com/openapi.json"
)

再明确刷新缓存:

refresh_service(workspace = "<workspace>", service = "service1")

刷新成功后即可离线搜索:

search_operations(workspace = "<workspace>", service = "service1", keyword = "resource")

项目配置

/.swagger-mcp/config.json 示例:

{
  "services": {
    "service1": {
      "url": "https://example.com/openapi.json",
      "updatedAt": "2026-08-14T08:30:00.000Z"
    },
    "service2": {
      "url": "https://example.com/openapi.json",
      "updatedAt": null
    }
  }
}

字段

含义

services

以服务名为键的 Swagger 服务集合。服务名只能包含字母、数字、下划线和连字符。

url

固定 Swagger/OpenAPI JSON 地址。支持 http、https 和本地 file URL。

updatedAt

最近一次成功写入本地缓存的 ISO 8601 时间。null 表示尚未成功刷新。

缓存文件位于:

<workspace>/.swagger-mcp/cache/<service>.openapi.json

MCP Tools

除 initialize 与 tools/list 协议请求外,以下每个 tool 都必须传入 workspace。它是业务项目的绝对路径,工具会在该路径下读写 .swagger-mcp。

项目与服务管理

Tool

联网

说明

init_project

初始化当前工作区的 .swagger-mcp。

list_services

列出配置服务及缓存状态、缓存大小、文档信息和 updatedAt。

add_service

添加服务名与 Swagger JSON URL,不会自动拉取文档。

update_service

修改已有服务 URL,不会自动刷新。

remove_service

删除服务配置;已有缓存文件会保留,避免无意丢失本地快照。

缓存刷新

Tool

联网

说明

refresh_service

根据已保存的 URL 拉取一个服务的 Swagger JSON,校验后覆盖该服务缓存,并更新 updatedAt。

refresh_all_services

依次刷新全部已配置服务;单个服务失败不会阻止其他服务刷新。

刷新失败时,原有缓存会保留,updatedAt 不会更新。

缓存查询

Tool

联网

说明

search_operations

通过关键词、HTTP 方法、Tag 搜索本地缓存中的接口。

get_operation

根据 operationId,或 method 加 path 读取完整接口定义。

get_schema

读取并展开一个 OpenAPI schema 或 Swagger 2 definitions schema。

generate_request_example

为指定接口生成 curl、axios 或 fetch 请求示例。

当 search_operations 没有匹配项,或 get_operation、get_schema、generate_request_example 找不到所需定义时,工具会返回缓存状态和 refreshHint,而不会自动请求远程地址。

{
  "cache": {
    "hasCache": true,
    "updatedAt": "2026-08-14T08:30:00.000Z"
  },
  "refreshHint": {
    "recommended": true,
    "reason": "No cached operation matched the query.",
    "tool": "refresh_service",
    "arguments": {
      "workspace": "<workspace>",
      "service": "service1"
    }
  }
}

refreshHint 表示“本地定义可能过旧或不完整”,由 Agent 根据当前任务决定是否调用 refresh_service。它不是自动刷新机制。

常见调用

查看当前缓存状态

list_services(workspace = "<workspace>")

结果会包含服务 URL、updatedAt、是否存在缓存、缓存文件位置、文档标题、OpenAPI 版本和接口数量。

搜索接口

search_operations(
  workspace = "<workspace>",
  service = "service1",
  keyword = "resource",
  method = "GET",
  tag = "Resource",
  limit = 20
)

keyword 会匹配路径、HTTP 方法、operationId、摘要、描述和 Tag。

获取接口完整定义

get_operation(
  workspace = "<workspace>",
  service = "service1",
  operationId = "listResources"
)

也可以使用:

get_operation(
  workspace = "<workspace>",
  service = "service1",
  method = "GET",
  path = "/api/resources"
)

返回内容包括参数、请求体、响应、鉴权配置,并解析文档内的本地 $ref。

生成请求示例

generate_request_example(
  workspace = "<workspace>",
  service = "service1",
  operationId = "updateResource",
  format = "axios",
  baseUrl = "https://api.example.com"
)

format 支持 curl、axios、fetch。若未提供 baseUrl,会使用 OpenAPI servers 第一个地址;若文档未配置服务地址,则使用 占位符。

安全与隐私

  • Swagger URL 可能是内网地址,不应提交到公开仓库。

  • OpenAPI 文档可能暴露内部接口、字段和鉴权描述,请按团队数据规则处理缓存文件。

  • 本工具只下载 Swagger/OpenAPI 文档,不会调用业务 API。

  • 不存在自动刷新或后台定时刷新,所有网络请求都由刷新工具显式触发。

  • 不要将 Token、Cookie、认证 Header 写入可提交的 config.json。

  • 建议将本地环境地址和缓存加入业务项目的 .gitignore,例如:

.swagger-mcp/cache/

是否提交 config.json 取决于服务 URL 是否敏感,以及团队是否需要共享服务清单。

开发与测试

cd <installation-dir>
npm test

测试覆盖以下主流程:

初始化工作区
  -> 添加 file URL 服务
  -> 显式刷新缓存
  -> 搜索接口
  -> 查询 schema
  -> 生成请求示例

可直接以 stdio 方式运行服务:

node <installation-dir>/bin/swagger-mcp.js

服务使用 JSON-RPC over stdio。初始化后通过 tools/list 声明能力,并通过 tools/call 执行具体工具。

代码结构

bin/
  swagger-mcp.js       MCP 进程入口
src/
  server.js            JSON-RPC 协议、工具声明与分发
  workspace.js         工作区和 .swagger-mcp 路径解析
  config.js            config.json 初始化与服务配置读写
  cache.js             Swagger 缓存读写与显式刷新
  openapi.js           OpenAPI/Swagger 解析、$ref 展开与示例生成
tests/
  fixtures/            测试 OpenAPI 文档
  run-tests.js         端到端主流程测试

当前限制

  • 支持 JSON 格式的 OpenAPI/Swagger 文档,不支持 YAML。

  • 支持文档内部的本地 $ref,不支持跨文件或远程 $ref。

  • 不管理 Token、Cookie、认证 Header。

  • 不直接调用业务接口。

  • 不提供自动刷新、定时刷新或远程缓存同步。

Roadmap

  • 支持 OpenAPI YAML

  • 支持 ETag / Last-Modified 以优化显式刷新

  • 支持两份 Swagger 文档的接口差异比较

  • 支持本地私有认证配置

  • 增加更多 MCP 客户端注册示例

  • 发布 GitHub Release 与 npm provenance

Available Tools

11 tools
add_serviceB

Add a named Swagger/OpenAPI source. It does not fetch the document.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesSwagger/OpenAPI JSON URL or file URL.
serviceYesStable service name, such as datapool.
overwriteNo
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It does disclose one genuinely useful trait — no fetching occurs — but says nothing about duplicate-name handling, what 'overwrite' actually replaces, persistence location, or permission/validation behavior for a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with zero waste, and the key behavioral caveat ('does not fetch the document') is front-loaded rather than buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a mutating tool with 3 required params, no annotations, and no output schema, yet the description omits what happens on a name collision, how it interacts with 'overwrite', and what state it leaves behind. For a registration/mutation tool the description is too thin.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75%, so the schema documents url, service, and workspace adequately. The description adds no parameter meaning and leaves the undocumented 'overwrite' flag (the one parameter that determines mutation semantics) unexplained in either place.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Add a named Swagger/OpenAPI source') and the second sentence differentiates it from fetch-oriented siblings like refresh_service. It is clear what the tool registers, though it doesn't name any sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: you add a source here and presumably fetch it elsewhere. The phrase 'does not fetch the document' gestures at the refresh_service boundary without stating when to use one vs the other, and no prerequisites or ordering (e.g., after init_project) are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_request_exampleC

Generate curl, axios, or fetch code from one cached operation.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo
formatNocurl
methodNo
baseUrlNoOptional API base URL. Falls back to spec server URL.
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.
operationIdNo

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It implies a read-only generation step and hints at a cache dependency ('cached operation'), but does not say what happens when the operation is not cached, whether it writes files, or whether it requires a prior refresh_service call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, well-formed sentence with the action front-loaded and the output variants listed inline. Nothing is wasted, but there is also no second sentence to add the missing routing or prerequisite information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 7 parameters, no annotations, and no output schema, the description is too thin: it does not explain the shape of the returned code string, how the operation is identified (operationId vs path/method), or that a service must be cached first. An agent would have to guess at the call sequence.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 29%: just baseUrl and workspace are documented in the schema, while path, method, service, and operationId are bare. The description only mirrors the format enum (curl/axios/fetch) and explains nothing about how path/method/operationId select the operation or how they interact.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (generate) and resource (request code) plus the three output formats, which distinguishes it from read-oriented siblings like get_operation and get_schema. It is clear but does not name which sibling it replaces or complements, nor what 'cached operation' refers to.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance: nothing says to call this after list_services/refresh_service, nothing says it requires a previously cached spec, and no alternative (e.g. get_operation) is referenced. The one contextual hint is the phrase 'cached operation', which is not elaborated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_operationC

Read one cached operation by operationId, or by method and path.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo
methodNo
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.
operationIdNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. The word 'cached' usefully signals that results may be stale or locally sourced, but nothing is said about missing operations, required permissions, refresh behavior, or return shape for a 5-parameter read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the core action and both addressing modes are presented immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with no annotations, no output schema, and 80% undocumented parameters, the description leaves too much unspecified. An agent still lacks the meaning of 'service', the response format, and error behavior when the operation is absent from the cache.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 20% (just 'workspace'), so the description must compensate. It clarifies the operationId-vs-(method,path) alternative and establishes that these are alternate lookup keys rather than co-required, which is genuinely additive, but it says nothing about 'service' or how the two keys interact if both are supplied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Read'), a bounded resource ('one cached operation'), and the two lookup keys available. It is clearly distinguishable from the sibling search_operations, which implies a many-result lookup, though it never names that sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description hints at two valid invocation modes (by operationId, or by method and path) but gives no guidance on when to prefer this over search_operations, get_schema, or generate_request_example, and no prerequisites or exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_schemaC

Read and resolve one schema from a cached Swagger/OpenAPI document.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. 'Read' weakly implies a safe read-only operation and 'cached' hints the data may be stale (refreshed via refresh_service), but it omits error behavior for missing schemas, staleness guarantees, and what 'resolve' does with $refs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single efficient sentence with the key verb and resource front-loaded and zero filler. It is appropriately sized, though the brevity contributes to the gaps elsewhere rather than being a strength in itself.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with three required parameters, no annotations, no output schema, and low schema coverage, the description is too thin. An agent cannot tell how to supply 'name'/'service' identifiers or what happens on failure, leaving it under-equipped to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only 33% schema description coverage, and the description adds no parameter meaning at all — it never explains what 'name', 'service', or 'workspace' should contain. With two of three required parameters undocumented in both schema and description, the description fails to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb pair (read/resolve) and a specific resource (one schema from a cached Swagger/OpenAPI document), which is more precise than a generic 'get'. However, it does not distinguish itself from siblings like get_operation or search_operations that also read from the same cached spec.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to use this tool versus get_operation, search_operations, or generate_request_example. The phrase 'resolve one schema' implies retrieval of a schema definition, but no conditions, prerequisites, or alternatives are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

init_projectB

Create .swagger-mcp/config.json and cache directory in the requested workspace.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It does name the concrete side effects (creating a config file and a cache directory), which is meaningful behavioral detail. However, it is silent on critical traits: whether it overwrites an existing config, whether it is idempotent, whether it fails when the directory already exists, and what permissions it needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with no filler that front-loads the created artifacts and ends with the target location. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter setup tool with no annotations, no output schema, and full schema coverage, the description is adequate for the mechanical action. It is incomplete on the behavioral questions that matter for an initializer (idempotency, overwrite semantics, failure modes), leaving the agent to guess about re-running it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the single 'workspace' parameter is already fully documented as an absolute path owning .swagger-mcp. The description only echoes this ('in the requested workspace') and adds no format or validation nuance beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a concrete verb (Create) and the exact artifacts produced (.swagger-mcp/config.json and a cache directory) in the workspace. This is specific enough to distinguish it from the service/operation-management siblings, none of which perform setup. It falls just short of a 5 because it doesn't frame the tool's role in the overall workflow (e.g., first-run bootstrap).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to invoke this tool, no prerequisite or ordering information (e.g., 'run before add_service'), and no statement about when it should not be used. The agent must infer that this is a one-time setup step from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_servicesA

List configured Swagger services and local cache state. This never fetches remote documents.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose one meaningful behavioral trait: it performs no remote fetch, so results reflect local state only. It stops short of stating whether it touches disk/network at all, permission requirements, or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with what is listed and followed by the key constraint. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read tool with no output schema and no annotations, the description conveys what is returned (services and cache state) and the crucial no-fetch constraint. It is largely complete, though it could note prerequisites such as the workspace needing prior initialization.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single workspace parameter, so the schema already documents its meaning fully. The description adds no additional parameter semantics beyond what the schema provides, making 3 the correct baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: listing configured Swagger services plus local cache state. The clause 'never fetches remote documents' implicitly distinguishes it from the refresh_service / refresh_all_services siblings, though it does not name them directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the read-only listing framing and the no-fetch boundary, which suggests it is the tool to call when inspecting configuration rather than updating it. However, no explicit when-to-use conditions or named alternatives are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

refresh_all_servicesB

Explicitly refresh every configured service. This is the only bulk network operation.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It hints at network activity ('the only bulk network operation') but says nothing about permission requirements, rate limits, latency/cost of a bulk call, failure semantics, or whether refreshing is idempotent or mutates remote state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the action and scope. The second sentence adds a distinguishing trait but is terse enough that nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter refresh tool with no output schema, the description covers what it does but omits behavioral specifics an agent would want before triggering a bulk network operation, especially given the absence of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter (workspace) exists and schema description coverage is 100%, so the schema already explains it. The description adds no meaning about the workspace parameter, which is the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('refresh') and scope ('every configured service'), which distinguishes it from the singular sibling refresh_service by scope. However, it never names refresh_service explicitly, so the differentiation is by implication rather than direct routing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: refresh all services in one call rather than individually. There is no explicit statement of when to prefer this over calling refresh_service repeatedly, no prerequisites, and no when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

refresh_serviceB

Explicitly fetch one remote Swagger/OpenAPI JSON document and overwrite only its local cache.

ParametersJSON Schema
NameRequiredDescriptionDefault
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It usefully discloses that only the single service's local cache is overwritten (blast radius) and that a remote fetch occurs (network dependency). It omits failure behavior if the fetch fails, whether the old cache is preserved, and any auth requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single tight sentence with the resource and scoping constraint front-loaded and no filler. Appropriately sized for a simple refresh action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter mutation with no annotations and no output schema, the description conveys core behavior and cache scoping. It stops short of covering failure semantics, cache invalidation details, or the form of the 'service' argument, leaving some gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 50%: 'workspace' is described in the schema, but 'service' is undocumented in both the schema and the description. The phrase 'one remote Swagger/OpenAPI JSON document' loosely implies service selection but gives no identifier format, so the description does not compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: fetch one remote Swagger/OpenAPI JSON document and overwrite its local cache. The word 'one' implicitly separates it from the refresh_all_services sibling, though that sibling is never named. Clear without opening the schema, but the differentiation is only implied.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Explicitly fetch' hints this is a manual/on-demand refresh rather than an automatic one, implying usage when the cached spec is stale. However, no when-to-use condition, prerequisites, or named alternative (e.g., refresh_all_services) is given, so the routing to siblings is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

remove_serviceB

Remove a service from config. Existing cached document is preserved.

ParametersJSON Schema
NameRequiredDescriptionDefault
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden, and it does disclose one real trait: the cached document survives the removal. That is meaningful beyond the name. However, it omits whether the config file is rewritten, whether removal is reversible, what happens if the service does not exist, and whether confirmation or elevated permissions are needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, zero filler, with the destructive action stated first and the preservation caveat immediately after. Front-loaded and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is minimal but not empty: it tells the agent what is removed and what is kept. It still lacks error behavior, idempotency, and confirmation semantics, which an agent invoking a removal would benefit from.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 50%: workspace is documented in the schema, but service is a bare string. The description adds no meaning for either parameter, so the undocumented 'service' argument is left entirely to inference (name? id? path?). It does not compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Remove a service from config.' An agent can distinguish it from add_service and update_service by the verb alone. It stops short of naming how it differs from sibling mutations like refresh_service, but the core purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this versus update_service (which may also drop entries) or how it relates to refresh_service. There are no prerequisites, no exclusions, and no named alternative. The agent must infer usage purely from the verb.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_operationsB

Search operations only in the local cached document. It never fetches remote Swagger.

ParametersJSON Schema
NameRequiredDescriptionDefault
tagNo
limitNo
methodNoHTTP method, for example GET.
keywordNo
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose one meaningful trait: this is a local-cache-only search that will not go to the network. However, it says nothing about read-only semantics explicitly, pagination behavior, result limits, or what happens on a cache miss.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, zero filler, with the scoping constraint front-loaded. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter tool with no annotations and no output schema, the description is too thin: it omits result format, how parameters interact, and the stale-cache scenario an agent will hit in practice.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 33%, so half the parameters (keyword, tag, limit, service) are undocumented in both schema and description. The description adds no meaning about how keyword/tag/method combine or how limit applies, so it fails to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource - 'Search operations' - and scopes it to the local cached document. It doesn't name sibling tools like get_operation or refresh_service explicitly, but the 'local cached' qualifier implicitly separates it from the refresh tools that fetch remote data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The claim that it never fetches remote Swagger implies the agent should use a refresh tool if the cache is stale, but this is left to inference rather than stated. There is no explicit when-to-use or alternatives guidance relative to get_operation or the service-management tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_serviceB

Update a service URL. It does not fetch the document.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
serviceYes
workspaceYesAbsolute path to the business project that owns .swagger-mcp.

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It does disclose one meaningful behavioral trait: that updating the URL does not trigger a fetch/re-download of the document, which distinguishes it from refresh_service. However, it omits whether permissions are required, whether the change is reversible, and what happens to previously loaded operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loading the core action followed by the key caveat. No filler text, though the second sentence is terse to the point of being slightly cryptic.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter mutation tool with no annotations, no output schema, and only 33% parameter coverage, the description is thin. It leaves unaddressed what happens to the existing URL/operations, permission requirements, and any return behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 33%: workspace is documented inline, but url and service have no descriptions. The description adds no meaning to any parameter (e.g., URL format, whether it must be absolute, or what 'service' identifies), so it fails to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (update a service URL), which is clear against siblings like add_service and remove_service. The second sentence implicitly distinguishes it from refresh_service by clarifying that it does not fetch the document, giving useful sibling differentiation, though it could name refresh_service explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The note 'It does not fetch the document' implies you should use refresh_service when you want the spec fetched, but this is left to inference rather than stated. No explicit when-to-use or prerequisites are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 11 tool updatesv0.1.0
    • First observedadd_service
    • First observedgenerate_request_example
    • First observedget_operation
    • First observedget_schema
    • First observedinit_project
    • First observedlist_services
    • First observedrefresh_all_services
    • First observedrefresh_service
    • First observedremove_service
    • First observedsearch_operations
    • First observedupdate_service

TDQS

A3.5/5.0

Scored across 11 tools

Disambiguation5/5

Each tool targets a clearly distinct action: project setup, service configuration, remote fetching, local search/retrieval, and code generation. Overlap is minimal; refresh_service and refresh_all_services differ explicitly by scope, and search_operations vs get_operation is unambiguous.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern, such as init_project, list_services, refresh_service, and get_operation. No deviations or mixed conventions are present.

Tool Count5/5

With 11 tools, the set is well-scoped for managing Swagger/OpenAPI services, covering setup, service CRUD, refresh, search, retrieval, and example generation without redundancy.

Completeness5/5

The tool surface covers the full lifecycle: project initialization, service add/update/remove/list, explicit local and bulk refresh, operation search and retrieval, schema resolution, and request example generation. No obvious gaps exist for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server providing token-efficient access to OpenAPI/Swagger specs via MCP Resources for client-side exploration.
    234
    76
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    MCP server for loading and exploring OpenAPI/Swagger specifications, enabling AI assistants to dynamically browse API contracts by loading specs, searching endpoints, inspecting schemas, and retrieving operations.
    10
    3
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A read-only MCP server for navigating OpenAPI / Swagger specifications, enabling agents to search endpoints, retrieve parameters and schemas, and inspect authentication without loading the full spec into context.
    9
    19
    MIT