eolink-mcp
This MCP server lets AI assistants query Eolink Apikit API documentation in a read-only way via the provided schema.
List all projects in the Eolink workspace.
List interface groups within a project.
Search APIs by keyword, group, or status.
Find an API by exact or prefix path.
Get full details for a single API.
Export a project or selected groups as OpenAPI/Swagger JSON.
Note: The README mentions write tools, but the provided server schema exposes only read-only tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@eolink-mcp Look up the API endpoint /api/v1/login and give me its full definition"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
eolink-mcp
An MCP server that lets AI assistants (Claude Code, etc.) query API documentation from any Eolink Apikit instance — SaaS or private deployment — via the Eolink Open API.
安装
npm install -g @huberyhe/eolink-mcp # 推荐:全局安装,多实例无竞态
# 或
npx @huberyhe/eolink-mcp # 免安装直接运行(首次需下载)多个 Claude Code 实例同时冷启动时,npx 共用缓存可能偶现竞态导致
not found。全局安装可完全避免。
Related MCP server: Apifox MCP Server
提供的工具
查询(只读)
工具 | 用途 | project_id |
| 配置自检:配置项/连通性/鉴权逐项体检,并标明各项来源(排障第一步) | 不需要 |
| 列出空间所有项目(第一步) | 不需要 |
| 列出指定项目的接口分组树 | 必填 |
| 按关键字/分组/状态模糊搜索接口(匹配名称/URL/Tag) | 必填 |
| 按 api_path 精确/前缀查找接口 | 必填 |
| 按 api_id 获取单个接口的完整定义(请求/响应参数) | 必填 |
| 导出整个项目为 OpenAPI JSON(兜底全量) | 必填 |
写入(会改动 Eolink 文档)
工具 | 用途 | project_id |
| 新增 HTTP 接口(不传 api_id) | 必填 |
| 修改已有接口(传 api_id) | 必填 |
| 新增接口分组 | 必填 |
⚠️ 写工具默认启用,AI 可直接增改接口文档。修改建议先
get_api_detail确认当前内容。Eolink Open API 不开放删除接口,删除请到 Eolink 后台手动操作。写操作经/index.php/入口,add_group使用 form-urlencoded 格式——这些差异已内置处理,使用者无需关心。参数类型param_type用数字(0=string 3=int 2=json 8=boolean 等)。
典型流程:list_projects → search_apis 或 find_api_by_path(带 project_id)→ get_api_detail。
按名称找用
search_apis;按 URL 找用find_api_by_path(exact等值 /prefix前缀),比模糊搜索更精准。
配置
配置项支持命令行参数与环境变量两种来源,命令行参数优先。两者可混用—— 只传部分参数时,其余项自动回落到环境变量。
命令行参数 | 环境变量 | 必填 | 说明 |
|
| 是 | Eolink 实例 Open API 地址,如 |
|
| 是 | Open API 令牌(对应请求头 |
|
| 是 | 工作空间 ID |
|
| 否 | 禁用代理解析(默认自动读 |
|
| 否 | 启动时联网校验凭据有效性(见下) |
| — | 否 | 打印用法 |
--key=value 与 --key value 两种写法都支持;值本身以 - 开头时必须用 = 形式
(如 --token=-abc123),否则会被当成另一个参数。开关类参数(--no-proxy、--verify-on-start)
不接受值,关闭请直接去掉该参数。--help 与配置错误信息走 stderr(stdio 下 stdout 被 MCP 协议占用)。
# 全走命令行参数
eolink-mcp --base-url https://your-eolink.example.com --token <token> --space-id <id>
# 也可混用:token 走参数,其余走环境变量
eolink-mcp --token <token>在 MCP 客户端里通过 args 传参:
{
"mcpServers": {
"eolink": {
"command": "eolink-mcp",
"args": ["--base-url", "https://your-eolink.example.com",
"--token", "your-token", "--space-id", "your-space-id"]
}
}
}安全提示:参数写在
args里会明文出现在客户端配置文件中;更重要的是, 命令行参数在进程存活期间可通过ps或/proc/<pid>/cmdline被同机其他用户读到, 而环境变量/proc/<pid>/environ仅属主可读。因此多用户 / 共享主机上建议用env而非args传令牌;args更适合单用户桌面或调试场景。 无论哪种方式,都注意不要提交到版本库。
启动时的配置校验
分两层,边界是「能否在本地判定」:
本地校验(始终生效):三个配置项缺失、或 base url 不是合法 http(s):// 地址时,
启动即打印明确错误并 exit(1)(base url 与 token 的错误会标明生效来源);token 短于 16 字符时打告警但不退出。
参数层面的问题一律告警但不退出(避免客户端往 args 塞入自身参数时误伤),包括:
无法识别的参数、空值参数(如 --token "",会回落到环境变量)、
以及给开关类参数传值(如 --no-proxy=false——开关不接受值,关闭请直接去掉该参数)。
联网校验(默认关闭):token 格式合法但实际无效(如填错、已过期)时,
本地无从判断,默认要等到调用工具才报错。加 --verify-on-start(或设
EOLINK_VERIFY_ON_START=1)可改为启动时用一次 project/search 探测
(5 秒超时、不重试),凭据无效则立即 exit(1)。
默认关闭是因为启动时联网探测会拖慢启动,且内网不通/代理未就绪/Eolink 抖动时会把 「临时不可达」误判成「配置错误」而拒绝启动。需要「配置错了就当场失败」时再开启。
无论是否开启,任何时候都可用 eolink_health_check 按需体检。
Claude Code
方式一:全局 bin(推荐,多实例安全)
npm install -g @huberyhe/eolink-mcp@1.2.0然后在 ~/.claude.json 的 mcpServers 中添加:
{
"mcpServers": {
"eolink": {
"command": "eolink-mcp",
"args": [],
"env": {
"EOLINK_BASE_URL": "https://your-eolink.example.com",
"EOLINK_TOKEN": "your-open-api-secret-key",
"EOLINK_SPACE_ID": "your-space-id"
}
}
}
}方式二:npx(免安装)
{
"mcpServers": {
"eolink": {
"command": "npx",
"args": ["-y", "@huberyhe/eolink-mcp"],
"env": { ... }
}
}
}npx 首次需下载,多实例冷启动偶现缓存竞态。长期使用推荐全局安装。
本地调试:可在配置中保留两条入口,正式用全局 bin,改代码后用 dist 直连:
"eolink": { "command": "eolink-mcp" }, // 日常
"eolink_test": { "command": "node", "args": ["dist/index.js"] } // 调试用 claude mcp list 查看连接状态。
其它 MCP 客户端
任何支持 stdio MCP server 的客户端都适用:command 为 eolink-mcp(全局安装)或 npx -y @huberyhe/eolink-mcp(免安装),env 同上。
获取凭证
在 Eolink 后台「空间设置 / 开放 API」处生成 Open API 令牌(即 Eo-Secret-Key);space_id 为工作空间标识;
base url 为实例 Open API 根地址。三者都可用 --base-url / --token / --space-id 参数
或对应的 EOLINK_* 环境变量传入。
代理
访问 Eolink 实例(尤其私有化内网部署)常需经代理。本 server 自动读取 HTTP(S)_PROXY 环境变量;
用 --no-proxy 或设 EOLINK_NO_PROXY=1 可禁用。
排障
遇到任何 eolink_* 工具报错,先调用 eolink_health_check —— 它会逐项报告配置项、各自的来源(命令行参数 / 环境变量)、连通性与鉴权状态,并明确指出该改哪一项。令牌只显示遮蔽后的形态(如 8SnX…75d7),不会回显明文。
常见故障与对策:
现象 | 原因 | 对策 |
| token 无效或未传;或复制时带了空格/换行 | 到后台「空间设置 / 开放 API」重新生成;本 server 已自动 trim 首尾空白。注意参数会覆盖环境变量,若两处都配了以参数为准 |
|
| 先用 |
启动即失败、 | 缺少必需配置项,或 base url 不是合法地址 | fail-fast 设计;用 |
| base url 写错、内网不通或代理未生效 | 核对 base url( |
| base url 指到了网页根地址而非 Open API 根地址 | 填实例根地址即可(如 |
| 导出/搜索的响应体超过保护上限(实测单项目全量导出可达 12MB) | 缩小范围: |
配置层面已内置的容错:base url 自动去尾随斜杠,token / space id 自动 trim 首尾空白;
空的命令行参数值(如 --token "")不会覆盖已有的环境变量。
本地开发
git clone https://github.com/huberyhe/eolink-mcp.git && cd eolink-mcp
npm install && npm run build # 产物在 dist/index.js改代码后 npm run build,重启 MCP 即生效。可在 ~/.claude.json 中保留两条入口:
"eolink": { "command": "eolink-mcp" }, // 正式,走 npm
"eolink_test": { "command": "node", "args": ["dist/index.js"] } // 调试,改代码即生效测试用 MCP Inspector(配置可用 -e 传环境变量,或直接在 -- 后追加命令行参数):
npx @modelcontextprotocol/inspector --cli --transport stdio \
-e EOLINK_BASE_URL=xxx -e EOLINK_TOKEN=xxx -e EOLINK_SPACE_ID=xxx \
--method tools/list -- node dist/index.js
# 或走命令行参数
npx @modelcontextprotocol/inspector --cli --transport stdio \
--method tools/list -- node dist/index.js \
--base-url xxx --token xxx --space-id xxx查看可用参数:
node dist/index.js --helpLicense
MIT
Available Tools
6 toolseolink_export_openapi导出 Eolink 接口文档ARead-onlyIdempotent
导出指定项目(或指定分组)的接口文档为 OpenAPI/Swagger JSON,适合一次性全量获取。
参数:
project_id:项目 ID(必填)
group_ids:可选,只导出指定分组
注意:全量导出可能很大,会自动按字符上限截断。日常查询单个接口建议用 eolink_search_apis + eolink_get_api_detail。
Inputs: project_id (required), group_ids.
eolink_find_api_by_path按 URL 精确查找 Eolink 接口ARead-onlyIdempotent
按接口路径(api_path)精确查找接口,规避 eolink_search_apis 的模糊分词噪声。
内部拉取项目下全部接口后在 server 端按 api_path 匹配,只返回真正匹配的接口。
参数:
project_id:项目 ID(必填)
api_path:接口路径,如 user/user/list(可带前导 /)
match_mode:exact=完全相等(默认),prefix=以给定值开头
返回匹配接口的 api_id、api_name、api_path、method 等。拿到 api_id 后用 eolink_get_api_detail 看完整定义。
Inputs: api_path (required), project_id (required), match_mode.
eolink_get_api_detail获取 Eolink 接口详情ARead-onlyIdempotent
获取单个 HTTP 接口的完整定义:基础信息、请求头、query 参数、restful 参数、请求体参数、响应结构(含 mock 示例)。
参数:
project_id:项目 ID(必填)
api_id:接口 ID(先用 eolink_search_apis 搜索得到)
返回 Markdown 格式的接口文档,包含每个参数的名称、类型、是否必填、说明、示例值。
Inputs: api_id (required), project_id (required).
eolink_list_groups列出 Eolink 接口分组ARead-onlyIdempotent
列出指定项目下的所有接口分组(含子分组),用于了解接口按业务模块的组织结构。
参数:
project_id:项目 ID(先用 eolink_list_projects 获取)
返回分组树,每个分组含 group_id、group_name、parent_group_id,子分组在 group_child_list 里。
典型用法:本工具拿到 group_id 后,用 eolink_search_apis 的 group_ids 过滤某模块下的接口。
Inputs: project_id (required).
eolink_list_projects列出 Eolink 项目ARead-onlyIdempotent
列出当前 Eolink 工作空间下的所有项目(调用 /v2/api_studio/management/project/search)。
不需要参数。返回每个项目的 project_id 和 project_name(以及创建人、是否归档)。
这是使用其它工具前的第一步:拿到目标项目的 project_id,再在 list_groups / search_apis / get_api_detail / export_openapi 调用时显式传入。
Inputs: no named parameters.
eolink_search_apis搜索 Eolink 接口ARead-onlyIdempotent
按关键字、分组或状态搜索指定项目里的接口,返回接口列表(api_id、名称、URL、方法、分组等)。
这是查接口最常用的入口。拿到 api_id 后,用 eolink_get_api_detail 获取完整定义。
参数:
project_id:项目 ID(必填,先用 eolink_list_projects 获取)
keyword:搜索关键字(匹配名称/URL/Tag),可选
group_ids:分组 ID 数组,可选(先用 eolink_list_groups 拿)
api_status:状态过滤,可选
limit:返回数量上限(默认 30)
返回每个接口的 api_id(后续取详情要用)、api_name、api_path、method、group_name 等。
Inputs: project_id (required), limit, keyword, group_ids, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct operation: listing projects, listing groups, searching APIs, finding by exact path, retrieving detail, and exporting. No two tools overlap in purpose; even the two search-like tools (search_apis and find_api_by_path) use different matching strategies (fuzzy vs exact).
All tool names follow a consistent 'eolink_verb_noun' pattern (e.g., eolink_list_projects, eolink_search_apis). No mixing of camelCase, snake_case, or inconsistent verb styles.
With 6 tools covering project discovery, group navigation, API search and details, and export, the set is well-scoped for an API documentation server. Each tool serves a clear purpose without unnecessary weight.
The tool surface covers the full read lifecycle: discover projects, browse groups, find APIs (by search or exact path), inspect full detail, and export the entire project. No obvious gaps for a consumer of API documentation.
Related MCP Connectors
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
Access and search Branch's official API documentation directly within any AI agent or client.
Search 16,000+ API operations and 95 built tools by need, then call any of them by name
Find, write, publish and check pages and API references in your DeveloperHub docs from an AI client
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceEnables AI assistants to access and search RAP2 API documentation, allowing users to query interface details, search APIs by keywords, and retrieve repository interfaces through natural language.77 npm-
- AlicenseAqualityDmaintenanceEnables AI assistants to fetch and understand API endpoint definitions from Apifox projects in real-time. Supports retrieving complete API specifications including request methods, parameters, headers, and response schemas to improve development efficiency and code generation quality.123 npm5MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI tools to search and explore API documentation from Apidog projects or OpenAPI/Swagger specifications, providing endpoint details, schemas, and project statistics through natural language queries.1,398 npm1ISC
- AlicenseAqualityDmaintenanceExposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.1420 npm2MIT