mcpField
E
enginegate

enginegate

本地服务
github.com/CloudCorpRecords开发工具02 周前更新

关于 enginegate

enginegate 是供 Agent 连接运行中 Unreal Editor 的 MCP 网关。它以一个工具提供搜索、查看、执行和配置编辑器能力的操作,并将调用转发到编辑器的本地 MCP 端点。

主要功能

  1. 01用自然语言搜索编辑器能力
  2. 02查看能力契约
  3. 03执行编辑器能力
  4. 04配置启用的能力组
  5. 05将调用转发至编辑器 MCP 端点

适用场景

  1. 01为任务查找编辑器能力
  2. 02使用前查看能力契约
  3. 03通过 MCP 执行 Unreal Editor 操作
  4. 04配置可用的能力组

MCP 相关

向 MCP 客户端提供一个 unreal 工具,并将其操作转发到运行中 Unreal Editor 的本地 MCP 端点。编辑器必须正在运行且该端点可用。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"cloudcorprecords-enginegate": {
"command": "npx",
"args": [
"-y",
"@reneturcios/enginegate"
]
}
}
}
启动命令npx -y @reneturcios/enginegate

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@reneturcios/enginegate0.1.0
ocighcr.io/cloudcorprecords/enginegate:0.1.0

工具

1

收录的工具列表 · 更新于 1 周前

参数类型必填说明
toolstring否内部工具名称,例如 control_actor。describe 和 execute 必需(除非提供了 capability)。
querystring否用普通词语搜索功能,例如 'spawn actor'。search 必填。
actionstring否工具中的操作,例如 spawn。execute 必填(除非提供 capability)。
paramsobject否要执行的功能的参数。
consentstring否describe 为破坏性功能返回的同意授权;执行这些功能时必填。
operationenum是要执行的网关操作。search | describe | execute | configure
capabilitystring否功能 ID,例如 control_actor.spawn;可在 execute 中替代 tool+action。

详细介绍

enginegate

enginegate 为 Agent 提供一个通往正在运行的 Unreal Editor 的统一入口。它不再暴露一长串编辑器工具,而是提供一个网关工具 unreal,包含四种操作:用通俗语言搜索编辑器功能、在使用某项功能前读取其契约、执行某项功能,以及配置启用哪些功能组。

每次调用都会转发到编辑器自己的本地 MCP 端点,因此只有在运行着具有该端点的编辑器时,enginegate 才能工作。如果编辑器未运行,调用会返回包含底层连接问题的错误——enginegate 绝不会伪造编辑器结果。

安装

npx @reneturcios/enginegate call '{"operation":"search","query":"spawn actor"}'

也可以运行容器映像:

docker run -i ghcr.io/cloudcorprecords/enginegate

容器默认启动 MCP 服务(见下文)。传入 CLI 参数即可将其用作 CLI。

配置

环境变量含义
UNREAL_MCP_URL编辑器的 MCP 端点。默认值:http://127.0.0.1:3000/mcp
MCP_AUTOMATION_CAPABILITY_TOKEN设置后,每次转发调用时都会将其作为 X-MCP-Capability-Token 标头发送。

CLI

# Search capabilities in plain words
enginegate call '{"operation":"search","query":"spawn actor"}'

# Read one internal tool's contract
enginegate call '{"operation":"describe","tool":"control_actor"}'

# Execute a capability by tool + action, or by capability id
enginegate call '{"operation":"execute","tool":"control_actor","action":"spawn","params":{"class":"PointLight"}}'
enginegate call '{"operation":"execute","capability":"control_actor.spawn","params":{"class":"PointLight"}}'

# Configure capability groups
enginegate call '{"operation":"configure","tool":"control_actor","params":{"enabled":true}}'

enginegate --version

退出码:成功时为 0;调用未通过验证、无法连接到编辑器或编辑器返回错误时为 1;用法错误时为 2。

转发任何内容前都会先检查参数要求,并在错误中指出缺少的字段:

  • search 需要 query
  • describe 需要 tool
  • execute 需要 tool + action,或 capability
  • configure 需要 tool 或 params

MCP 服务

一个二进制文件支持这两种用法。mcp 子命令会启动一个 stdio MCP 服务:

npx -y @reneturcios/enginegate mcp

MCP 客户端配置:

{
  "mcpServers": {
    "enginegate": {
      "command": "npx",
      "args": ["-y", "@reneturcios/enginegate", "mcp"]
    }
  }
}
工具
工具输入功能
unrealoperation(必填;取值为 search、describe、execute、configure 之一),以及各操作对应的字段:query、tool、action、capability、params、consent将调用转发到正在运行的编辑器网关。describe 会返回某项功能的契约——包括破坏性功能所需的同意授权;执行这些功能时,必须将该授权作为 consent 传回。

转发的调用是针对工具名称 unreal 的 JSON-RPC tools/call 请求。编辑器端点可能返回普通 JSON 正文,也可能返回服务器发送事件流;两种格式都会解析,调用方收到的内容是编辑器自身的结果文本(以及错误标记)。

开发

npm install
npm run build   # tsc -> dist/
npm test        # node test runner over test/*.test.ts, no network
npm run dev     # run the CLI from source via tsx

许可证

MIT — 参见 LICENSE。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。