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

# Set up with MCP

> Connect Glasser to your AI tool and sign in with your account.

MCP lets your AI tool use Glasser directly. Connect your account to search for data, check
prices, and retrieve results in your conversations. You do not need to install the Glasser CLI.

## Choose your AI tool

> [card] [Claude Code](https://glasser.ai/docs/mcp-server/claude-code.md)
>
> Add Glasser from your terminal and sign in from Claude Code.

> [card] [Codex](https://glasser.ai/docs/mcp-server/codex.md)
>
> Connect local Codex clients with a shared MCP configuration.

> [card] [Claude.ai](https://glasser.ai/docs/mcp-server/claude.md)
>
> Connect Claude on the web or desktop, including Cowork.

> [card] [ChatGPT](https://glasser.ai/docs/mcp-server/chatgpt.md)
>
> Connect Glasser as a plugin and use paid data in ChatGPT.

> [card] [Manus](https://glasser.ai/docs/mcp-server/manus.md)
>
> Connect Glasser and use paid data in your research and reports.

> [card] [Cursor](https://glasser.ai/docs/mcp-server/cursor.md)
>
> Add Glasser to Cursor and enable it for your agent.

> [card] [OpenCode](https://glasser.ai/docs/mcp-server/opencode.md)
>
> Add Glasser to your OpenCode config and sign in from the terminal.

> [card] [VS Code](https://glasser.ai/docs/mcp-server/vscode.md)
>
> Add Glasser to GitHub Copilot Chat in VS Code.

> [card] [Other clients](https://glasser.ai/docs/mcp-server/other.md)
>
> Connect by server URL or use an existing Glasser Key.

## Already know your client's setup?

Use this server URL and choose OAuth sign-in:

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

Sign in to Glasser, choose the Workspace whose balance the client can use, and select **Allow**.
You can create an account and Workspace during sign-in. If your client cannot use OAuth, follow
[Other clients](https://glasser.ai/docs/mcp-server/other.md) to connect with a Key.

## Check the connection

Ask your AI tool:

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

A balance response confirms that the connection works, even if the available balance is zero.
The check is free. If your available balance does not cover the task, add funds in the
[Glasser console](https://app.glasser.ai).

## First task and rewards

After setup, your agent recommends one small task and waits for you to choose it. It then
follows the tool's pricing and approval rules before a paid Run. If you already requested a
task, it continues that task.

A balance response can include `first_run_reward` with `amount_usd`, `expires_at`, and a
`description` generated by the server for your current reward state. The agent relays this
message in your language alongside its task suggestion. If the field is absent, it does
not mention rewards. It uses the balance response from setup instead of making extra calls
just for rewards.

## Manage access

Browser sign-in creates a Key named `MCP · <client>` in your Workspace. To remove the client's
access, revoke that Key on the [Keys page](https://app.glasser.ai/keys).
Disconnecting or removing Glasser in the client alone does not revoke the Key.

## Endpoint

```
POST https://api.glasser.ai/mcp
```

Use **Streamable HTTP**. Authenticate through browser sign-in or send a Glasser
Key in the `Authorization: Bearer` header.

> [accordion] Transport and authentication details
>
> The server is stateless and returns JSON responses. Each request includes
> either a Key or an OAuth access token that resolves to a Workspace Key.
>
> OAuth clients discover the authorization server from `resource_metadata` in
> the `WWW-Authenticate` header of a `401` response. They need only the server URL
> to start this flow.

## Tools

Glasser exposes seven tools. The Agent uses `search` to discover Endpoints,
then `inspect` and `run` to retrieve data. Each Endpoint does not require a separate MCP tool.

| Tool | Purpose |
| - | - |
| `search` | Find Endpoints your Key can run. |
| `inspect` | Get an Endpoint's input schema, current Price, version, and run mode. |
| `run` | Execute an Endpoint. Requires an `idempotency_key`. |
| `runs_get` | Read a Run's status, Provider response, and charge. |
| `runs_list` | Review Runs, newest first, with pagination. |
| `runs_stop` | Request a stop. Check the returned status to see whether it stopped. |
| `balance` | Check available funds and confirm the connection. |

## Rules that keep spending safe

The server provides these instructions to the Agent, as the [Skill](https://glasser.ai/docs/setup-skill.md)
does for CLI agents:

* **Use existing connections first.** Use Glasser where your own Keys and integrations do not cover the request.
* **Check before spending.** Inspect the Price, start with small requests, and get approval before speculative, repeated, or bulk Runs.
* **Retry with the same key.** Keep the `idempotency_key` and execution parameters to retrieve the original Run without a second charge.
* **Read status and charge separately.** Check `provider_response` and `charge_usd`, even for a `COMPLETED` Run.

> [accordion] Retries and error responses
>
> A replayed MCP Run includes `replayed: true`. Amounts in `charge_usd` are exact
> USD decimal strings. A Provider 404 can be a `COMPLETED` Run charged under the
> Endpoint's `NO_RESULT` rule.
>
> Provider errors remain in the Run's `provider_response.http_status` and
> `provider_response.error`. Check these fields even when the tool result has
> no `isError` flag. Use `runs_get` for the full error body; `runs_list` returns
> summaries.
>
> Actionable refusals, such as `insufficient_balance`, `rate_limited`, and
> Policy restrictions, return tool results with `isError`. They are not protocol
> errors. For rate limits, read `retry_after_ms` before retrying.

## When to prefer the CLI

For local agents such as Claude Code, Codex, and Cursor, the [Skill](https://glasser.ai/docs/setup-skill.md) plus
the [CLI](https://glasser.ai/docs/cli.md) is the recommended path. The Skill guides setup and carries the working rules.
For Claude Chat and Cowork, follow the [connector guide](https://glasser.ai/docs/mcp-server/claude.md).


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