> ## 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 伺服器僅提供診斷和查詢工具，不支援管理操作。
* 大型查詢可能傳回分頁或截斷的結果；可縮小時間範圍或新增篩選條件。
* 可用資訊取決於日誌保留期、使用者權限和伺服器配置。
