# Connect an AI agent

> Connect Claude Code, Codex, Cursor, VS Code or any MCP client to Fous, with tools to find, run and build website methods and connect accounts.

Source: https://docs.fous.com/guides/mcp
Index: https://docs.fous.com/llms.txt

Connect any MCP client to `https://api.fous.com/mcp` (Streamable HTTP), with your [API key](https://docs.fous.com/authentication.md) as a bearer header. Or tell your agent `set up https://fous.com/SKILL.md`: it gets its own key with your email, connects the server and saves the skill.

## Connect your client

### Claude Code

Adds Fous for every project, reading the key from your shell environment.

```bash
claude mcp add --scope user --transport http fous https://api.fous.com/mcp \
  --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

Reference: https://code.claude.com/docs/en/mcp

### Codex

Codex shares this configuration between its CLI and IDE extension.

```bash
codex mcp add fous --url https://api.fous.com/mcp --bearer-token-env-var FOUS_API_KEY
```

Reference: https://developers.openai.com/codex/mcp/

### Cursor

For every project. Use .cursor/mcp.json in a repository to scope it to one project. File: `~/.cursor/mcp.json`.

```json
{
  "mcpServers": {
    "fous": {
      "url": "https://api.fous.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:FOUS_API_KEY}"
      }
    }
  }
}
```

Reference: https://cursor.com/docs/mcp

### VS Code

VS Code asks for the key once and keeps it out of the file. File: `.vscode/mcp.json`.

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "fous-api-key",
      "description": "Fous API key",
      "password": true
    }
  ],
  "servers": {
    "fous": {
      "type": "http",
      "url": "https://api.fous.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:fous-api-key}"
      }
    }
  }
}
```

Reference: https://code.visualstudio.com/docs/copilot/customization/mcp-servers

### Any MCP client

Streamable HTTP with a Bearer header. The add-mcp helper writes most clients’ config.

```bash
npx -y add-mcp https://api.fous.com/mcp -g -n fous \
  --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

Reference: https://modelcontextprotocol.io/clients

### A Claude Code project

Commit this `.mcp.json`. Each person's own `FOUS_API_KEY` fills the header.

```json
{
  "mcpServers": {
    "fous": {
      "type": "http",
      "url": "https://api.fous.com/mcp",
      "headers": { "Authorization": "Bearer ${FOUS_API_KEY}" }
    }
  }
}
```

### Your own agent, server side

An agent that calls tools with no person approving them should use `?read_only=true`: no `run_action`, `build`, `stop` or `connect`, and the other tools only read.

Anthropic Messages API, with `anthropic-beta: mcp-client-2025-11-20`:

```json
{
  "mcp_servers": [
    {
      "type": "url",
      "url": "https://api.fous.com/mcp?read_only=true",
      "name": "fous",
      "authorization_token": "<FOUS_API_KEY>"
    }
  ],
  "tools": [{ "type": "mcp_toolset", "mcp_server_name": "fous" }]
}
```

OpenAI Responses API:

```json
{
  "tools": [
    {
      "type": "mcp",
      "server_label": "fous",
      "server_url": "https://api.fous.com/mcp?read_only=true",
      "authorization": "<FOUS_API_KEY>",
      "require_approval": "never"
    }
  ]
}
```

## The tools

- `search`: Find website methods for a plain-language need, with their input schemas.
- `run`: Run a method that reads data, with inputs that fit its schema.
- `run_action`: Run a method that changes something on a website (posts, books, sends), only when the user asked for it.
- `query`: A query in plain language in, the result out: Fous picks the methods, fills their inputs and runs them.
- `get_run`: The result of a slow run or query (run_…), or the status of a build (bld_…).
- `stop`: Stop a run or query (run_…), or a build (bld_…), that is still going. Nothing is charged for it.
- `build`: Build a method that reads or does something on a website from a plain-language request, with up to 4 images (a link or base64); with a method, change that method or start one of yours from it; with a build_id, send that build a message.
- `connect`: Sign in to a website through Fous: it returns each step the site asks for (email, password, code) for the person’s answers, and a Studio link where the person can sign in instead. Or save a site’s API key. Methods on that site then run with it.
- `connections`: List your organization’s connections, check one (its sign-in step and Studio link), or make one the default for its site.
- `methods`: List your organization’s methods, read one (input and output schemas, an example, versions), pin your organization to a version, make one public, or delete a private one.
- `builds`: Your organization’s builds of the past 30 days, newest first; dismiss one that ended.
- `account`: Your organization, credits, limits, monthly builds and prices, as GET /v1/account.

Each tool does what its [endpoint](https://docs.fous.com/api-reference.md) does. `query` is a [query](https://docs.fous.com/guides/auto.md). `methods`, `builds`, `connect` and `connections` take an `action` or flags that pick the operation.

Results are a one-line summary and JSON cut at 24,000 characters; the full result is in `structuredContent`.

## Slow work

After about 50 seconds, `run`, `run_action` and `query` return `status: "running"` and an `id`. Call `get_run` with it, or `stop`, instead of sending it again. `build` returns at once; follow it with `get_run`.

## Actions and sign-ins

- `run` only reads. A `write` method goes through `run_action`, marked destructive so the host can ask you first. So is `build`.
- On `connection_required`, give the person `connect_url`. Or, once they agree, call `connect` with `platform` and `attest: true` and relay each step until the connection is `active` ([Connect an account](https://docs.fous.com/guides/connections.md)).

## Errors

A failed tool returns `isError: true` and the HTTP `error` object in `structuredContent.error`. MCP-only codes are in [Errors and limits](https://docs.fous.com/guides/errors.md#over-mcp).
