# Connect an AI agent

Your AI agent can do everything you do in the TryFast app: install the snippet, look at your pages, build experiments, share preview links and read results. It connects through TryFast's MCP server, one URL for every client:

```text
https://tryfast.eu/mcp
```

Launches wait for your approval unless you give the agent full access. This page shows how to connect each client; the [MCP reference](mcp.md) lists every tool.

## Claude Code

```bash
claude mcp add --transport http tryfast https://tryfast.eu/mcp
```

Then type `/mcp` in Claude Code, choose tryfast and Authenticate. A TryFast window opens in your browser (see [What happens when you connect](#what-happens-when-you-connect)). To share the server with your team, add `--scope project`, which writes it to `.mcp.json` in your repository.

## Claude (web, desktop and mobile)

1. Open **Customize, Connectors, Add custom connector**.
2. Name: `TryFast`. URL: `https://tryfast.eu/mcp`.
3. Choose **Connect** and approve in the window that opens.

## ChatGPT

1. Open **Settings, Apps, Advanced settings** and turn on **Developer mode**.
2. **Create app**: name `TryFast`, MCP server URL `https://tryfast.eu/mcp`, authentication **OAuth**.
3. Connect and approve in the window that opens.

## Cursor

Use the **Add to Cursor** button on [/ai-agents](/ai-agents), or add the server to `~/.cursor/mcp.json`:

```json
{"mcpServers": {"tryfast": {"url": "https://tryfast.eu/mcp"}}}
```

## VS Code

Open `https://tryfast.eu/go/vscode-mcp` to install the server in VS Code, or run:

```bash
code --add-mcp '{"name":"tryfast","type":"http","url":"https://tryfast.eu/mcp"}'
```

## Other agents

Any MCP client that supports remote servers with OAuth works: give it the URL `https://tryfast.eu/mcp`. It discovers everything else itself. Agents without a browser use an API key ([Headless agents and CI](#headless-agents-and-ci)).

## What happens when you connect

When your client connects for the first time, it opens a TryFast window in your browser:

1. **Sign in, or continue without an account.** Without an account TryFast creates a free workspace for you on the spot and shows its recovery link once. Save that link: it opens the workspace in another browser and saves it to an account later ([Workspaces and accounts](account.md)).
2. **Choose the workspace** the agent may use. An agent always works in exactly one workspace.
3. **Choose the permission**:
   - **Read only**: the agent reads projects, experiments, results and events.
   - **Build, I approve launches** (default): the agent also creates and edits projects, goals and experiments and shares preview links. Launches, traffic changes and stops wait for your approval.
   - **Full access**: the agent may also launch and stop on its own. Offered only when the client asks for it and your role allows it. Viewers can grant Read only.
4. **Allow.** The client receives access to that workspace with that permission. Connecting the same client again replaces its permission.

### Approval links

With the default permission, when your agent starts, resumes or schedules an experiment, changes its traffic, stops or ships it, or changes a project setting that affects your live site, TryFast creates an approval request instead of acting. The agent shows you a link such as `https://tryfast.eu/app/approve/apr_Mn2Bv3Cx4Z`. The approval page shows exactly what will go live, with preview links for every variation. Nothing changes until you approve.

- Only a person approves, in the browser. An agent can never approve its own request, and it must not open approval or claim links itself.
- Requests expire after 24 hours. When the agent changes the experiment after asking, the request is replaced and the agent asks again, so what you approve is what goes live.
- Pausing never needs approval: any agent with write access can pause an experiment immediately.

## Connected agents

The app lists every connected agent under **AI agents**: the client's name (verified for known clients such as claude.ai and chatgpt.com, "App on your computer" for local clients), its permission, who connected it and when it was last used. **Revoke** cuts its access immediately. Every action an agent takes appears in the activity log with its name and the person it acts for, for example "Claude for liam@acme-shop.de".

## Headless agents and CI

Agents without a browser, scripts and CI jobs use an API key. Create one in the app under **API keys** with a permission (Read, Build or Full, the same levels as above) and send it as a header:

```json
{"mcpServers": {"tryfast": {
  "type": "http",
  "url": "https://tryfast.eu/mcp",
  "headers": {"Authorization": "Bearer ${TRYFAST_API_KEY}"}
}}}
```

The key is shown once. Keep it in a secret store, never in a repository.

### Start without an account from a script

An agent that has only HTTP can create a workspace, a project and an API key with one request:

```bash
curl -s https://tryfast.eu/api/v1/anonymous-workspaces \
  -H 'Content-Type: application/json' \
  -d '{"website_url":"https://shop.example","issue_api_key":true}'
```

The response contains the workspace, the project with its snippet, an API key (`tf_pk_...`), the MCP URL and a `claim_url`. **The `claim_url` is for the person, never for the agent**: hand it to the person you work for. Launches requested with the key wait for approval, and approving needs a signed-in person, who opens the `claim_url`, signs in (which saves the workspace to their account) and approves. Workspace creation is limited to 3 per hour per network address.

## Starter prompts

- "Install TryFast on acme-shop.de and check that it works."
- "Look at https://acme-shop.de/pricing and propose three A/B tests, ranked by expected impact and effort."
- "Create an A/B test for a shorter checkout button text, with "Started checkout" as the goal, and send me preview links."
- "How are my running experiments doing? Tell me which ones are safe to act on."

## Safety

- Text from your pages and events reaches the agent as labelled, truncated data fields, never as instructions, so a page cannot tell your agent what to do.
- Agents see aggregated results and recent technical events with random, pseudonymous visitor ids, never IP addresses. Do not put names or email addresses into event properties.
- Each connection is limited to 120 calls a minute, 30 writes a minute and 20 launch-type actions an hour.
- Agent access is included in every plan, including Free.
