yapi-mcp-zhh
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | Port for HTTP MCP server and demo web UI. Defaults to 43181. | 43181 |
| YAPI_DEMO | No | Set to 'true' to force demo backend (in-memory). Defaults to false. If YAPI_BASE_URL is not set, demo mode is used automatically. | false |
| YAPI_EMAIL | No | YApi login email (or LDAP login name). Required for listing projects, creating interfaces, modifying advanced mock scripts, and managing mock cases. | |
| YAPI_TOKEN | No | Single project token required to modify normal response body (res_body). | |
| YAPI_COOKIE | No | Browser cookie string (_yapi_token=...; _yapi_uid=...). Can be used instead of YAPI_EMAIL and YAPI_PASSWORD for authenticated actions. | |
| YAPI_BASE_URL | No | YApi source URL (no trailing slash). Required when connecting to a real YApi instance. If not set or YAPI_DEMO=true, the server runs in demo mode and does not write to real YApi. | |
| YAPI_PASSWORD | No | YApi login password. Alternatively, use YAPI_COOKIE. | |
| YAPI_PROJECT_ID | No | Default project ID used when the tool omits projectId. | |
| YAPI_INSECURE_TLS | No | Set to 'true' to allow insecure TLS connections for intranet HTTPS with untrusted certificates. | false |
| MCP_HTTP_AUTH_TOKEN | No | Bearer token required for connecting to the HTTP MCP endpoint when using a real YApi. Clients must send it in the Authorization header. | |
| YAPI_PROJECT_TOKENS | No | Comma-separated project tokens in the format 'projectID:token,projectID:token'. Recommended for multi-project setups. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| yapi_list_projectsA | 列出当前账号能看到的 YApi 项目。不知道项目 ID 时先用这个,不必事先配置 YAPI_PROJECT_ID。 |
| yapi_search_interfacesA | 按标题、路径、方法搜索当前 YApi 项目里的接口,不知道 interfaceId 时先用这个。 |
| yapi_create_interfaceB | 在指定 YApi 项目新建接口。需要登录账号。不传 catId 时优先用「公共分类」,否则用第一个分类。 |
| yapi_get_interface_mockA | 读取接口的 res_body(普通 Mock 文档 / JSON Schema)以及 mock URL。 |
| yapi_update_interface_mockB | 更新接口返回体文档(普通 Mock)。高级脚本和期望请用对应工具。 |
| yapi_get_advanced_mockC | 读取高级 Mock 自定义脚本。需要 YAPI_EMAIL/YAPI_PASSWORD 或 Cookie。 |
| yapi_update_advanced_mockB | 覆盖保存高级 Mock 脚本。官方插件接口不在项目 token 白名单里,必须走登录态。 |
| yapi_list_mock_casesB | 列出接口的高级 Mock 期望。 |
| yapi_save_mock_caseB | 新增或更新一条 Mock 期望。更新时传 caseId。 |
| yapi_delete_mock_caseC | 删除一条 Mock 期望。 |
| yapi_call_mockB | 请求 mock URL,确认写入是否生效。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 11 tools
工具总体职责分明:普通 Mock、高级 Mock、Mock 期望、项目/接口查询分别有明确入口。唯一可能混淆的是 get_interface_mock 与 get_advanced_mock、update_interface_mock 与 update_advanced_mock,但描述中明确区分了普通与高级。
全部工具统一使用 yapi_ 前缀 + 动词_名词的 snake_case 模式,如 list_projects、create_interface、save_mock_case,规律一致,易于预测。
11 个工具围绕 YApi Mock 配置和项目/接口发现展开,数量适中,没有冗余或缺失明显的工具。
覆盖了普通 Mock 读写、高级 Mock 读写、Mock 期望的增删查、接口搜索/创建和项目列举,能支撑主要工作流。但缺少接口更新/删除等操作,若超出 Mock 配置场景会有缺口。