# MCP server

> Connect Claude Code, Codex, Cursor, VS Code or any MCP client to Fous, with tools to find, run and build methods on any website, manage workflows 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 set the key as `FOUS_API_KEY` and tell your agent `set up https://fous.com/SKILL.md`: it connects the server and saves the skill.

The MCP server and API keys work on every plan ([plans](https://docs.fous.com/guides/billing.md#plans)). On Free, an MCP client runs and reads your methods; the `build` tool answers `403 plan_limit`, and builds start in [Studio](https://app.fous.com).

## 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` or `stop`, and the other tools only read (`connections` lists and reads connections; `workflows` lists and reads workflows and their runs, without their webhook addresses).

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 your organization’s 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.
- `get_run`: The result of a slow run (run_…) or a workflow run (wfr_…), or the status of a build (bld_…).
- `stop`: Stop a run (run_…), a build (bld_…) or a workflow run (wfr_…) that is still going. A run or build costs nothing then; a workflow run keeps the cost of the steps that had finished.
- `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 one of your methods, change it; with a build_id, send that build a message.
- `connections`: Connect a website account (each step the site asks for comes back for the person’s answers, with a Studio link to sign in there instead), list your organization’s connections, check one, make one its site’s default, or disconnect one.
- `methods`: List your organization’s methods, read one (input and output schemas, an example, versions), switch the version its calls run, or delete one.
- `builds`: Your organization’s builds of the past 30 days, newest first; dismiss one that ended, or fetch a picture sent with a build or a message.
- `workflows`: List your organization’s workflows, read one or its runs, create one from a prompt or a definition, change it, build the method a step waits for or remove a step, turn it on or off, delete it or run it.
- `account`: Your organization, plan, credits left, limits, builds and prices, as GET /v1/account.

Each tool does what its [endpoint](https://docs.fous.com/api-reference.md) does: `methods` as in [Find and manage methods](https://docs.fous.com/guides/methods.md), `run` and `run_action` as in [Run a method](https://docs.fous.com/guides/runs.md), `build` as in [Build a method](https://docs.fous.com/guides/builds.md). `methods`, `builds`, `workflows` and `connections` take an `action` that picks the operation.

`structuredContent` is what the API returns; a run's `data` matches the method's `output_schema`. The text next to it is a one-line summary and JSON shortened to fit 24,000 characters; in a run's text, a list of two or more records is written as `{columns, rows}` (each field name once, `null` for a field an item lacks) to save tokens.

## Slow work

After about 50 seconds, `run` and `run_action` return `status: "running"` and an `id`. Call `get_run` with it, or `stop`, instead of sending it again. `build` returns at once (send `wait`, up to 60 seconds, to hold the answer); follow it with `get_run`. `get_run` and `stop` take a run (`run_…`), a build (`bld_…`) or a workflow run (`wfr_…`). `get_run` answers a run that failed with `status: "failed"` and its `error`, and `stop` with the run or build as it now stands (a method run in progress is free; a workflow run's finished steps stay charged).

## Workflows

`workflows` runs the [workflows](https://docs.fous.com/guides/workflows.md) API from one tool, with the same checks, through `action`:

| `action` | What it does |
| --- | --- |
| `list` | Your organization's workflows. |
| `get` | One workflow by `id` (`wf_…`): its `definition`, what it still needs filled in (`incomplete`) and what one run costs (`cost`). |
| `runs` | The runs of `id`, newest first (`limit`, `before`). |
| `create` | From `prompt` (the AI drafts it from your methods and saves it turned off; `timezone` sets when "9am" is) or from `name` and `definition`. When the AI asks something back, `workflow` is `null` and `ai` has `reply` and `question`: answer with `messages`, the whole conversation so far. |
| `update` | Change `id` with `prompt` or `messages` (the AI changes it, saved like any change; `ai` says what it did), or with `name`, `description` or `definition`. |
| `build_step` | Build the method of a step that is waiting for one: `id`, `step` (its key), and `site` when the step names none. The step uses the method once it is built; follow it with `get_run`. |
| `remove_step` | Take `step` out of `id`. |
| `enable`, `disable` | Turn `id` on or off. |
| `delete` | Delete `id`; its runs still going are canceled. |
| `run` | Run `id` with `input` for its trigger's inputs. `wait` (0 to 60, 30 by default) holds the answer. |

A run is a workflow run with a `wfr_` id. It answers with its steps once it has ended; while it is still going it answers `status: "queued"`, `"running"` or `"waiting"`: call `get_run` with its id to wait for it, or `stop` to cancel it. On the read-only server, `workflows` has only `list`, `get` and `runs`.

## Actions and sign-ins

- `run` only reads. A `write` method goes through `run_action`, marked destructive so the host can ask you first. So are `build`, `stop`, `workflows`, `methods` and `connections`, so the host can ask before it changes something.
- On `connection_required`, give the person `connect_url`. Or call `connections` with `action: "connect"` and `site`, and relay each step to the person until the connection is `active` ([Connect an account](https://docs.fous.com/guides/connections.md)). `connections` also lists and reads connections, names one or makes it its site's default (`update`) and disconnects one (`delete`).

## Errors

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