knife4j-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | 日志级别,设为 debug 时会输出更多拉取和解析过程日志。 | |
| CACHE_TTL_MS | No | 内存缓存有效期,单位毫秒,默认值 300000(5分钟)。 | |
| SWAGGER_HEADERS | No | 额外附带到所有文档请求上的自定义 HTTP Header,格式为 JSON 字符串,例如 {"X-Env":"dev","X-Token":"abc"}。 | |
| SWAGGER_BASE_URL | No | 用于补全 swagger-resources 里返回的相对路径。未设置时默认回退到 SWAGGER_RESOURCES_URL 的基址。 | |
| SWAGGER_BASIC_AUTH | No | 访问 Swagger 文档时使用的 HTTP Basic Auth 账号密码,格式 username:password。 | |
| SWAGGER_RESOURCES_URL | Yes | Knife4j / Swagger 聚合入口地址,用来读取模块列表。例如:http://127.0.0.1:3301/swagger-resources | |
| SWAGGER_MODULE_ALLOWLIST | No | 只加载指定模块,其他模块会被忽略。格式为逗号分隔,例如 sample-account,sample-auth。 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_specsA | List aggregated Knife4j / Swagger modules and their loading status. Use this for module discovery and diagnostics, not for reading API details or fetching spec URLs directly. |
| find_apiA | Find candidate APIs by path, keyword, tag, module, or method. After locating a candidate, call get_api_detail with its module, path, and method to read the full indexed API documentation instead of fetching Swagger/OpenAPI spec URLs directly. |
| get_api_detailA | Preferred tool for full API documentation. Use module + exact path + HTTP method to read the server-indexed API detail, including recursively expanded request and response schemas. Do not fetch /v2/api-docs, /v3/api-docs, or spec URLs directly. |
| refresh_specsA | Force a reload of swagger-resources and all module specs while keeping partial failures isolated. Use this when upstream docs changed or when a previous lookup returned stale results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chaselen/knife4j-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server