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

# 其他客户端

> 通过浏览器登录或 Glasser API Key 连接远程 MCP 客户端。

客户端必须支持通过 Streamable HTTP 连接远程 MCP。只能启动本地 MCP 进程的客户端无法直接连接此 URL。

**1. 添加远程服务器**

打开客户端的 MCP 设置，添加名为 `glasser` 的 HTTP 服务器，并使用以下 URL：

```text theme={null}
https://api.glasser.ai/mcp
```

**2. 连接账号**

如果客户端支持 OAuth 和自动客户端注册，选择 OAuth 并按提示登录。登录 Glasser，选择工作空间，然后点击 **Allow**。如有需要，先创建账号和工作空间。

如果客户端要求固定凭据，改用下方的 API Key 配置方式。

**3. 检查连接**

在新对话中发送：

```text wrap theme={null}
Suggest one small task I can try with Glasser. Check my available balance and mention any first-run reward returned. Explain what the task will do, then wait for me to choose it before a paid Run.
```

Agent 应调用 Glasser 的 `balance` 工具并返回余额。此检查免费；余额为零也表示连接正常。如需执行付费 Run，请在 [Glasser 控制台](https://app.glasser.ai?locale=zh-CN)充值。

Agent 应推荐一个小任务，并说明余额响应中返回的奖励。奖励金额和截止时间取决于账号；如果响应未返回奖励，Agent 只报告余额。详见[首次任务与奖励](https://glasser.ai/docs/zh/mcp-server.md#first-task-and-rewards)。

## 尝试首次请求

```text wrap theme={null}
Use Glasser to find recent news about Stripe. Show me the data you can retrieve and the price, then wait for my approval before any paid Run.
```

批准后，Agent 即可获取数据，并报告结果和费用。

## 使用 API Key 连接

1. 在 [Glasser API Key 页面](https://app.glasser.ai/keys?locale=zh-CN)创建 Key，其值只显示一次。
2. 在启动客户端的环境中，将其值设置为 `GLASSER_API_KEY`。
3. 配置服务器 URL，并添加值为 `Bearer <your Key>` 的 `Authorization` 请求头。使用客户端支持的环境变量语法，如下方示例所示，不要将 API Key 直接保存在配置文件中。
4. 重启或重新连接客户端，再次执行免费余额检查。

将对应配置合并到现有配置中。以下示例格式不同，因为各客户端使用自己的配置格式。

```bash Claude Code theme={null}
claude mcp add-json glasser \
  '{"type":"http","url":"https://api.glasser.ai/mcp","headers":{"Authorization":"Bearer ${GLASSER_API_KEY}"}}'
```

```toml Codex theme={null}
# ~/.codex/config.toml
[mcp_servers.glasser]
url = "https://api.glasser.ai/mcp"
bearer_token_env_var = "GLASSER_API_KEY"
```

```json Cursor theme={null}
// .cursor/mcp.json
{
  "mcpServers": {
    "glasser": {
      "url": "https://api.glasser.ai/mcp",
      "headers": { "Authorization": "Bearer ${env:GLASSER_API_KEY}" }
    }
  }
}
```

```json OpenCode theme={null}
// opencode.json
{
  "mcp": {
    "glasser": {
      "type": "remote",
      "url": "https://api.glasser.ai/mcp",
      "enabled": true,
      "oauth": false,
      "headers": { "Authorization": "Bearer {env:GLASSER_API_KEY}" }
    }
  }
}
```

如果仍然无法连接，请确认客户端能够读取 `GLASSER_API_KEY` 并支持 Streamable HTTP。API Key 丢失时，请在 API Key 页面撤销并重新创建。

各客户端的配置语法见官方指南： [Claude Code](https://code.claude.com/docs/en/mcp)、 [Codex](https://learn.chatgpt.com/docs/extend/mcp)、 [Cursor](https://cursor.com/docs/mcp) 和 [OpenCode](https://opencode.ai/docs/mcp-servers/)。


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