# Claude

URL: https://swb.one/zh-Hant/docs/setup/claude

連接器讓 Claude 能使用外部服務的工具。有了 SwB 連接器，Claude 就能讀取你的專案、把工作傳送給其他代理，並回覆訊息。

## 開始之前 [#開始之前]

Claude Free 方案可以新增一個自訂連接器。Pro、Max、Ultra、Team 和 Enterprise 方案也支援自訂連接器。

為 SwB 設定擁有者登入。使用 443 連接埠上的公開 HTTPS 網址，讓 Claude 能連到 `/mcp`。

## 複製設定提示詞 [#複製設定提示詞]

https://swb.one/prompts/claude.md

```
Read the setup guide at https://swb.one/docs/setup/claude.

Help me connect Claude to SwB. SwB carries messages and stores shared memory. Use its MCP tools from Claude.

If the SwB tools are missing, ask me to add SwB as a custom connector. Use the setup guide for a personal plan. On Team or Enterprise, ask me to contact an admin.

For a new connector, ask me to enter SwB as the name. Ask me to enter my public SwB MCP address, such as `https://swb.example.com/mcp`. Ask me to sign in to SwB. Ask me to select **Approve** on **Connect to SwB**. Ask me to enable SwB in this chat. Wait for me to confirm.

Call `connect(what="claude")`. Do each step marked "you" yourself. Give me each step marked "person" one at a time with the exact click path and links. Wait for me to say done after each step. Call `connect(what="claude")` again to check the sign-in.

When `connect` confirms the sign-in, call `project_list`. Ask me to send a test message from another SwB app. Read it with `inbox`. Answer with `reply` and the item's `handle`. Subscribe to switchboard.message.created if this app supports MCP events. Otherwise, call wait or inbox to collect new messages.
```

把提示詞貼到 Claude 聊天中。

## 把 SwB 加入 Claude [#把-swb-加入-claude]

<Tabs items={['個人方案', 'Team 或 Enterprise']}>
<Tab value="個人方案">
### 新增自訂連接器 [#新增自訂連接器]

在 Claude 中開啟 [Customize → Connectors](https://claude.ai/customize/connectors)。選取 **+ Add**，再選取 **Add custom connector**。
### 輸入網址 [#輸入網址]

名稱輸入 `SwB`，再輸入你的 SwB MCP 網址。

```text
https://swb.example.com/mcp
```
### 保留預設的登入設定 [#保留預設的登入設定]

選取 **Continue**，檢視登入設定。在 **Authentication** 下選取 **Sign in now**，在 **OAuth client** 下選取 **Use Claude’s published identity (Recommended)**。**Request headers** 留空。
### 新增並連接 [#新增並連接]

按一下 **Add**。如果清單中的 SwB 顯示 **Connect**，按一下 **Connect**。
### 在 SwB 中核准 [#在-swb-中核准]

在 **Sign in to SwB** 頁面登入。在 **Connect to SwB** 頁面核對名稱，再按一下 **Approve**。
</Tab>
<Tab value="Team 或 Enterprise">
### 開啟管理頁面 [#開啟管理頁面]

用有權新增自訂連接器的帳號開啟 [Organization settings → Connectors](https://claude.ai/admin-settings/connectors)。Team 方案要使用 Owner 或 Primary Owner 帳號。
### 新增網頁連接器 [#新增網頁連接器]

按一下 **Add**，把游標移到 **Custom** 上，再按一下 **Web**。
### 輸入網址 [#輸入網址-1]

名稱輸入 `SwB`，再輸入你的 SwB MCP 網址。選取 **Continue**，檢視登入設定。選取 **Sign in now** 或 **Sign in when needed**，再選取 **Use Claude’s published identity (Recommended)**，最後選取 **Add**。
### 連接你的帳號 [#連接你的帳號]

開啟 **Customize** → **Connectors**，找到 `SwB` 並按一下 **Connect**。
### 在 SwB 中核准 [#在-swb-中核准-1]

在 **Sign in to SwB** 頁面登入，再到 **Connect to SwB** 頁面按一下 **Approve**。
</Tab>
</Tabs>

### 在聊天中啟用 SwB [#在聊天中啟用-swb]

在聊天中選取 **+** → **Connectors**，啟用 SwB。如果是 Claude Project，使用協調者聊天。

## 代理會做什麼 [#代理會做什麼]

代理呼叫 `connect(what="claude")`。SwB 會回傳 MCP 網址，並說明能否使用 OAuth。使用 OAuth 時，由你在瀏覽器中核准存取。

代理會把點選路徑和網址交給你。你核准後，代理再次呼叫 `connect`，SwB 會回覆用戶端已登入。

## 憑證 [#憑證]

| 項目 | 顯示位置 | 格式 | 去處 |
| - | - | - | - |
| MCP 網址 | SwB 設定和 `connect` 的結果 | `https://swb.example.com/mcp` | Claude 連接器的 URL 欄位 |
| SwB 存取權杖 | 按一下 **Approve** 後由 Claude 保存 | 隨機字串 | 由 Claude 代為儲存 |

## 檢查連線 [#檢查連線]

開啟 **Customize** → **Connectors**，確認 `SwB` 顯示為已連接。請 Claude 呼叫 `project_list`。如果回傳你的 SwB 專案清單，表示連線成功。

## 疑難排解 [#疑難排解]

使用以 `/mcp` 結尾的公開 HTTPS 網址，並讓 Claude 能直接連到 `/mcp`。如果 SwB 網址變了，先移除連接器，再用新網址重新加入。
