# Coding agents (/docs/connect/coding-agents)

Coding agents add quarry from a command or a config file. Each tool below has up to
three variants, labeled No account, Sign in, and API key. On this site, choosing one
switches every example on the page.

* No account uses the free address, `https://quarry.market/api/mcp`, to search quarry
  and read free datasets.
* Sign in uses the sign-in address, `https://quarry.market/api/agent/mcp`, to also use
  your subscriptions. The agent opens a browser: sign in to quarry and click
  **Connect agent**.
* API key uses the free address with an [API key](/docs/subscriptions#api-keys)
  sent as `Authorization: Bearer qk_...`, to use your subscriptions from an agent
  that can't open a browser, such as one running on a server.

The API key variants read the key from the `QUARRY_API_KEY` environment variable:

```bash
export QUARRY_API_KEY=qk_...
```

Cursor, VS Code, Devin, and Codex read the variable each time they connect, so
their config files never hold the key. The Claude Code, Gemini CLI, and OpenClaw
commands save the key's value in your user settings: keep those out of any file you
commit.

To share a setup through your repository, commit the Sign in variant, or the API key
variant of Cursor, VS Code, or Devin: neither holds a secret. Each person then signs
in or sets their own key. See [Share with your team](/docs/subscriptions#teams).

To pay per question from a wallet instead of a subscription, see
[Give your assistant a wallet](/docs/wallet).

## Claude Code [#claude-code]

No account:

```bash
claude mcp add --transport http quarry https://quarry.market/api/mcp
```

Sign in:

```bash
claude mcp add --transport http quarry https://quarry.market/api/agent/mcp
# Then, inside Claude Code, run /mcp, pick quarry, and sign in.
```

API key:

```bash
claude mcp add --transport http quarry https://quarry.market/api/mcp \
  --header "Authorization: Bearer $QUARRY_API_KEY"
```

Add `--scope user` to use quarry in every project. To share it through `.mcp.json`,
add `--scope project` to the Sign in command, or put the API key header in single
quotes, so your shell leaves the variable for Claude Code to read when it connects:

```bash
claude mcp add --scope project --transport http quarry https://quarry.market/api/mcp \
  --header 'Authorization: Bearer ${QUARRY_API_KEY}'
```

Already added quarry in Claude on the web? Signed in to Claude Code with the same
Claude account, `/mcp` lists it as `claude.ai quarry`, with nothing to add here. See
[Chat assistants](/docs/connect/assistants#claude).

## Cursor [#cursor]

Add quarry to `~/.cursor/mcp.json` for every project, or to `.cursor/mcp.json` for
one.

No account:

```json
{
  "mcpServers": {
    "quarry": { "url": "https://quarry.market/api/mcp" }
  }
}
```

Sign in:

```json
{
  "mcpServers": {
    "quarry": { "url": "https://quarry.market/api/agent/mcp" }
  }
}
```

API key:

```json
{
  "mcpServers": {
    "quarry": {
      "url": "https://quarry.market/api/mcp",
      "headers": { "Authorization": "Bearer ${env:QUARRY_API_KEY}" }
    }
  }
}
```

## VS Code [#vs-code]

quarry's tools run in GitHub Copilot chat. Add quarry to `.vscode/mcp.json` in your
project, or run MCP: Open User Configuration from the Command Palette to add it for
every workspace.

No account:

```json
{
  "servers": {
    "quarry": { "type": "http", "url": "https://quarry.market/api/mcp" }
  }
}
```

Sign in:

```json
{
  "servers": {
    "quarry": { "type": "http", "url": "https://quarry.market/api/agent/mcp" }
  }
}
```

API key:

```json
{
  "inputs": [
    { "type": "promptString", "id": "quarry-key", "description": "quarry API key", "password": true }
  ],
  "servers": {
    "quarry": {
      "type": "http",
      "url": "https://quarry.market/api/mcp",
      "headers": { "Authorization": "Bearer ${input:quarry-key}" }
    }
  }
}
```

With the API key setup, VS Code asks for the key the first time and stores it
securely. Copilot Business and Enterprise admins can turn MCP servers off for
their organization.

## Codex [#codex]

The same setup works in the Codex CLI, the Codex IDE extension, and the ChatGPT
desktop app, which share `~/.codex/config.toml`.

No account:

```bash
codex mcp add quarry --url https://quarry.market/api/mcp
```

Sign in:

```bash
codex mcp add quarry --url https://quarry.market/api/agent/mcp
codex mcp login quarry
```

API key:

```bash
codex mcp add quarry --url https://quarry.market/api/mcp \
  --bearer-token-env-var QUARRY_API_KEY
```

## Devin [#devin]

Devin Desktop (formerly Windsurf) and the Devin CLI read
`~/.config/devin/mcp_config.json` (`%APPDATA%\devin\mcp_config.json` on Windows)
for every project, and `.devin/mcp_config.json` in a project.

No account:

```json
{
  "mcpServers": {
    "quarry": { "url": "https://quarry.market/api/mcp" }
  }
}
```

Sign in:

```json
{
  "mcpServers": {
    "quarry": { "url": "https://quarry.market/api/agent/mcp" }
  }
}
```

API key:

```json
{
  "mcpServers": {
    "quarry": {
      "url": "https://quarry.market/api/mcp",
      "headers": { "Authorization": "Bearer ${env:QUARRY_API_KEY}" }
    }
  }
}
```

To sign in from the CLI, run `devin mcp login quarry`. If your team's admin keeps
an allowlist of MCP servers, quarry has to be on it.

## Gemini CLI [#gemini-cli]

Gemini CLI connects without an account or with an API key.

No account:

```bash
gemini mcp add --transport http --scope user quarry https://quarry.market/api/mcp
```

Sign in:

```bash
# quarry doesn't support sign-in from Gemini CLI yet: use the API key command.
```

API key:

```bash
gemini mcp add --transport http --scope user \
  -H "Authorization: Bearer $QUARRY_API_KEY" quarry https://quarry.market/api/mcp
```

Keep `--scope user`: without it, quarry goes into the project's
`.gemini/settings.json`, and with the API key command, so does your key.

## Goose [#goose]

Run `goose configure`, choose Add Extension, then Remote Extension (Streamable
HTTP). Name it `quarry` and enter one of the addresses:

* the free address, `https://quarry.market/api/mcp`, to use quarry without an account;
* the sign-in address, `https://quarry.market/api/agent/mcp`, to use your
  subscriptions. Goose opens a browser to sign in the first time it connects.

In Goose Desktop, the same form is under Extensions → Add custom extension. There's
no API key variant for Goose: use the sign-in address to reach your subscriptions.

## OpenClaw [#openclaw]

Always set the transport: without it, OpenClaw falls back to an older one that
quarry doesn't serve.

No account:

```bash
openclaw mcp add quarry --url https://quarry.market/api/mcp --transport streamable-http
```

Sign in:

```bash
openclaw mcp add quarry --url https://quarry.market/api/agent/mcp \
  --transport streamable-http --auth oauth
openclaw mcp login quarry
```

API key:

```bash
openclaw mcp add quarry --url https://quarry.market/api/mcp \
  --transport streamable-http --header "Authorization: Bearer $QUARRY_API_KEY"
```

## Check that it works [#check-that-it-works]

Ask your agent something like "Search quarry for sources on chip lead times and
cite them." It should call quarry's `search` tool, then `ask` on the dataset it
picks. If the tools don't show up, check the address for a typo: it has no `www`
and no trailing slash.
