---
title: Hosted MCP | RunAPI
description: 透過 OAuth 將 Claude Desktop、Cursor、VS Code、Windsurf 或其他 MCP 用戶端連接至 RunAPI。
url: https://runapi.ai/zh-TW/docs/resources/mcp/hosted.md
canonical: https://runapi.ai/zh-TW/docs/resources/mcp/hosted
locale: zh-TW
---

> HTML 版本: https://runapi.ai/zh-TW/docs/resources/mcp/hosted
> 代理程式網站索引: https://runapi.ai/llms.txt

# Hosted MCP

Hosted MCP 是使用 RunAPI 工具的建議方式。您的 MCP 用戶端可直接連線至 RunAPI，無需安裝 Node.js 或保持本機程序持續運行。

使用此端點：

```text
https://mcp.runapi.ai/mcp
```

在下方選擇您的 MCP 用戶端。當用戶端在您的瀏覽器中開啟 RunAPI 時，請登入、選擇要使用的帳號，然後核准存取權限。

## Claude Desktop

1.  開啟 **Settings > Connectors**，並新增自訂連接器。
2.  將其命名為 **RunAPI**，並輸入上方的端點。
3.  選取 **Connect**，並在瀏覽器中完成 RunAPI 授權。
4.  在對話中，開啟 **+ > Connectors** 並啟用 RunAPI。

若 RunAPI 未出現在對話中，請返回**設定 > 連接器**，重新連線並確認已為該對話啟用。

## 游標

將 RunAPI 新增至您的 Cursor `mcp.json`，例如專案層級的 `.cursor/mcp.json`：

```json
{
  "mcpServers": {
    "runapi": {
      "url": "https://mcp.runapi.ai/mcp"
    }
  }
}
```

在 Cursor 側邊欄中開啟**自訂**，找到 RunAPI 並啟用，然後在瀏覽器中完成授權。

RunAPI 應顯示為已連線並公開其工具。若發生連線或身分驗證錯誤，請開啟 **Output** 面板並選取 **MCP Logs**。

## VS Code

1.  開啟命令選擇區並執行 **MCP: Add Server**。
2.  選擇 **HTTP**，輸入上方的端點，並將伺服器命名為 **RunAPI**。
3.  啟動伺服器，出現提示時信任它，並在瀏覽器中完成授權。

RunAPI 工具應出現在 Chat 中。若發生錯誤，請執行 **MCP: List Servers**，選取 RunAPI，然後選擇 **Show Output**。

## Windsurf

這些步驟適用於 Cascade 代理。Devin Local 使用 Devin CLI 設定。

1.  開啟 **Devin Settings > Cascade > MCP Servers**，並編輯原始的 `~/.codeium/windsurf/mcp_config.json` 檔案。
2.  將 RunAPI 新增為遠端 HTTP 伺服器：

```json
{
  "mcpServers": {
    "runapi": {
      "serverUrl": "https://mcp.runapi.ai/mcp"
    }
  }
}
```

1.  儲存檔案、重新整理 MCP 伺服器、啟用 RunAPI，並在瀏覽器中完成授權。

若工具未出現，請開啟 MCP 設定，確認 RunAPI 已啟用，然後重新連線。

## 其他 MCP 用戶端

將上方端點新增為 Streamable HTTP 伺服器。用戶端必須支援 Remote MCP 與以瀏覽器為基礎的 OAuth。出現提示時完成授權，然後在用戶端啟用 RunAPI 工具。

## 驗證連線

詢問您的用戶端：

> RunAPI 有哪些可用的圖像模型？

用戶端應呼叫 `list_models` 並返回可用的圖片模型。這可確認連線與工具分派均正常運作。

## 改用 API 金鑰

OAuth 是建議的方式。僅在無人值守的用戶端或 OAuth 無法使用時，才使用專用的標準 API 金鑰；請依照[身分驗證指南](https://runapi.ai/zh-TW/docs/guides/authentication.md)建立金鑰。切勿將金鑰放入端點 URL 或提交至版本庫。

* **Claude Desktop：** 若自訂連接器支援 Request headers，請新增一個 `Authorization` 標頭，值設為 `Bearer
  YOUR_API_KEY`。
* **Cursor：** 在 Cursor 應用程式可見的環境中設定 `RUNAPI_API_KEY`，然後在伺服器的 `headers` 中使用 `Authorization: Bearer
  ${env:RUNAPI_API_KEY}`。遠端伺服器不會讀取 Cursor 的 `envFile` 設定。
* **VS Code：** 在伺服器的 `Authorization` 標頭中參照密碼類型的 `${input:...}`，讓 VS Code 提示輸入並儲存金鑰，而非將其寫入 `mcp.json`。
* **Windsurf：** 在 `~/.codeium/windsurf/mcp_config.json` 的 `Authorization` 標頭中參照 `${env:RUNAPI_API_KEY}` 或 `${file:...}`。

當用戶端停用或金鑰可能已外洩時，請從「API 金鑰」頁面撤銷該金鑰。

## 疑難排解

* 身分驗證未完成：請從用戶端重新連線 RunAPI，並再次完成瀏覽器流程。
* RunAPI 已連線但工具遺失：確認伺服器已啟用，移除並重新加入確切的端點，然後開啟新的對話。
* 驗證問題失敗：請查看上方對應章節所說明的用戶端日誌，然後在重試前重新連線 RunAPI。

需要用戶端在您的機器上啟動 RunAPI？請[設定 Local MCP](https://runapi.ai/zh-TW/docs/resources/mcp/local.md)。

---

## RunAPI 的更多內容

- [首頁](https://runapi.ai/zh-TW/.md)
- [模型目錄](https://runapi.ai/zh-TW/models.md)
- [價格](https://runapi.ai/zh-TW/pricing.md)
- [提供商](https://runapi.ai/zh-TW/models)
- [文件](https://runapi.ai/zh-TW/docs/guides)
- [SDK](https://runapi.ai/zh-TW/sdk.md)
- [CLI](https://runapi.ai/zh-TW/cli.md)
- [MCP Server](https://runapi.ai/zh-TW/mcp.md)
- [Claude Code 與 Cursor](https://runapi.ai/zh-TW/claude-code-vs-cursor.md)
- [Cursor API 設定](https://runapi.ai/zh-TW/cursor-api-setup.md)
- [RunAPI 與 OpenRouter](https://runapi.ai/zh-TW/openrouter-alternative.md)
- [企業版](https://runapi.ai/zh-TW/contact.md)
- [聯絡我們](https://runapi.ai/zh-TW/contact.md)
- [服務條款](https://runapi.ai/zh-TW/terms.md)
- [隱私權](https://runapi.ai/zh-TW/privacy.md)
- [代理程式網站索引](https://runapi.ai/llms.txt)

聯絡我們: contact@runapi.ai

## 結構化資料

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-TW",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-TW",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-TW/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-TW",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-TW",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-TWicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-TW",
    "@type": "TechArticle",
    "headline": "Hosted MCP",
    "description": "透過 OAuth 將 Claude Desktop、Cursor、VS Code、Windsurf 或其他 MCP 用戶端連接至 RunAPI。",
    "url": "https://runapi.ai/zh-TW/docs/resources/mcp/hosted",
    "mainEntityOfPage": "https://runapi.ai/zh-TW/docs/resources/mcp/hosted"
  }
]
```
