> 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.md).

# Connect your AI tool (MCP)

Letting an AI client reach your connectors as tools.

Everything you build in fastn (connectors, actions, workflows) can be used from an AI client over the Model Context Protocol. The client sees your fastn workflows and the fastn platform tools, and reaches your connectors' actions through those platform tools, with the same customer scoping and the same permission model as everything else. Your agent can also build new integrations for you, right in the chat: see [Building from your AI agent](/build/building-from-your-ai-agent.md).

### Connecting

Click **Connect AI tools** in the top bar, or open **Embed → API keys and MCP** and the **MCP server** tab. Both show the same picker: **Use fastn from Claude or any MCP client**. Both need the **Developer** role or above; below that, neither is shown.

<figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-8d2acc6e0b721a95dfb03e3b0a657d9fee893390%2Fmcp-connect-ai-tools-dialog.webp?alt=media" alt="fastn&#x27;s dialog titled Use fastn from Claude or any MCP client, reading Add fastn as an MCP server and Claude, ChatGPT, Cursor or any MCP client can build integrations for you, right in the chat, with Claude recommended and an Add to Claude button"><figcaption><p><strong>Add to Claude</strong> is the one-click path. The tiles under <strong>Other</strong> give each client's own steps.</p></figcaption></figure>

Every client uses the same MCP server URL, shown at the bottom of the dialog with a **Copy** button:

```
https://mcp.fastn.dev/fastn-workspace
```

### How your agent connects

You add fastn as an MCP server at that URL and sign in. The client sends you to fastn, where you sign in, so no API key is needed. If you belong to more than one fastn org, fastn also asks which workspace the client works in; with one org it connects straight away.

| Client                                                                       | Where you add fastn                                                                                                      |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [Claude](/build/building-from-your-ai-agent/mcp-gateway/claude.md)           | **Settings** → **Connectors** → **Add custom connector**, or **Add to Claude** in fastn                                  |
| [Claude Code](/build/building-from-your-ai-agent/mcp-gateway/claude-code.md) | `claude mcp add --transport http fastn <URL>`                                                                            |
| [ChatGPT](/build/building-from-your-ai-agent/mcp-gateway/chatgpt.md)         | Turn on **Developer mode** (**Settings** → **Apps & Connectors** → **Advanced settings**), then **Add custom connector** |
| [Cursor](/build/building-from-your-ai-agent/mcp-gateway/cursor.md)           | **Add to Cursor** in fastn, or **Customize** → **MCPs**                                                                  |
| [VS Code](/build/building-from-your-ai-agent/mcp-gateway/vscode.md)          | **Install in VS Code** in fastn, or `.vscode/mcp.json`                                                                   |
| [Codex](/build/building-from-your-ai-agent/mcp-gateway/codex.md)             | `codex mcp add fastn --url <URL>`                                                                                        |
| [Antigravity](/build/building-from-your-ai-agent/mcp-gateway/antigravity.md) | `~/.gemini/config/mcp_config.json`, then **Customizations** → **Authenticate**                                           |
| [Devin](/build/building-from-your-ai-agent/mcp-gateway/devin.md)             | **Customize** → **MCPs** → **New MCP**                                                                                   |
| [Cline](/build/building-from-your-ai-agent/mcp-gateway/cline.md)             | **MCP** → **Add Remote Server**, or `cline_mcp_settings.json`                                                            |
| [Lovable](/build/building-from-your-ai-agent/mcp-gateway/lovable.md)         | **Connectors** → **Chat connectors** → **New MCP server**                                                                |
| [Bolt](/build/building-from-your-ai-agent/mcp-gateway/bolt.md)               | **Connectors (MCP)** → **Custom MCP server**                                                                             |

#### Any other MCP client

Any client that speaks Streamable HTTP and OAuth can add fastn the same way: give it the URL above and sign in when it asks.

### Scoping

A client that signs in acts as you. Its fastn tools run in the workspace you signed in to (or picked, if you belong to more than one org), with your own role in that org, so it can do what you can do in the dashboard and nothing more. Picking **The org selected in fastn** makes it follow whichever org you switch to in the dashboard; picking a named org pins it there.

{% hint style="warning" %}
An MCP client can change real things in your org, the same as you can. Approve tool calls you don't expect to see, and sign the client out when you stop using it.
{% endhint %}

### Watching it

Gateway activity lands in the same places as everything else: runs appear in **Operate → Activity →** [**Executions**](/operate/operate/executions.md), with the calling identity in the **Triggered by** column.

An MCP client spends no fastn AI credits. The **By agent** breakdown in the credits popover in the top bar covers fastn's own agents, such as Build with AI, not your AI tool.

### The A2A option

The widget's Embed tab lists **A2A** (agent-to-agent), alongside Iframe and SDK, marked *soon*. That is the customer-facing counterpart: your customer's own agent reaching the integrations you offer. See [Embedding the widget](/embed/embedding.md).

### In this section

* [Claude](/build/building-from-your-ai-agent/mcp-gateway/claude.md)
* [Claude Code](/build/building-from-your-ai-agent/mcp-gateway/claude-code.md)
* [ChatGPT](/build/building-from-your-ai-agent/mcp-gateway/chatgpt.md)
* [Cursor](/build/building-from-your-ai-agent/mcp-gateway/cursor.md)
* [VS Code](/build/building-from-your-ai-agent/mcp-gateway/vscode.md)
* [Codex](/build/building-from-your-ai-agent/mcp-gateway/codex.md)
* [Antigravity](/build/building-from-your-ai-agent/mcp-gateway/antigravity.md)
* [Devin](/build/building-from-your-ai-agent/mcp-gateway/devin.md)
* [Cline](/build/building-from-your-ai-agent/mcp-gateway/cline.md)
* [Lovable](/build/building-from-your-ai-agent/mcp-gateway/lovable.md)
* [Bolt](/build/building-from-your-ai-agent/mcp-gateway/bolt.md)


---

# 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.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.
