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

# MCP connector

> Connect Claude and other AI tools to Pagent to review website tests and manage your optimization workflow.

Connect Pagent to Claude, Claude Code, Codex, Cursor, VS Code, Windsurf, Zed, or another MCP-compatible client. You can review website test performance, turn hypotheses into tests, and manage targeting and goals without leaving your existing workflow.

<Card title="Pagent MCP server" icon="server">
  `https://app.pagent.ai/api/mcp`

  **Transport:** Streamable HTTP<br />
  **Authentication:** OAuth 2.0 or personal token
</Card>

Pagent connections start with read access. During OAuth, you choose which organisations the client can access and whether to grant any write permissions.

## Before you connect

You need:

* A Pagent account with owner or administrator access to the organisation you want to connect
* MCP enabled for that organisation
* An MCP-compatible AI client
* An onboarded website with the Pagent SDK installed if you expect visitor data or test results

## Connect your AI client

OAuth is the recommended setup. Pagent asks you to choose organisations and permissions before the client can access anything.

<Tabs>
  <Tab title="Claude">
    <Steps>
      <Step title="Open connector settings">
        In Claude, open **Settings**, then **Connectors**.
      </Step>

      <Step title="Add Pagent">
        Choose **Add custom connector**, name it `Pagent`, and enter:

        ```text theme={"dark"}
        https://app.pagent.ai/api/mcp
        ```
      </Step>

      <Step title="Approve access">
        Sign in to Pagent, choose the organisations and permissions, then approve the connection.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Claude Code">
    Add the hosted server from a terminal:

    ```bash theme={"dark"}
    claude mcp add --transport http pagent https://app.pagent.ai/api/mcp
    ```

    Start Claude Code, run `/mcp`, and follow the browser sign-in flow.
  </Tab>

  <Tab title="Codex">
    The Codex app, CLI, and IDE extension share this configuration:

    ```bash theme={"dark"}
    codex mcp add pagent --url https://app.pagent.ai/api/mcp
    codex mcp login pagent
    ```

    Complete the Pagent approval flow in your browser.
  </Tab>

  <Tab title="Cursor">
    Add Pagent to your global or project `mcp.json` file:

    ```json theme={"dark"}
    {
      "mcpServers": {
        "pagent": {
          "url": "https://app.pagent.ai/api/mcp"
        }
      }
    }
    ```

    Save the file, open Cursor's MCP settings, and authenticate Pagent.
  </Tab>

  <Tab title="VS Code">
    Add a remote HTTP server to `.vscode/mcp.json` or your user configuration:

    ```json theme={"dark"}
    {
      "servers": {
        "pagent": {
          "type": "http",
          "url": "https://app.pagent.ai/api/mcp"
        }
      }
    }
    ```

    Run **MCP: List Servers**, start Pagent, and complete OAuth when prompted.
  </Tab>

  <Tab title="Windsurf">
    Add Pagent as a remote HTTP server in Cascade's MCP configuration:

    ```json theme={"dark"}
    {
      "mcpServers": {
        "pagent": {
          "serverUrl": "https://app.pagent.ai/api/mcp"
        }
      }
    }
    ```

    Refresh the MCP server list and complete OAuth.
  </Tab>

  <Tab title="Zed">
    Add Pagent as a remote context server:

    ```json theme={"dark"}
    {
      "context_servers": {
        "pagent": {
          "url": "https://app.pagent.ai/api/mcp"
        }
      }
    }
    ```

    Zed will offer the standard OAuth flow when it connects.
  </Tab>
</Tabs>

### Other MCP clients

Add a **Streamable HTTP** server using `https://app.pagent.ai/api/mcp` and choose OAuth authentication.

