MCP代理GitHub动作

GitHub自定义动作,用于通过HTTP传输隔离MCP与主容器。

  • by githubnext
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 githubnext/gh-aw-mcp-container-action

使用说明

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:代理服务器的URL
  • port:代理正在运行的端口号
  • 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 用于开发说明。