UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

UIP 智能体中心

“uip agenthub MCP”的语法和选项,用于注册和管理 AgentHub MCP 服务器 — 编码智能体和低代码智能体可以调用的工具。

uip agenthub用于管理UiPath AgentHub :MCP(模型上下文协议)服务器注册及其工具,以及远程 A2A(智能体到智能体)智能体注册。AgentHub MCP 服务器是一个已命名的文件夹作用域资源,它将一组可调用工具公开给编码智能体和低代码智能体——不要与 MCP 线路协议本身混淆,后者是客户端在运行时实际调用这些工具的方式。

该资源分为两个页面:

  • 本页— 概念和mcp (注册、列出、更新、删除 MCP 服务器)。
  • mcp-tools和remote-a2a-agent — 管理附加到 MCP 服务器的工具,以及远程 A2A 智能体注册。

概念​

  • 服务器类型在创建时是固定的,之后不可变。类型枚举中存在八个命名类型(uipath、command、coded、selfhosted、remote、process-assistant、platform、swagger),每种类型映射到一个数字连线值 (分别为 0–7)。八个中只有六个具有有效的mcp create <type>叶子: uipath 、 coded 、 command 、 remote 、 platform 、 swagger 。selfhosted 和 process-assistant 出现在类型枚举中、mcp template 的接受类型中,甚至在此命令自己的帮助文本中提供了示例 — 但没有在源文件中的任何位置注册 mcp create selfhosted 或 mcp create process-assistant 子命令。尝试任一操作均因未知命令而失败。mcp update <slug>按服务器的现有类型(从 API 获取)调度,因此不存在这样的差距,但它只能更新以其他方式为这两种类型创建的服务器。
  • 文件夹上下文。AgentHub 资源的范围为 Orchestrator 文件夹作用域。在每个动词上传递 --folder-key <guid> 或 --folder-path <path>; mcp list 还接受 --all-folders 来枚举调用者可以看到的每个文件夹(逐个文件夹,按 Slug + 文件夹进行重复数据删除,每个文件夹都会失败 — 最常见的是“该文件夹中没有 AgentHub 权限”— 已吞吐以警告形式出现,而不是中止整个列表)。如果没有可解析的文件夹,则在任何网络调用之前进行 mcp create 和 mcp delete 硬失败;即使 mcp list/mcp get 自己的描述表明需要文件夹上下文,mcp list 也不会在客户端强制执行此操作 — 省略两者都可能在服务器端出现故障。
  • 创建/更新的输入模式:正好是--file 、 --body或标量标志之一。传递多个源会出现客户端 ConflictingInput 错误; MissingInput(不指定)。--print-schema 简化了任一动词,以打印类型的预期 JSON 形状,而不是编写任何内容,这是在手动创作 --file/--body 之前快速查看其需求的方法。--dry-run 以快捷方式打印已解决的变更计划(HTTP 谓词、目标、已解决的有效负载),而无需调用 API。
  • update默认情况下标量合并到现有服务器上; --file / --body完全替换。在标量模式下,只有您传递的标志会发生更改,已保留已获取的服务器的其余字段,包括 platform 服务器的现有 selectedToolNames(当省略 --tool 时)。type 字段本身是不可变的:将其包含在 --file/--body 有效负载中是客户端错误,而非静默空操作。

大纲​

uip agenthub mcp list [--type <type>] [--status <s>] [--name <substr>] [--limit <n>] [--offset <n>] [--folder-key <key> | --folder-path <path> | --all-folders]
uip agenthub mcp get <slug> [--folder-key <key> | --folder-path <path>]
uip agenthub mcp create <uipath|coded|command|remote|platform|swagger> [type-specific options] [--file <path> | --body <json> | scalars] [--print-schema] [--dry-run]
uip agenthub mcp update <slug> [type-specific options] [--file <path> | --body <json> | scalars] [--print-schema] [--dry-run]
uip agenthub mcp template <type>
uip agenthub mcp delete <slug> -y [--dry-run]
uip agenthub mcp refresh-tools <slug> --folder-key <key> [--dry-run]
uip agenthub mcp list [--type <type>] [--status <s>] [--name <substr>] [--limit <n>] [--offset <n>] [--folder-key <key> | --folder-path <path> | --all-folders]
uip agenthub mcp get <slug> [--folder-key <key> | --folder-path <path>]
uip agenthub mcp create <uipath|coded|command|remote|platform|swagger> [type-specific options] [--file <path> | --body <json> | scalars] [--print-schema] [--dry-run]
uip agenthub mcp update <slug> [type-specific options] [--file <path> | --body <json> | scalars] [--print-schema] [--dry-run]
uip agenthub mcp template <type>
uip agenthub mcp delete <slug> -y [--dry-run]
uip agenthub mcp refresh-tools <slug> --folder-key <key> [--dry-run]

