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

# Claude Code Integration

Here's how to connect Hackle MCP in [Claude Code](https://code.claude.com), Anthropic's official CLI.

{% stepper %}
{% step %}

### Register the MCP server

```bash
claude mcp add --transport http hackle-mcp https://mcp.hackle.io/mcp
```

By default, it is registered only locally for the current project. To use it across all projects:

```bash
claude mcp add --transport http --scope user hackle-mcp https://mcp.hackle.io/mcp
```

{% endstep %}

{% step %}

### Authenticate

Inside a Claude Code session:

```
/mcp
```

You'll see an indicator next to `hackle-mcp` showing that authentication is required. When you select the item, a browser opens and displays the Hackle authentication screen. Paste your Hackle API key into the **API key field** and proceed.

<figure><img src="/files/FVqadU1S0BLMslh46Snw" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Verify the connection

```
/mcp
```

Once the `hackle-mcp` status shows as connected, you're all set. You can use the tools in a new prompt.
{% endstep %}
{% endstepper %}

### Migrating from a Local Server

If you were previously using a local MCP server (in the form of an npm package) registered with Claude Code, you can follow the steps below to move to the remote server.

#### 1. Remove the existing local server

```bash
claude mcp list                          # Check the registered name
claude mcp remove hackle-mcp             # Change it accordingly if the name is different
```

#### 2. Register the remote server

Register by following **Method A** or **Method B** above. You can use the same API key value you were using before.

#### 3. Clean up the local server package (optional)

If you have a globally installed npm package, remove it.

```bash
npm uninstall -g @hackle-io/hackle-mcp
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/ai/model-context-protocol/claude/claude-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