If your client cannot use OAuth, create a personal token in [AI client access](https://app.pagent.ai/me/settings/mcp). Store personal tokens in a secret manager and never commit them to source control.

## What you can do

The tools your client sees depend on the permissions you approved. Pagent keeps reads and writes separate.

| Capability                     | What it includes                                                                                                                              | Access         |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| Understand performance         | List running and completed tests, inspect page changes, compare tests, and read Bayesian results and website analytics                        | Read           |
| Manage test lifecycles         | Start, pause, resume, queue, stop, evolve, or roll back tests; send tests to review; submit verdicts; and mark implemented winners as shipped | Write          |
| Build the next test            | Capture a hypothesis, turn it into a test, and work with pages, audiences, and conversion goals                                               | Write          |
| Shape the optimization context | Read and manage personas, strategies, keywords, and guidelines                                                                                | Read and write |
| Manage Pagent access           | List websites and onboarding status; with explicit permission, create websites and manage organisations or members                            | Read and write |

## Example workflows

Replace the bracketed details with your own website, test, or hypothesis.

### Review live tests without changing anything

```text theme={"dark"}
Across every website this connection can access, list the running tests. For each test, report the page, audience, views, result status, lift, probability to beat control, and Pagent recommendation. Treat inconclusive results as inconclusive. Do not change anything.
```

### Compare what was tested

```text theme={"dark"}
On [website], compare tests #12 and #18. Show the hypothesis, the concrete page changes in each variation, and the measured result. Identify the strongest learning, but do not create a follow-up yet.
```

### Turn a hypothesis into a test

```text theme={"dark"}
On [website], capture this hypothesis for /pricing: [hypothesis]. Show me the exact hypothesis, target page, and next steps first. After I confirm, create the test and tell me when it is ready for review.
```

### Check before starting a live test

```text theme={"dark"}
Check test #42 against its current lifecycle, review status, SDK status, and any conflicting test. Explain what starting it would change and wait for my confirmation. Start it only after I explicitly say start.
```

## Access and safety

Pagent connections start with read access. During OAuth, you choose the organisations the client can access and whether to add write permissions. Pagent checks your current role, the organisation allowlist, and the organisation's MCP policy on every request.

A connection does not remember a website between requests. Ask the client to list available websites, then name the intended website or domain before website-specific work.

<Warning>
  A write runs when your AI client calls the tool. Pagent does not add a second
  confirmation screen. Keep write confirmation enabled in your client and ask it
  to show planned changes before acting. Starting, pausing, stopping, or rolling
  back a test can affect a live website.
</Warning>

Marking a test as shipped records that its winning changes were implemented. It does not change the website. Write requests are audited and use idempotency keys so the same retry cannot repeat a change.

<Note>
  Content returned through connected tools can contain misleading instructions.
  Review proposed writes and data sharing before you approve them in your
  client.
</Note>

## Manage access

Open [AI client access](https://app.pagent.ai/me/settings/mcp) to:

* Review active connections
* Change their organisation access
* See when they were last used
* Revoke connections or personal tokens

Reconnect a client if you need to change its permission groups. Organisation owners can also disable MCP for the entire organisation.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The connection request cannot proceed">
    Confirm that your client uses the exact Pagent endpoint. Close the browser tab, return to the client, and start the connection again while signed in to the intended Pagent account.
  </Accordion>

  <Accordion title="I connected, but no websites appear">
    The connection can only see organisations selected during approval. Reconnect
    or update its organisation access in Pagent. The organisation must also have
    MCP enabled.
  </Accordion>

  <Accordion title="A tool I expected is missing">
    Pagent only exposes tools allowed by the connection's permissions. Reconnect
    with the required write permission if you intentionally need broader access.
  </Accordion>

  <Accordion title="The client cannot find a website">
    Ask it to list the available websites, then refer to the website by name or
    domain. Connections do not keep a selected website between requests.
  </Accordion>

  <Accordion title="An action was denied">
    Pagent checks your current organisation role and policy on every request. Your
    role may have changed, MCP may have been disabled, or the test may not allow
    that action in its current state.
  </Accordion>

  <Accordion title="A test has no results">
    Confirm that the Pagent SDK is installed and receiving visitor traffic. A test
    can also remain inconclusive until it has enough evidence.
  </Accordion>

  <Accordion title="OAuth failed or expired">
    Disconnect Pagent in your client, reconnect it, and complete the browser
    approval flow again.
  </Accordion>

  <Accordion title="The client received a 429 response">
    The connection reached a rate limit. Wait for the `Retry-After` period
    returned by Pagent, then retry.
  </Accordion>

  <Accordion title="A legacy credential is rejected">
    Per-website MCP credentials are no longer supported. Reconnect through OAuth or create a new personal token in AI client access.
  </Accordion>
</AccordionGroup>

## FAQ

### Does connecting change my live website?

No. Read tools only inspect Pagent data. A live website changes only when a permitted write tool performs an action that affects a running test.

### Can I keep the connection read-only?

Yes. Leave the optional write permissions unchecked during OAuth.

### Can one connection access multiple organisations?

Yes. Select each organisation during approval. Organisations you join later are not added automatically.

### Is a connection limited to one website?

No. It acts through your Pagent profile across the organisations you select. Name the intended website or domain for website-specific work.

### Can I use Pagent from CI or a headless client?

Yes. Create a personal token with the minimum required organisations and permissions, then store it in a secret manager.

***

Need help? Email [support@pagent.ai](mailto:support@pagent.ai) with the client name, authentication method, approximate error time, and exact message. Never send your personal token.

*Updated August 11, 2026.*
