> ## 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.

# Codex

> 将 Glasser MCP 服务器连接到本机 Codex 客户端。

同一台设备上的本地 Codex 客户端共享 MCP 设置，可在应用、CLI 或 IDE 扩展中使用此连接。如需包含 CLI 说明的 Skill，请阅读 [Codex Skill 指南](https://glasser.ai/docs/zh/setup-skill/codex.md)。

以下步骤通过 Codex CLI 为本地客户端配置连接。

**1. 添加服务器**

在已安装 Codex CLI 的终端中运行：

```bash theme={null}
codex mcp add glasser --url https://api.glasser.ai/mcp
```

默认情况下，Codex 将服务器配置保存在 `~/.codex/config.toml`。

**2. 登录**

如果配置过程中出现 OAuth 提示，请按提示操作。否则运行：

```bash theme={null}
codex mcp login glasser
```

在浏览器中登录 Glasser，选择工作空间，然后点击 **Allow**。如有需要，先创建账号和工作空间。

**3. 新建本地任务**

如有需要，重新打开客户端以加载新配置。在 Codex CLI 中， `/mcp` 显示当前服务器；请确认 `glasser` 可用。

**4. 检查连接**

在新对话中发送：

```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 即可获取数据，并报告结果和费用。

客户端设置和认证帮助见 [OpenAI MCP 文档](https://learn.chatgpt.com/docs/extend/mcp?surface=cli)。


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