---
title: "Connect an AI agent with MCP"
description: "Choose how to connect Claude, Cursor, or another agent to Appfly: sign in with OAuth or use an API key."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.appfly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an AI agent with MCP

Appfly has a remote [MCP](https://modelcontextprotocol.io) server. Once your agent is connected, you can ask it in plain words to make screenshots, videos, and translations in your account.

Open [MCP setup](https://fly.appfly.dev/account/mcp) in Appfly to see your server address. For the hosted app it is:

```txt
https://fly.appfly.dev/mcp
```

The server uses **Streamable HTTP**. Your agent must support remote MCP servers.

## Pick a connection method

There are two ways to let an agent act as you. Both give the same access. They differ in how you set them up and how you take access away.

| | [OAuth (sign in)](/ai/mcp-oauth) | [API key](/ai/mcp-api-key) |
|---|---|---|
| Setup | Add the server address, then click Allow in your browser | Create a key in Appfly and paste it into your agent |
| You handle a secret | No | Yes. You copy and store the key |
| Lasts | Access renews on its own for 30 days after the last refresh | Until you revoke it |
| Remove access | Disconnect the agent on the Developer API page | Revoke the key on the Developer API page |
| Good for | Claude Code, Cursor, and the Claude app on your own computer | Scripts, CI, servers, and clients that cannot open a browser |

If you are not sure, start with OAuth. It is the easiest, and you never copy a secret.

- **Connect with OAuth** — Sign in once and click Allow. Nothing to copy.
- **Connect with an API key** — Create a key and send it as a Bearer token.

## What an agent can do

Either method gives the agent the same access as your account. It can see all your apps and files, create and delete apps and files, generate screenshots and videos with AI, edit text and styles, and export your work.

It uses your plan limits and your credits. A key or a connection is never limited to one app. See the [tool reference](/api/tools) for every tool.

## Set up your agent

The [agent setup guide](/ai/clients) has the commands for each agent, for both methods:

- **Claude Code** — `claude mcp add --transport http appfly https://fly.appfly.dev/mcp`
- **Cursor** — Add the server to `.cursor/mcp.json`.
- **Codex** — `codex mcp add appfly --url https://fly.appfly.dev/mcp`
- **Claude app, VS Code, Gemini CLI, and more** — Steps and commands for each one.

## Check that it works

After you connect, ask your agent:

> Check my Appfly plan and list my apps.

The agent should call `get_account` and `list_apps`. If it cannot connect, see [MCP troubleshooting](/ai/troubleshooting). Then try an [example workflow](/ai/workflows).

For the technical details of both methods, including the endpoints, see [Authentication](/api/authentication).

Source: https://docs.appfly.dev/ai/mcp/index.mdx
