使用 Agent 操作 Tier0
适用版本EdgeCloudEnterprise
通过 MCP 将 AI Agent 连接到 Tier0。Agent 可以在你授予的权限范围内查找并调用平台 API。
使用你偏好的 AI agent 操作 Tier0。
Claude Code
Codex
Gemini CLI
Cursor
GitHub Copilot
连接 Agent
Section titled “连接 Agent”以下以 Codex 为例。
- 在 设置 > 插件 > MCP 中添加 MCP 服务器,填写从 Tier0 获取的 URL。
- 在 Tier0 的 设置 > API Keys > Personal Keys 中创建具有所需权限的个人 API Key。
- 将个人 API Key 添加到 Codex 中的 MCP 服务器:
Terminal window { "Authorization": "Bearer <your-personal-api-key>" } - 让 Agent 调用
whoami,检查连接。
- 在 PowerShell 中运行以下命令,并在浏览器中登录:
Terminal window codex mcp add tier0 --url https://your-tier0-url/mcp --oauth-client-registration dcr - 授权 Workspace 并授予相应权限:
Terminal window codex mcp login tier0 --oauth-client-registration dcr - 让 Agent 调用
whoami,检查连接。
使用 Agent 操作 Tier0
Section titled “使用 Agent 操作 Tier0”| MCP 工具 | 用途 |
|---|---|
whoami |
检查身份和权限。 |
docs |
阅读 API 文档。 |
search |
查找 API 操作。 |
execute |
调用 API 操作。 |
先让 Agent 使用 docs 和 search 找到所需操作,再使用 execute 调用。例如:
读取我的 Workspace 中 `Plant/Line1/Metric/Temperature` 的当前值。- 操作工厂数据 — 了解 Tier0 如何组织和提供工厂数据。