# 連接代理程式

> Index of the TerraLab docs for agents: [llms.txt](https://terra-lab.ai/docs/llms.txt). Every docs page is also served as markdown: add .md to its URL.

TerraLab 是透過 Streamable HTTP 運作的遠端 MCP 伺服器。同一個網址適用於所有代理程式：

```text
https://mcp.terra-lab.ai/mcp
```

第一次使用時，你的代理程式會請你登入 TerraLab。你的免費呼叫與餘額會顯示在 [儀表板，MCP](https://terra-lab.ai/zh-TW/dashboard/mcp)。

## Claude

開啟已預先填好的對話框：[將 TerraLab 加入 Claude](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=TerraLab&connectorUrl=https%3A%2F%2Fmcp.terra-lab.ai%2Fmcp)。按 **Add**，再按 **Connect**，然後登入 TerraLab。

或在 Claude 中開啟 **Settings**、**Connectors**、**Add custom connector**，貼上伺服器網址。

## ChatGPT

開啟 [ChatGPT 中的 TerraLab 應用程式](https://chatgpt.com/apps/terralab/asdk_app_6abeb2f16190819199cc1be0ed69e8d4)，按 **Add**，然後在訊息開頭輸入 `@TerraLab`。

## Claude Code

在終端機中執行：

```bash
claude mcp add --transport http terralab https://mcp.terra-lab.ai/mcp
```

接著在 Claude Code 中執行 `/mcp`，並登入 TerraLab。現成的 GIS 工作流程以 plugin 形式提供：

```text
/plugin marketplace add TerraLabAI/mcp
/plugin install terralab@terralab-ai-apps
```

## Codex

```bash
codex mcp add terralab --url https://mcp.terra-lab.ai/mcp
```

Codex 會加入伺服器，並在瀏覽器中開啟 TerraLab 登入頁。之後在 CLI、IDE 擴充功能和應用程式中都能使用。`~/.codex/config.toml` 中的對應設定如下：

```toml
[mcp_servers.terralab]
url = "https://mcp.terra-lab.ai/mcp"
```

## Cursor

開啟安裝連結：[將 TerraLab 加入 Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=terralab&config=eyJ1cmwiOiJodHRwczovL21jcC50ZXJyYS1sYWIuYWkvbWNwIn0%3D)。Cursor 會顯示這個伺服器：按 **Install**，並在提示時登入。

或在 Cursor 的 MCP 設定中新增遠端伺服器，位置在 `.cursor/mcp.json`：

```json
{
  "mcpServers": {
    "terralab": { "url": "https://mcp.terra-lab.ai/mcp" }
  }
}
```

## VS Code

開啟安裝連結：[將 TerraLab 加入 VS Code](vscode:mcp/install?%7B%22name%22%3A%22terralab%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.terra-lab.ai%2Fmcp%22%7D)。按 **Install**，登入 TerraLab，然後在 agent 模式下詢問 Copilot。

或寫在 `.vscode/mcp.json`：

```json
{
  "servers": {
    "terralab": { "type": "http", "url": "https://mcp.terra-lab.ai/mcp" }
  }
}
```

## 其他代理程式

在任何支援遠端 MCP 伺服器的代理程式中，加入上面的網址即可；它會開啟 TerraLab 登入頁。Gemini CLI：

```bash
gemini mcp add --transport http -s user terralab https://mcp.terra-lab.ai/mcp
```

## 工具

伺服器提供 29 個工具。每個工具都在 [API 參考](https://terra-lab.ai/docs/api)中說明其參數並附上請求範例：MCP 工具與 REST endpoint 使用相同的名稱和引數。

- **Places**: [Find places and addresses](https://terra-lab.ai/docs/api/find_places), [Convert coordinates](https://terra-lab.ai/docs/api/convert_coordinates), [Measure distance, area, radius or buffer](https://terra-lab.ai/docs/api/measure)
- **Map data**: [Extract open map data for an area](https://terra-lab.ai/docs/api/extract_open_data), [Open, map and convert GIS data](https://terra-lab.ai/docs/api/open_gis_file), [Buffer, merge, clip or simplify features](https://terra-lab.ai/docs/api/process_geometry)
- **Terrain and routes**: [Elevation, profile and contour lines](https://terra-lab.ai/docs/api/get_elevation), [Road route between places](https://terra-lab.ai/docs/api/get_route), [Area reachable in a travel time](https://terra-lab.ai/docs/api/get_travel_area)
- **Imagery and land**: [Satellite image of an area](https://terra-lab.ai/docs/api/get_satellite_image), [Forest type (natural, planted, plantation)](https://terra-lab.ai/docs/api/get_forest_type), [Estimate the population of an area](https://terra-lab.ai/docs/api/estimate_population)
- **France**: [French cadastral parcel and zoning](https://terra-lab.ai/docs/api/french_parcel), [French building heights](https://terra-lab.ai/docs/api/french_building_heights), [Natural risks at an address or a point](https://terra-lab.ai/docs/api/get_natural_risks)
- **Data catalog**: [Find a dataset in the TerraLab catalogue](https://terra-lab.ai/docs/api/find_datasets), [Extract a hosted dataset for an area](https://terra-lab.ai/docs/api/extract_dataset), [Ask TerraLab to add data it does not have](https://terra-lab.ai/docs/api/request_data)

## 可以問什麼

- 「找出這 40 個地址的座標，並給我一份 QGIS 可用的 CSV。」
- 「把安錫車站周圍 1 km 內的建物和道路擷取成 GeoPackage。」
- 「從霞慕尼到南針峰的高程剖面。」
- 「安錫和平街 12 號有哪些自然災害風險？」

如果代理程式支援，答案會在聊天中顯示地圖，並提供可在 QGIS、ArcGIS 或 Google Earth 中開啟的檔案。

## 疑難排解

- **TerraLab 在 Claude 中顯示為已連線，卻沒有任何工具。** 如果你是在 2026 年 10 月 26 日之前加入的，請移除該 connector 後重新加入：Claude 就會提供 TerraLab 登入。
- **代理程式說免費呼叫已用完。** 請到 [儀表板，MCP](https://terra-lab.ai/zh-TW/dashboard/mcp) 儲值，或等到下個月 1 日。請見[定價與免費呼叫](https://terra-lab.ai/zh-TW/docs/pricing)。
- **工具回應錯誤。** 錯誤中的 `message` 和 `hint` 會說明該調整什麼。請見[錯誤與速率限制](https://terra-lab.ai/zh-TW/docs/errors)。

Source: https://terra-lab.ai/zh-TW/docs/mcp · Updated 2026-10-27
