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

# Claude Code

Add fastn to Claude Code with one command, sign in, and build integrations from the terminal.

Claude Code adds fastn as a remote MCP server with one command. Sign in once, then ask for the integration in a Claude Code session.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-36f9321dc5191cf787b50e1021d6eb0715e61d5b%2Fmcp-fastn-tab-claude-manual.webp?alt=media" alt="fastn&#x27;s MCP server page with the second Claude tile selected, showing the steps to add fastn by hand, a Claude Code command claude mcp add --transport http fastn https://mcp.fastn.dev/fastn-workspace, a Claude Desktop config snippet and an Add for the whole organization link"><figcaption><p>The command is on the second <strong>Claude</strong> tile under <strong>Connect AI tools</strong> in fastn.</p></figcaption></figure>

## Add fastn

{% stepper %}
{% step %}

#### Run the command

```
claude mcp add --transport http fastn https://mcp.fastn.dev/fastn-workspace
```

Claude Code prints *Added HTTP MCP server fastn with URL: <https://mcp.fastn.dev/fastn-workspace> to local config*. By default the server is added for the current project only. Add `--scope user` to use fastn in every project.
{% endstep %}

{% step %}

#### Sign in

```
claude mcp login fastn
```

Or, inside a Claude Code session, type `/mcp`, pick **fastn** and choose **Authenticate**.

fastn opens in your browser. Sign in if asked. If you belong to more than one fastn org, pick the workspace Claude Code works in and click **Connect**.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-965eee9b2e4f6a6c0251988adb8a6781289257c3%2Fmcp-claude-code-choose-workspace.webp?alt=media" alt="fastn&#x27;s page titled Which workspace should Claude Code (claude.ai) use?, with The org selected in fastn chosen, a list of orgs and a Connect button"><figcaption><p><strong>The org selected in fastn</strong> follows whichever org you have open in the fastn dashboard; picking a named org pins Claude Code to it.</p></figcaption></figure>

The terminal prints *Authenticated with "fastn". Its tools are now available in Claude Code.*
{% endstep %}

{% step %}

#### Check it

```
claude mcp list
```

```
fastn: https://mcp.fastn.dev/fastn-workspace (HTTP) - ✔ Connected
```

{% endstep %}
{% endstepper %}

## Use it

Start `claude` and ask for the outcome in one sentence. To check the connection first, ask *Use fastn to tell me which org I'm in.* Claude Code asks before it runs a fastn tool; approve it, and it answers with the org you picked when signing in.

From here Claude Code works through the same steps as every agent: see [Building from your AI agent](https://docs.fastn.ai/build/building-from-your-ai-agent.md).

## Claude Desktop config file

The Claude desktop app normally uses the connector you add in claude.ai: see [Claude](https://docs.fastn.ai/build/building-from-your-ai-agent/mcp-gateway/claude.md). If you manage it through `claude_desktop_config.json` instead, that file only starts local servers, so bridge to fastn with `mcp-remote`:

```json
{
  "mcpServers": {
    "fastn": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.fastn.dev/fastn-workspace"]
    }
  }
}
```

A `"url"` entry in that file is ignored, and no fastn tools appear.

## Troubleshooting

* **`fastn ... ! Needs authentication` in `claude mcp list`.** Run `claude mcp login fastn`.
* **The browser shows `{"error":"redirect_uri mismatch"}`.** Claude Code sign-in failed this way on fastn before 27 October 2026. Run `claude mcp login fastn` again.
* **Claude Code works on the wrong org.** Run `claude mcp logout fastn`, then `claude mcp login fastn` and pick the workspace again.


---

# 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.fastn.ai/build/building-from-your-ai-agent/mcp-gateway/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.