uip agenthub MCP 列表​

列出 MCP 服务器注册。由于基础 API 返回平面数组,因此筛选器(--type、--status、--name)和分页(--limit/--offset)应用于客户端。

选项​

长值默认描述
--type <kind>uipath|command|coded|selfhosted|remote|process-assistant|platform|swagger—按服务器类型筛选。无效值会导致客户端在调用任何 API 之前失败。
--status <s>字符串—按状态筛选。作为原始字符串与数字状态枚举进行匹配。
--name <substr>字符串—服务器名称的子字符串匹配不区分大小写。
--limit <number>整数50页面大小。
--offset <number>整数0行偏移量。
--folder-key <key>GUID—Orchestrator 文件夹。与 --all-folders 互斥。
--folder-path <path>字符串—文件夹显示名称或完全限定路径,通过 Orchestrator SDK 解析为键。
--all-folders标记关闭枚举调用者可以看到的每个文件夹。与 --folder-key/--folder-path 互斥。
--login-validity <minutes>整数—覆盖此调用的交互式登录令牌生存期。

示例​

uip agenthub mcp list --folder-path Shared --type uipath --name invoice
uip agenthub mcp list --folder-path Shared --type uipath --name invoice

数据形状(--输出 json)​

{
  "Code": "AgentHubMcpList",
  "Data": {
    "items": [{ "slug": "invoice-mcp", "name": "Invoice MCP", "type": 0, "status": 0 }],
    "total": 1,
    "count": 1
  }
}
{
  "Code": "AgentHubMcpList",
  "Data": {
    "items": [{ "slug": "invoice-mcp", "name": "Invoice MCP", "type": 0, "status": 0 }],
    "total": 1,
    "count": 1
  }
}

uip agenthub MCP 获取​

通过规范缩略名获取一台 MCP 服务器。无名称查找回退 — 从 mcp list 传递确切的缩略名。

参数​

名称必填用途
<slug>是规范 MCP 服务器缩略名。

选项​

长值描述
--folder-key <key> / --folder-path <path>GUID/字符串文件夹上下文。
--login-validity <minutes>整数令牌生存期覆盖。

示例​

uip agenthub mcp get invoice-mcp
uip agenthub mcp get invoice-mcp

数据形状(--输出 json)​

{ "Code": "AgentHubMcpGet", "Data": { "slug": "invoice-mcp", "name": "Invoice MCP", "type": 0 } }
{ "Code": "AgentHubMcpGet", "Data": { "slug": "invoice-mcp", "name": "Invoice MCP", "type": 0 } }

uip agenthub MCP 创建​

创建 MCP 服务器。每种类型对应一个子命令 — uipath 、 coded 、 command 、 remote 、 platform 、 swagger (有关枚举中存在但没有有效create叶的两种类型名称,请参阅概念) 。所有六个都共享 --name、--slug(默认为子实体化的 --name)、--description、--version,以及 --file/--body/--print-schema/--dry-run 和文件夹选项。需要可解析的文件夹 — 在任何网络调用之前失败。

特定于类型的选项​

类型额外选项注意
uipath无有效负载:{ server: {name, slug, description, version}, tools: [] }。之后通过 mcp-tools 添加工具。
coded--process-key <key>由 Orchestrator 流程提供支持。--folder-key 兼作有效负载的 folderKey。
command--command <cmd>、--arg <arg>(可重复)、--env <key=value>(可重复)启动本地二进制文件。arguments 是联接后的 --arg 列表(以空格分隔); environmentVariables 是从 --env 对构建的 JSON 字符串化对象。
remote--uri <uri>、--header <key=value>(可重复)、--use-relayheaders 是 --header 对中的 JSON 字符串化对象。
platform--service <name>、--tool <name>(可重复)有效负载将标量嵌套在 server 下,selectedToolNames 位于其旁边。
swagger--spec-url <url>、--use-relay、--filter <expr>(可重复,保留)通过单独的特定于 Swagger 的 API 端点创建。

示例​

uip agenthub mcp create uipath --name InvoiceMcp --slug invoice-mcp
uip agenthub mcp create command --name LocalMcp --slug local-mcp --command npx --arg @some/server
uip agenthub mcp create remote --name RemoteMcp --slug remote-mcp --uri https://example/mcp
uip agenthub mcp create uipath --name InvoiceMcp --slug invoice-mcp
uip agenthub mcp create command --name LocalMcp --slug local-mcp --command npx --arg @some/server
uip agenthub mcp create remote --name RemoteMcp --slug remote-mcp --uri https://example/mcp

数据形状(--输出 json)​

