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

# Claude Code

> 将 Glasser MCP 服务器添加到 Claude Code 并登录。

按本指南将 Claude Code 直接连接到 Glasser。如需使用 CLI，请按[通过 Skill 接入](https://glasser.ai/docs/zh/setup-skill/claude-code.md)中的说明操作。

**1. 添加服务器**

安装 Claude Code 后，在终端运行：

```bash theme={null}
claude mcp add --transport http --scope user glasser https://api.glasser.ai/mcp
```

用户级配置可在本机各项目中使用 Glasser。

**2. 登录**

启动 Claude Code，输入 `/mcp`，选择 `glasser`，再选择 **Authenticate**。

在浏览器中登录 Glasser，选择工作空间，然后点击 **Allow**。如有需要，先创建账号和工作空间。返回 Claude Code，在 `/mcp` 中确认 Glasser 已连接。

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

服务器配置和认证帮助见 [Claude Code MCP 文档](https://code.claude.com/docs/en/mcp)。


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