> For the complete documentation index, see [llms.txt](https://docs.flowcp.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowcp.ai/guides/integrate-with-ai-clients.md).

# Integrate with AI clients

Once your MCP server is published, you connect it to an AI client by adding a small JSON config. This page covers setup for Claude Desktop, Cursor, ChatGPT, Grok, and VS Code.

The config snippet with your exact server URL is on the **Distribute → MCP clients** page in FlowCP — copy it from there rather than constructing it manually. The page shows the active branch's URL (production once deployed, otherwise the development URL) and a copy-ready config per client. Each client tab is self-contained: config-file clients show a copyable JSON snippet, and URL-based clients (such as ChatGPT) show the server URL with its own copy button.

***

## Claude Desktop

Claude Desktop reads MCP server config from `claude_desktop_config.json`.

**Location:**

| OS      | Path                                                              |
| ------- | ----------------------------------------------------------------- |
| macOS   | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Windows | `%APPDATA%\Claude\claude_desktop_config.json`                     |

**Add the snippet:**

```json
{
  "mcpServers": {
    "my-app": {
      "url": "https://runtime.flowcp.io/mcp/<server-id>",
      "type": "http"
    }
  }
}
```

If `claude_desktop_config.json` does not exist, create it. If it already contains an `mcpServers` key, add the new entry inside that object.

After saving, quit and relaunch Claude Desktop. Your tools appear in the tools panel (the wrench icon in the message composer).

***

## Cursor

Cursor supports MCP servers via a project-level or global config file.

**Project-level** (applies only to the current workspace):

Create or edit `.cursor/mcp.json` in your project root:

```json
{
  "mcpServers": {
    "my-app": {
      "url": "https://runtime.flowcp.io/mcp/<server-id>",
      "transport": "http"
    }
  }
}
```

**Global** (applies to all Cursor projects):

Open Cursor Settings → MCP and add the server from the UI, or edit the global `mcp.json` at:

| OS      | Path                             |
| ------- | -------------------------------- |
| macOS   | `~/.cursor/mcp.json`             |
| Windows | `%USERPROFILE%\.cursor\mcp.json` |

Restart Cursor after saving. Your tools appear in Cursor's Composer panel when the MCP server is connected.

***

## ChatGPT

The ChatGPT desktop app (macOS and Windows) supports MCP servers.

Open ChatGPT desktop app → Settings → Tools & integrations → Add MCP server, and enter:

* **Name**: `my-app` (or any label)
* **URL**: `https://runtime.flowcp.io/mcp/<server-id>`
* **Transport**: Streamable HTTP

Or paste the JSON snippet directly if the app offers a JSON import option:

```json
{
  "servers": [
    {
      "name": "my-bubble-app",
      "url": "https://runtime.flowcp.io/mcp/<server-id>",
      "transport": "streamable-http"
    }
  ]
}
```

***

## Grok (xAI)

Grok connects to a FlowCP server over Streamable HTTP and discovers OAuth on its own — there is no client ID or secret to create by hand. Add the server from Grok's custom MCP connector settings and enter:

* **Name**: `my-app` (or any label)
* **URL**: `https://runtime.flowcp.io/mcp/<server-slug>`

On the first call Grok reads FlowCP's protected-resource metadata, registers itself dynamically (RFC 7591), and runs the authorization-code flow with PKCE. The user signs in with your API's provider and Grok stores the resulting token.

Grok checks that the resource FlowCP advertises matches the URL you entered, so paste the URL exactly as the **Deploy** page shows it — either the slug URL or the internal-id URL works, but do not mix one with the other.

***

## VS Code

VS Code (with GitHub Copilot agent mode) supports MCP servers via an `mcp.json` config file.

Run **MCP: Add Server** from the Command Palette, or create `.vscode/mcp.json` in your project:

```json
{
  "servers": {
    "my-app": {
      "url": "https://runtime.flowcp.io/mcp/<server-id>",
      "type": "http"
    }
  }
}
```

Start the server from the MCP view, then use its tools from Copilot Chat in agent mode.

***

## End-user OAuth on first use

When an end user calls a FlowCP tool for the first time from an AI client, FlowCP checks whether it has a valid access token for that user. If not, the response includes an authorization URL. The AI client typically surfaces this as a prompt: "Please authorize access to your account."

The user clicks the link, logs in with your API's provider, and grants access. After that, all subsequent tool calls from that client use their access token automatically.

Clients that support it discover all of this automatically, with no client ID or secret to configure: the first unauthenticated call returns a `WWW-Authenticate` challenge naming the server's protected-resource metadata, the client registers itself (RFC 7591), and it runs the authorization-code flow with PKCE. The challenge names the resource under the same URL you connected with, so a client that validates the two match — as Grok does — accepts either the slug URL or the internal-id URL.

***

## Verifying the connection

In the AI client, look for your tools in the tools list (exact UI varies by client). If the server does not appear:

1. Confirm the server status is **published** on the FlowCP Deploy page.
2. Check that the URL in the config points to the MCP runtime (e.g. `runtime.flowcp.io`), not the dashboard.
3. Restart the AI client — most clients only reload MCP config on startup.
4. If the client reports a resource mismatch or an invalid `client_id`, see [Troubleshooting → OAuth errors](/support/troubleshooting.md).

See [Troubleshooting](/support/troubleshooting.md) for more.