{ "Code": "AgentHubMcpCreate", "Data": { "slug": "invoice-mcp", "name": "InvoiceMcp" } }
{ "Code": "AgentHubMcpCreate", "Data": { "slug": "invoice-mcp", "name": "InvoiceMcp" } }

--print-schema 将返回 Code: "AgentHubMcpTemplate" 以及类型的 JSON 架构,而不会创建任何内容。--dry-run 返回 Code: "DryRun" ,其中包含已解决的变更计划。

uip agenthub MCP 更新​

更新 MCP 服务器。按服务器的现有类型调度(首先获取)— 无论目标的实际类型如何,与create相同的类型特定选项都会注册到update ,但仅合并与获取类型相关的选项。

参数​

名称必填用途
<slug>是规范 MCP 服务器缩略名。

选项​

与 create 相同的类型特定标志(--name、--description、--version、--process-key、--command、--arg、--env、--uri、--header、--use-relay, --service、--tool、--spec-url),以及 --file/--body/--print-schema/--dry-run 和文件夹选项。type 不可变 — 将其包含在 --file/--body 有效负载中会导致客户端错误。

示例​

uip agenthub mcp update invoice-mcp --name InvoiceMcp
uip agenthub mcp update invoice-mcp --name InvoiceMcp

数据形状(--输出 json)​

{ "Code": "AgentHubMcpUpdate", "Data": { "slug": "invoice-mcp", "name": "InvoiceMcp" } }
{ "Code": "AgentHubMcpUpdate", "Data": { "slug": "invoice-mcp", "name": "InvoiceMcp" } }

uip agenthub MCP 模板​

为一种服务器类型发出可编辑的 JSON 框架 — 独立于连接器的静态参考命令(根本没有文件夹选项)。

参数​

名称必填用途
<type>是uipath、coded、command、selfhosted、remote、process-assistant、platform、swagger 之一(所有 8 项,包括两个没有可用 create 叶的项)。系统也接受 swagger-mcp,并将其规范化为 swagger。

示例​

uip agenthub mcp template uipath
uip agenthub mcp template uipath

数据形状(--输出 json)​

{ "Code": "AgentHubMcpTemplate", "Data": { "server": { "name": "uipath-mcp", "description": "", "version": "1.0.0", "isActive": true }, "tools": [] } }
{ "Code": "AgentHubMcpTemplate", "Data": { "server": { "name": "uipath-mcp", "description": "", "version": "1.0.0", "isActive": true }, "tools": [] } }

uip agenthub MCP 删除​

按缩略名删除 MCP 服务器。破坏性 — 需要 -y/--yes。需要可解析的文件夹。

参数​

名称必填用途
<slug>是规范 MCP 服务器缩略名。

选项​

长描述
-y, --yes需要确认。CLI 从不提示。
--dry-run打印变异计划,不删除。

示例​

uip agenthub mcp delete invoice-mcp -y
uip agenthub mcp delete invoice-mcp -y

数据形状(--输出 json)​

{ "Code": "AgentHubMcpDelete", "Data": { "slug": "invoice-mcp", "deleted": true } }
{ "Code": "AgentHubMcpDelete", "Data": { "slug": "invoice-mcp", "deleted": true } }

uip agenthub MCP 刷新工具​

从服务器的实时来源(流程架构、远程/Swagger 端点等)重新派生服务器的工具。

参数​

名称必填用途
<slug>是规范 MCP 服务器缩略名。

选项​

长描述
--folder-key <key> / --folder-path <path>一个为必填项— 刷新端点在文件夹范围内 ( /mcp/{folderKey}/{slug}/refresh-tools )。在任何查找之前,两者同时缺失将失败,并显示明确错误。
--dry-run打印变异计划而不刷新。

行为因服务器类型而异: coded / command刷新返回异步runtimeId (HTTP 202、 status: "Started" ); remote / swagger / platform同步刷新( status: "Refreshed" 、 toolCount ); uipath和selfhosted服务器会在本地拒绝(其工具为手动编写,而非派生), NextCommand提示指向mcp-tools create-resource 。

示例​

uip agenthub mcp refresh-tools remote-mcp --folder-key f1f2f3f4-0000-0000-0000-000000000001
uip agenthub mcp refresh-tools remote-mcp --folder-key f1f2f3f4-0000-0000-0000-000000000001

数据形状(--输出 json)​

{ "Code": "AgentHubMcpRefreshTools", "Data": { "status": "Refreshed", "toolCount": 3 } }
{ "Code": "AgentHubMcpRefreshTools", "Data": { "status": "Refreshed", "toolCount": 3 } }

异步 (202) 响应会返回 { "runtimeId": "...", "status": "Started" }。

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新