> For the complete documentation index, see [llms.txt](https://docs.currents.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.currents.dev/ai/connect/claude-code.md).

# Claude Code

Use your Claude.ai Currents connector in Claude Code with no setup, or add the server with one command and a browser sign-in

Claude Code connects to the Currents MCP server at `https://mcp.currents.dev/mcp`. If you sign in to Claude Code with a Claude.ai account, use the Currents connector from Claude.ai. Otherwise, add the server to Claude Code yourself.

## Use the Claude.ai connector

If you sign in to Claude Code with a Claude.ai account, Claude Code loads the connectors you connected in Claude.ai. You do not need to run `claude mcp add`.

1. Connect Currents from the [Claude directory](https://claude.ai/directory/currents). Skip this step if you already connected it.
2. Start Claude Code and run `/mcp`.
3. Look for **claude.ai Currents MCP**. It shows as connected.

The connector follows your Claude account to every machine where you sign in.

If **claude.ai Currents MCP** is missing, run `/status` to see which credential Claude Code uses.

Claude Code loads Claude.ai connectors only with a Claude.ai login. It does not load them with `ANTHROPIC_API_KEY`, a `claude setup-token` token, Amazon Bedrock or Google Vertex AI.\
\
In that case, [add the server yourself](#add-the-server-yourself). See [Use MCP servers from claude.ai](https://code.claude.com/docs/en/mcp#use-mcp-servers-from-claude-ai).

## Add the server yourself

Use this method if Claude Code does not use a Claude.ai login, or if you want the server only in Claude Code.

{% hint style="warning" %}
Use the connector or this server, not both. If you set up both, Claude Code shows two Currents servers with two sets of tool names.
{% endhint %}

```bash
claude mcp add --transport http --scope user currents https://mcp.currents.dev/mcp
```

`--scope user` makes Currents available in every project on this machine. To share it with your team, see [Share the server with your team](#share-the-server-with-your-team).

## Sign in

1. Start Claude Code and run `/mcp`.
2. Select **currents** and choose **Authenticate**. A browser window opens.
3. Sign in to Currents, choose the organization Claude Code will work in, and approve the permissions it asks for. See [Sign in once](/ai/connect.md#sign-in-once) for what each screen shows.
4. Return to Claude Code. `/mcp` now shows **currents** as connected.

On a machine with no browser, run `claude mcp login currents --no-browser`. It prints the sign-in URL for you to open elsewhere, and asks you to paste back the address the browser lands on.

Claude Code renews the connection on its own from then on. `claude mcp logout currents` clears it on this machine. To revoke it everywhere, remove **Claude Code** under **Account → Connected Applications** in Currents.

## Check the connection

```bash
claude mcp list
```

`currents` shows `✔ Connected` once you are signed in, and `! Needs authentication` before that. Then ask Claude Code something only Currents can answer:

> What failed in the last run of `<project>` on main, and which of those tests are flaky?

If you use the Claude.ai connector, run `/mcp` and look for **claude.ai Currents MCP**.

## Ask before writes

Claude Code asks before it calls any MCP tool. To let it run the read tools on its own and keep asking for writes, allow the read tools by name in `.claude/settings.json`.

The tool names depend on how you connected Currents. A server you added names each tool `mcp__currents__<tool>`. The Claude.ai connector uses its name from Claude.ai, for example `mcp__claude_ai_Currents__<tool>`.\
\
To see the exact names, run `/mcp`, select the Currents connector and choose **View tools**.\
\
The Claude.ai connector example below uses a connector named **Currents**. If your connector has another name, change the prefix to match the names in **View tools**.

{% tabs %}
{% tab title="Server you added" %}

```json
{
  "permissions": {
    "allow": [
      "mcp__currents__currents-get-projects",
      "mcp__currents__currents-get-runs",
      "mcp__currents__currents-get-run-details",
      "mcp__currents__currents-find-run",
      "mcp__currents__currents-get-test-results",
      "mcp__currents__currents-get-context",
      "mcp__currents__currents-get-tests-performance"
    ]
  }
}
```

{% endtab %}

{% tab title="Claude.ai connector" %}

```json
{
  "permissions": {
    "allow": [
      "mcp__claude_ai_Currents__currents-get-projects",
      "mcp__claude_ai_Currents__currents-get-runs",
      "mcp__claude_ai_Currents__currents-get-run-details",
      "mcp__claude_ai_Currents__currents-find-run",
      "mcp__claude_ai_Currents__currents-get-test-results",
      "mcp__claude_ai_Currents__currents-get-context",
      "mcp__claude_ai_Currents__currents-get-tests-performance"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

Do not allow a Currents server or connector as a whole, for example `mcp__currents`. Each one includes `currents-delete-run`, which deletes a run permanently. [MCP tools and permissions](/ai/reference/mcp-server.md) lists every tool.

## Other options

### Share the server with your team

`--scope` decides where Claude Code saves the entry:

| Scope             | Available in                                    | Saved in                           |
| ----------------- | ----------------------------------------------- | ---------------------------------- |
| `user`            | Every project on this machine                   | `~/.claude.json`                   |
| `local` (default) | The current project, for you                    | `~/.claude.json`                   |
| `project`         | The current project, for everyone who clones it | `.mcp.json` in the repository root |

Add the server with `--scope project` and commit the `.mcp.json` it writes:

```json
{
  "mcpServers": {
    "currents": {
      "type": "http",
      "url": "https://mcp.currents.dev/mcp"
    }
  }
}
```

The file holds no credential. Each person who opens the project approves the server and signs in as themselves, so the connection carries their own role and organization.

### Use an API key

For a CI job, or anywhere no one can complete the browser sign-in, send a Currents API key in a header:

```bash
claude mcp add --transport http currents https://mcp.currents.dev/mcp \
  --header "Authorization: Bearer $CURRENTS_API_KEY"
```

In a committed `.mcp.json`, read the key from the environment so it never lands in the repository:

```json
{
  "mcpServers": {
    "currents": {
      "type": "http",
      "url": "https://mcp.currents.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${CURRENTS_API_KEY}"
      }
    }
  }
}
```

A key acts as the organization, not as a person. See [Connect with an API key](/ai/connect/remote.md#connect-with-an-api-key) for what a key can reach and how to revoke it.

## Troubleshooting

| What you see                                      | What to do                                                                                                                |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `! Needs authentication`                          | Run `/mcp`, select **currents** and choose **Authenticate**.                                                              |
| The wrong organization's data                     | Run `claude mcp logout currents`, then authenticate again and choose the other organization.                              |
| **claude.ai Currents MCP** is missing from `/mcp` | Run `/status`. If the credential is not a Claude.ai login, run `/login`, or add the server yourself.                      |
| Two Currents servers in `/mcp`                    | Keep one. Run `claude mcp remove currents` to keep the connector, or disconnect Currents in Claude.ai to keep the server. |

For other errors, see [Troubleshooting](/ai/connect.md#troubleshooting).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.currents.dev/ai/connect/claude-code.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
