Oplink
使用MCP应用程序创建自己的无代码工作流。Oplink将多个MCP服务器组合成您在简单的YAML文件中定义的统一工作流。
✨ 为什么选择Oplink?
🚀 *无代码代理工作流* --只需编辑yaml文件即可创建自己的代理工作流
🧩 *一个端点,多台服务器* --将任何MCP服务器(如Chrome DevTools、shadcn、Context7等)捆绑在单个MCP服务器条目后面。
🛡️ *引导式提示和模式* --每个工作流都公开了键入的参数、指令和精心策划的辅助工具。
💾 *上下文高效发现* — 麦克波特 将工具模式缓存在内存中,以便代理通过以下方式发现工具 describe_tools 而无需用数十个外部命令淹没MCP客户端。只有您策划的工作流才会出现在工具列表中。
🧠 *适用于任何MCP客户端* --Cursor、Claude Code、Codex、Windsurf和朋友可以在没有自定义粘合代码的情况下运行复杂的流。
想象一下,你正在调试一个前端问题,需要:
- Chrome 开发者工具 检查浏览器、捕获屏幕截图和分析网络请求
- 影电 了解组件API并获取最新的库文档
如果没有Oplink,您需要在多个MCP服务器之间手动协调,切换上下文并将结果拼凑在一起。使用Oplink,您可以定义一个 frontend_debugging 在一次调用中协调两个服务器的工作流。
概述
Oplink将基于YAML的工作流定义转换为可执行的MCP工具。与仅在提示中引用工具名称的工具不同,Oplink实际上可以执行您通过轻量级注册表连接的外部MCP工具(.mcp-workflows/servers.json).
Oplink将多个MCP服务器组合成统一的工作流程。 在YAML中定义提示和工具序列,通过一个简单的注册表连接外部MCP服务器,并将所有内容作为一个可在任何MCP客户端(Cursor、Claude、Windsurf等)中工作的MCP工具公开。
示例:前端调试工作流
frontend_debugging:
description: "Debug frontend issues using Chrome DevTools and shadcn components"
prompt: |
Analyze the reported issue systematically.
Use Chrome DevTools to inspect the browser state and capture diagnostics.
Reference shadcn component documentation to understand the UI library.
externalServers:
- chrome-devtools
- shadcn一个工作流,多个服务器,无缝执行。这就是Oplink存在的原因。
安装
npx -y oplink@latest init光标配置
{
"mcpServers": {
"oplink-get-docs": {
"command": "npx",
"args": [
"oplink@latest",
"server",
"--config",
"examples/deepwiki-demo/.mcp-workflows"
]
},
"oplink-frontend-debugging": {
"command": "npx",
"args": [
"oplink@latest",
"server",
"--config",
"examples/frontend-mcp-demo/.mcp-workflows"
],
"env": {
"FRONTEND_ROOT": "/path/to/oplink/examples/frontend-mcp-demo"
}
}
}
}自定义配置
{
"mcpServers": {
"oplink": {
"command": "npx",
"args": [
"oplink@latest",
"server",
"--config",
"/path/to/.mcp-workflows"
]
}
}
}配置
创建一个 .mcp-workflows 目录并添加YAML工作流文件:
debug_workflow:
description: "Debug application issues"
prompt: |
Analyze the issue systematically.
Gather logs and error information.
externalServers:
- your-server-aliasMCP服务器注册表
外部工具通过以下方式解决 .mcp-workflows/servers.json每个条目都将一个友好的别名映射到MCP服务器定义(stdio命令或HTTP端点)。使用 ${ENV_VAR} 秘密占位符。当你跑步时 --config ,Oplink自动加载 .env 在展开占位符之前,请先从该目录中选择文件(优先级:shell> .env.{NODE_ENV}.local > .env.{NODE_ENV} > .env.local > .env).你不需要 mcporter.json 让Oplink运行。
{
"servers": {
"context7": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"],
"env": { "CONTEXT7_TOKEN": "${CONTEXT7_TOKEN}" }
},
"grafana": {
"type": "http",
"url": "https://grafana.example.com/mcp",
"headers": { "Authorization": "Bearer ${GRAFANA_TOKEN}" }
}
}
}别名(context7, grafana等等)变为 server 在脚本化工作流步骤中引用外部工具时使用前缀(例如, chrome-devtools:take_screenshot).如果工作流中引用的别名丢失、注册表格式错误或无法解析环境占位符,则启动失败。
看 examples/context7-demo/ (上下文7)和 examples/deepwiki-demo/ (DeepWiki),用于通过此注册表+工作流对将真实的MCP服务器连接到Oplink的即用型设置。
自动工作流(零配置)
要公开MCP服务器而不编写自定义步骤,请使用以下命令声明工作流 externalServers.Oplink现在为每个工作流公开一个工具 和 内置船只 describe_tools 助手,以便代理可以动态发现代理命令。建议流量为:
- 呼叫
describe_tools({ "workflow": "frontend_debugger" })检索缓存的目录(名称、描述、JSON模式、上次刷新时间)。 - 从响应中选择一个工具,并调用工作流
{ "tool": "name", "args": { ... } }.
每个自动工作流提示都会自动附加一个提醒以运行 describe_tools 首先,所以你不必手动提及它——不过如果你想提供额外的上下文,你仍然可以自定义提示文本。
frontend_debugger:
description: "Chrome DevTools helper"
prompt: |
Use Chrome DevTools MCP tools (e.g., take_screenshot, list_network_requests).
Provide {"tool": "name", "args": { ... }} when calling this workflow.
externalServers:
- chrome-devtools
shadcn_helper:
description: "shadcn helper"
prompt: |
Use shadcn MCP tools to list/search components.
externalServers:
- shadcn
full_helper:
description: "Chrome DevTools + shadcn"
prompt: |
Access Chrome DevTools and shadcn MCP tools from one workflow.
externalServers:
- chrome-devtools
- shadcn使用以下命令调用工作流:
tool:工具名称(例如。,take_screenshot或chrome-devtools:take_screenshot).server:可选,除非您配置了多个别名(如full_helper)并且没有在工具前加前缀。args:arguments对象已转发到MCP工具。
describe_tools({
"workflow": "frontend_debugger"
})
frontend_debugger({
"tool": "take_screenshot",
"args": {
"url": "https://example.com",
"format": "png"
}
})describe_tools 接受可选筛选器,例如 aliases, search, limit,以及 refresh.Set refresh: true 如果在更改上游MCP服务器后需要强制重新发现。使用自动工作流进行快速连接,然后在需要策划的流程、默认值或多步编排时切换到脚本工作流(见下文)。
可选的每个工具代理
默认情况下,Oplink将MCP界面限制为您的工作流和辅助工具(describe_tools, external_auth_setup).如果你想曝光 *每* 外部MCP工具作为其自己的MCP工具(例如。, deepwiki.read_wiki_structure)您可以通过设置选择加入 OPLINK_AUTO_REGISTER_EXTERNAL_TOOLS=1 启动服务器之前(或通过传递 autoRegisterExternalTools: true 通话时 createMcpServer).这主要用于调试或客户端无法调用时 describe_tools同样地 oplink_info 助手仅在以下情况下注册 OPLINK_INFO_TOOL=1 (或 includeInfoTool: true)用于对构建进行故障排除。
脚本化工作流步骤
现代Oplink工作流完全在服务器上运行:您声明要执行的外部步骤,MCP客户端只看到高级工具(例如。, frontend_debugger).每一步都使用外部MCP工具 alias:tool 格式从 servers.json 并且可以从工作流参数中模板化参数。
take_screenshot:
description: "Capture screenshots for docs or testing"
runtime: scripted
parameters:
url:
type: string
required: true
wait_for:
type: string
description: "Optional text to wait for"
format:
type: string
enum: [png, jpeg, webp]
default: png
steps:
- call: chrome-devtools:navigate_page
args:
type: url
url: "{{ url }}"
ignoreCache: false
- call: chrome-devtools:wait_for
requires: wait_for
args:
text: "{{ wait_for }}"
timeout: 10000
- call: chrome-devtools:take_screenshot
args:
fullPage: true
format: "{{ format }}"runtime: scripted告诉Oplink通过mcporter在服务器端执行这些步骤。requires除非指定的参数(或保存的值)为真,否则跳过该步骤。- 参数可以使用
{{ paramName }}模板。 - 只有工作流工具(
take_screenshot)暴露于MCP客户端;chromedevtools帮助程序保持在内部。 - 默认参数,如
format保持快乐路径简单(没有额外的参数),同时允许在需要不同图像类型时进行覆盖。 - 添加
quiet: true如果你不想让运行者为该调用发出“步骤X”日志(对于已经返回二进制内容的截图步骤很有用)。
仅提示工作流
对于只需要提示而不需要外部工具执行的简单工作流,可以使用参数注入:
thinking_mode:
description: "Reflect on thoughts"
parameters:
thought:
type: "string"
description: "The thought to reflect upon"
required: true
context:
type: "string"
description: "Additional context"
prompt: |
Deeply reflect upon: {{ thought }}
Consider this context: {{ context }}
Analyze implications and tradeoffs.例子
存储库包括以下示例配置 examples/ 显示仅提示和脚本工作流。在中创建自己的YAML时使用这些作为参考 .mcp-workflows/.
外部工具集成
Oplink使用 麦克波特 在引擎盖下连接到外部MCP服务器,但它从读取注册表 .mcp-workflows/servers.json 在你选择的 --config 目录。
- 在中定义服务器
.mcp-workflows/servers.json(见上面的例子) - 参考工具
server:tool脚本化工作流步骤内部 - 只有工作流工具本身暴露给MCP客户端;辅助工具仍为内部工具
工具调用流程:
MCP Client → Oplink → mcporter Runtime → External MCP Server → Result外部工具在启动时被发现,用模式哈希缓存,并通过 describe_tools 而不是用数十个代理命令淹没MCP客户端。缓存过期时会自动刷新,您可以通过调用 describe_tools({ "workflow": "name", "refresh": true }) 如果上游服务器改变。
另请参见:
- 高级:Oplink如何使用mcporter→
docs/oplink-docs/content/5.advanced/3-mcporter.md - 高级:外部MCP服务器的Auth(API密钥,OAuth)→
docs/oplink-docs/content/5.advanced/4-authentication.md
连接到托管的MCP服务器(OAuth)
像Linear这样的托管提供商通过HTTPS/SSE公开MCP服务器,并期望OAuth流。mcporter0.5+已经处理了浏览器/设备舞蹈,所以每个服务器只需要一个配置条目:
"linear": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"],
"auth": "oauth",
"clientName": "oplink-linear-demo",
"oauthRedirectUrl": "http://127.0.0.1:43115/callback",
"tokenCacheDir": "./.tokens/linear",
"env": {
"MCP_REMOTE_CLIENT_ID": "${LINEAR_CLIENT_ID}",
"MCP_REMOTE_CLIENT_SECRET": "${LINEAR_CLIENT_SECRET}"
}
}笔记:
type: "stdio"+npx mcp-remote允许Oplink生成托管服务器,即使它位于HTTPS上。- mcporter将刷新令牌缓存在
tokenCacheDir,因此OAuth提示只发生一次。 - 如果您喜欢动态注册,请跳过客户端ID/secret提示——mcporter将在第一次工具调用期间打开浏览器。
- 跑
pnpm bootstrap:linear复制示例配置并(可选)将凭据注入examples/linear-discord-demo/.mcp-workflows/servers.json.
要检查任何别名公开的工具,请重用相同的配置目录:
npx mcporter list linear --config examples/linear-discord-demo/.mcp-workflows
For Discord in the demo, export `DISCORD_BOT_TOKEN` in your shell; Oplink maps it to `DISCORD_TOKEN` for the MCP server defined in `examples/linear-discord-demo/.mcp-workflows/servers.json`.需求
- Node.js 18+或20+
- 可选:mcporter CLI用于本地检查(
npx mcporter list --config path/to/.mcp-workflows) - MCP客户端(光标、克劳德桌面等)
故障排除
- 缺失
FRONTEND_ROOT(shadcn):设置export FRONTEND_ROOT=$(pwd)/examples/frontend-mcp-demo或将其设置在MCP客户端条目下env块。 - Chrome无法启动:请确保Chrome已在本地安装并启动。对于远程/调试Chrome,请单独启动它,并根据其文档更新Chrome DevTools服务器标志。
- 没有工具出现:确认
--config指向预期.mcp-workflows目录,您的IDE获取了MCP服务器条目。 - 工具目录看起来过时:运行
describe_tools({ "workflow": "name", "refresh": true })在更改上游MCP服务器后强制重新发现。
发展
# Install dependencies
pnpm install
# Build packages
pnpm build
# Run tests
pnpm test
# Start development server
cd packages/oplink
pnpm dev定义
Oplink是一个MCP服务器,通过将提示与外部MCP工具执行相结合来编排工作流。它将您的工作流定义与配置了mcporter的MCP服务器连接起来,实现了自动工具发现和执行。
鸣谢
许可证
麻省理工学院
仓库
https://github.com/instructa/oplink
- Chrome DevTools屏幕截图错误:如果工作流调用
chrome-devtools:take_screenshot未具体说明format,DevTools拒绝该请求。提供的示例设置了默认值(png)并允许您通过format/screenshot_format参数。
