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

# Connect Claude Code

Use the Dapta MCP in Claude Code. If Dapta is connected in your Claude account it is already there; otherwise add it with one terminal command and sign in, or pass an API key in a header.

Claude Code can reach Dapta in three ways. Signing in with your Dapta account is the recommended one, and there is nothing to install.

***

## Option A: reuse the connector from your Claude account

Claude Code uses the connectors of the Claude account you are signed in with. If Dapta is already connected in claude.ai or Claude Desktop, it is in Claude Code too.

**Step 1:** Connect Dapta in Claude first. See [Connect claude.ai & Claude Desktop](https://docs.dapta.ai/dapta-mcp/setup/connect-claude-desktop.md).

***

**Step 2:** Open Claude Code signed in with the same Claude account and run `/mcp`. Dapta shows up under the claude.ai connectors. Then ask, for example: "List my agents in Dapta".

***

## Option B: add Dapta with one command and sign in

Use this when you run Claude Code with an API key from the Claude Console, or without a Claude account.

**Step 1:** Run this in any terminal:

{% code title="terminal" overflow="wrap" %}

```bash
claude mcp add --transport http --scope user dapta https://mcp.dapta.ai/mcp
```

{% endcode %}

`--scope user` makes Dapta available in every project on your computer, not only in the folder where you ran the command.

***

**Step 2:** Start Claude Code, run `/mcp`, choose **dapta** and then **Authenticate**. The browser opens Dapta's sign-in page. Enter your Dapta email and the 6-digit code we email you.

***

**Step 3:** Choose your workspace. If your account has several, Claude lists them by name and asks which one to work in. To change later, say "switch to \<workspace>".

***

## Option C: API key

Use this when you want the connection fixed to one workspace, or in scripted environments where a browser sign-in is not possible.

**Step 1:** [Create an API key](https://docs.dapta.ai/dapta-mcp/setup/mint-your-api-key.md). The dialog that shows your new key also shows this command, ready to copy.

***

**Step 2:** Run the command, replacing `<your-key>` with your key:

{% code title="terminal" overflow="wrap" %}

```bash
claude mcp add --transport http --scope user dapta-ai https://mcp.dapta.ai/mcp \
  --header "x-api-key: <your-key>"
```

{% endcode %}

With a key, the workspace is fixed by the key and Claude never asks which one to use.

***

## Try it

Start a session and ask:

> **Who am I in Dapta?**

Claude Code sees every Dapta tool as soon as it connects. There is no skills bundle to download and no extra install step.

{% content-ref url="/pages/y0N0ytQ0C9FIgnF9BZoY" %}
[Verify your connection](https://docs.dapta.ai/dapta-mcp/setup/verify.md)
{% endcontent-ref %}


---

# 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.dapta.ai/dapta-mcp/setup/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.
