GitHub代理工作流MCP代理操作
此GitHub自定义操作负责在HTTP后面挂载MCP 运输以将MCP与主容器隔离。
输入
所需输入
type(必填):上游连接类型。必须是stdio或
http.
可选输入
对于 stdio 类型:
command:要执行的命令(需要时type是stdio)args:命令参数的JSON数组(例如。,'["arg1", "arg2"]')env:环境变量的JSON对象(例如。,
'{"NODE_ENV": "production"}')
对于 http 类型:
url:HTTP连接的URL(需要时type是http)headers:HTTP标头的JSON对象(例如。,
'{"Authorization": "Bearer token"}')
概述:
container:容器名称container-image:要运行的容器映像container-version:容器版本/标签logs-dir:日志文件目录(默认:./logs)
输出
url:代理服务器的URLport:代理正在运行的端口号token:用于访问代理的API令牌
示例用法
示例1:HTTP上游
- name: Start MCP Proxy
uses: githubnext/gh-aw-mcp-container-action@v1
with:
type: http
url: http://localhost:3000/mcp
headers: '{"Authorization": "Bearer my-token"}'示例2:stdio上游
- name: Start MCP Proxy
uses: githubnext/gh-aw-mcp-container-action@v1
with:
type: stdio
command: node
args: '["mcp-server.js"]'
env: '{"NODE_ENV": "production", "DEBUG": "true"}'示例3:使用容器图像
- name: Start MCP Proxy
uses: githubnext/gh-aw-mcp-container-action@v1
with:
type: http
url: http://localhost:3000/mcp
container-image: my-mcp-server:latest贡献
看 贡献.md 用于开发说明。
