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

# 连接客户端

> 把 TronRental 添加到 Claude、ChatGPT、Claude Code、Codex 或 Cursor，登录并开始使用

下面的每个客户端都连接同一个服务器，并使用 TronRental 为你登录——无需复制 API 密钥：

```
https://mcp.tronrental.com/mcp
```

首次使用时，客户端会打开 tronrental.com。登录（或注册），选择账户，勾选[权限](https://docs.tronrental.com/zh/agents/reference/permissions.md)，设置每日消费上限并批准。客户端获得的令牌仅用于此连接。

> [tab] Claude
>
> 适用于网页版 Claude 和桌面应用，所有套餐均可（Free 套餐允许一个自定义连接器）。
>
> 1. 打开 [Add to Claude](https://claude.ai/customize/connectors?modal=add-custom-connector\&connectorName=TronRental\&connectorUrl=https%3A%2F%2Fmcp.tronrental.com%2Fmcp)——或进入 **Customize → Connectors → Add → Add custom connector**，填入名称 `TronRental` 和上面的 URL。
> 2. 点击 TronRental 旁边的 **Connect**。
> 3. 在 tronrental.com 登录并批准。
> 4. 在对话中，从工具菜单开启 TronRental 并提问，例如：*"What is my TronRental balance?"*
>
> 在 Team 和 Enterprise 套餐中，由所有者在 **Organization settings → Connectors** 中添加连接器；成员随后点击 **Connect**。

> [tab] ChatGPT
>
> 1. 打开 [ChatGPT Plugins](https://chatgpt.com/plugins)，点击 **+** → **Add custom MCP server**。
> 2. 填入名称 `TronRental`，选择 **Public endpoint** 并粘贴上面的 URL。
> 3. 身份验证保持 **OAuth**，确认警告并点击 **Create as a plugin**。
> 4. 在 tronrental.com 登录并批准。
> 5. 在对话中，从工具菜单选择 TronRental。
>
> 如果看不到该选项，可能是你的工作区不允许自定义 MCP 服务器——请联系其管理员。ChatGPT 只能通过 OAuth 连接，不能使用 API 密钥。

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http tronrental https://mcp.tronrental.com/mcp
> ```
>
> 然后在 Claude Code 中运行 `/mcp`，选择 **tronrental** 和 **Authenticate**。浏览器会打开 tronrental.com；批准后返回终端。
>
> 添加 `--scope user` 可在所有项目中使用 TronRental，添加 `--scope project` 可通过 `.mcp.json` 与团队共享。

> [tab] Codex
>
> ```bash theme={null}
> codex mcp add tronrental --url https://mcp.tronrental.com/mcp
> ```
>
> Codex 会打开浏览器进行登录。如果没有打开，请运行：
>
> ```bash theme={null}
> codex mcp login tronrental
> ```

> [tab] Cursor
>
> 把服务器添加到 `~/.cursor/mcp.json`（所有项目）或 `.cursor/mcp.json`（单个项目）：
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "tronrental": {
>       "url": "https://mcp.tronrental.com/mcp"
>     }
>   }
> }
> ```
>
> Cursor 首次使用该服务器时会打开 tronrental.com 让你登录。

## 检查是否可用

问智能体：*"Quote 65,000 energy for 1 hour on TronRental."* 它会调用 `quote_energy` 并显示价格——不会扣款。

每次购买前，智能体都会报价、向你展示价格并把它作为 `max_price_trx` 传入；它还会发送 `idempotency_key`，因此重试永远不会重复扣款。购买要求账户累计充值达到 100 TRX——在此之前连接只能读取。见[支出和错误](https://docs.tronrental.com/zh/agents/reference/spending-and-errors.md)。

## 管理和断开连接

[API 页面](https://tronrental.com/dashboard/api)上的 **已连接的应用** 列表显示每个已连接的客户端：谁连接的、它的权限、每日上限以及最近 24 小时的支出。可以在那里修改上限，或点击 **断开连接** 立即撤销连接。

## 改用 API 密钥

允许设置请求头的客户端可以使用 [API 密钥](https://docs.tronrental.com/zh/authentication.md)连接，而无需登录——例如在你的服务器上运行的智能体：

```bash theme={null}
claude mcp add --transport http tronrental https://mcp.tronrental.com/mcp \
  --header "Authorization: Bearer $TRONRENTAL_API_KEY"
```

在 Codex 中，把密钥所在的环境变量写入 `~/.codex/config.toml`：

```toml theme={null}
[mcp_servers.tronrental]
url = "https://mcp.tronrental.com/mcp"
bearer_token_env_var = "TRONRENTAL_API_KEY"
```

在 Cursor 中，在 `url` 旁边添加 `"headers": { "Authorization": "Bearer ${env:TRONRENTAL_API_KEY}" }`。

API 密钥没有每日上限：只授予智能体所需的权限范围。见[使用 MCP 开发](https://docs.tronrental.com/zh/agents/build/overview.md)。

## 没有浏览器的智能体

无法打开浏览器的智能体可以使用本地包 [@tronrental-com/mcp-server](https://www.npmjs.com/package/@tronrental-com/mcp-server)：它在你的机器上运行，使用 `TRONRENTAL_API_KEY` 中的 API 密钥，或者让智能体用你的邮箱和邮件中的验证码注册账户。设置方法见其 [README](https://github.com/tronrentalcom/tronrental-com-mcp)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.