> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 远程 MCP 服务器

> 将 AI 助手连接到内置的只读 MCP 服务器

export const companyName = "知行软件";

export const siteNameShort = "知行之桥";

export const siteName = "知行之桥";

{siteName} 包含一个远程 [Model Context Protocol（MCP）](https://modelcontextprotocol.io/)服务器，可将 Claude Desktop、GitHub Copilot 和 OpenAI Codex 等 AI 助手连接到 {siteNameShort}。该服务器默认启用，并提供 14 个只读工具，用于查找资源、跟踪消息和诊断问题。

<Warning>
  使用 AI 助手可能会将 {siteNameShort} 中的数据发送给第三方 AI 服务。请先确认组织的数据处理政策和所用服务的条款。AI 生成的结果可能不准确，应在执行操作前进行验证。如需帮助，请联系 {companyName} 技术支持。
</Warning>

## 连接信息

MCP 端点为：

```text theme={null}
https://<baseurl>:<port>/mcp.rsc
```

客户端必须在 `x-cdata-authtoken` HTTP 请求头中提供用户的身份验证令牌。可在[用户](/26.3/self-hosted/zh/getting-started/administration/settings/users)页面为用户生成 Authtoken。

## Claude Desktop

Claude Desktop 通过 `mcp-remote` 使用 stdio 连接远程 HTTP MCP 服务器。将以下内容添加到 Claude Desktop 配置文件，并替换 URL 和令牌：

```json theme={null}
{
  "mcpServers": {
    "arc": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://<baseurl>:<port>/mcp.rsc",
        "--header",
        "x-cdata-authtoken:${ARC_AUTHTOKEN}"
      ],
      "env": {
        "ARC_AUTHTOKEN": "<your-authtoken>"
      }
    }
  }
}
```

Claude Desktop 配置文件通常位于：

* Windows：`%APPDATA%\Claude\claude_desktop_config.json`
* macOS：`~/Library/Application Support/Claude/claude_desktop_config.json`

## GitHub Copilot CLI

在 Copilot CLI 的 MCP 配置文件中添加：

```json theme={null}
{
  "mcpServers": {
    "arc": {
      "type": "http",
      "url": "https://<baseurl>:<port>/mcp.rsc",
      "headers": {
        "x-cdata-authtoken": "<your-authtoken>"
      }
    }
  }
}
```

配置文件通常位于：

* Windows：`%USERPROFILE%\.copilot\mcp-config.json`
* macOS/Linux：`~/.copilot/mcp-config.json`

## OpenAI Codex

在 Codex 配置文件中添加：

```toml theme={null}
[mcp_servers.arc]
url = "https://<baseurl>:<port>/mcp.rsc"
http_headers = { x-cdata-authtoken = "<your-authtoken>" }
```

配置文件通常位于：

* Windows：`%USERPROFILE%\.codex\config.toml`
* macOS/Linux：`~/.codex/config.toml`

## 可用工具

| 工具                   | 说明                   |
| -------------------- | -------------------- |
| `find_workspaces`    | 查找工作区并返回其配置。         |
| `find_connectors`    | 按工作区、类型或名称查找连接器。     |
| `find_messages`      | 查找消息及其当前状态。          |
| `find_files`         | 查找连接器消息文件。           |
| `find_logs`          | 搜索应用程序和连接器日志。        |
| `find_requests`      | 查找 HTTP 请求历史记录。      |
| `find_certificates`  | 查找已配置的证书。            |
| `find_vault_entries` | 查找凭据保险库条目及其元数据。      |
| `find_reports`       | 查找报告定义和生成的报告。        |
| `find_flow_apis`     | 查找已发布的 Flow API。     |
| `diagnose_message`   | 分析消息错误和处理状态。         |
| `trace_message_flow` | 跟踪消息在工作流连接器之间的路径。    |
| `check_health`       | 检查应用程序、工作区和连接器的运行状况。 |
| `describe_profile`   | 返回当前用户和服务器能力信息。      |

## 示例提示

* “显示过去一小时失败的消息，并说明最可能的原因。”
* “跟踪这条消息经过了哪些连接器。”
* “检查生产工作区的连接器运行状况。”
* “查找今天与 AS2 伙伴相关的错误日志。”

## 安全说明

* MCP 工具是只读的，不能创建、修改或删除 {siteNameShort} 资源。
* 工具只能访问与 Authtoken 所属用户权限一致的数据。
* 请使用专用服务用户，并授予完成诊断所需的最小权限。
* 将 Authtoken 作为机密信息存储，不要提交到源代码管理。

## 已知限制

* MCP 服务器仅提供诊断和查询工具，不支持管理操作。
* 大型查询可能返回分页或截断的结果；可缩小时间范围或添加筛选条件。
* 可用信息取决于日志保留期、用户权限和服务器配置。
