> For the complete documentation index, see [llms.txt](https://hallway.gitbook.io/embed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hallway.gitbook.io/embed/cloud-agent-api/mcp.md). Agents can also search and read this documentation through its [MCP server](https://hallway.gitbook.io/embed/~gitbook/mcp).

# Connect with MCP

Use your Hallway cloud agent as a tool in Cursor, Claude Code, Codex, and other MCP clients.

Add Hallway to Cursor, Claude Code, Codex, or any AI client that supports the [Model Context Protocol](https://modelcontextprotocol.io), so your AI assistant can hand browser tasks to your cloud agent.

**Server URL:** `https://hallway.ai/api/mcp`

## Fastest setup

On [Cloud Agent](https://hallway.ai/app), click **Copy setup prompt** under **For your coding agent** and paste it into Cursor, Claude Code, or Codex. Your coding agent registers `hallway-cloud` in your user-level MCP config and runs a quick test automatically.

## Manual setup

{% stepper %}
{% step %}

### Copy your API key

Copy your team's API key under **Connect your app to Hallway** on [Cloud Agent](https://hallway.ai/app), or open [hallway.ai/app/developer](https://hallway.ai/app/developer). See [Authentication](https://hallway.gitbook.io/embed/cloud-agent-api/authentication.md).
{% endstep %}

{% step %}

### Add Hallway to your MCP config

{% tabs %}
{% tab title="Cursor" %}
On [Cloud Agent](https://hallway.ai/app), select the **MCP** tab under **Connect your app to Hallway** and click **Copy JSON** to copy your config with your team key already filled in. Add it to `~/.cursor/mcp.json` to use it everywhere, or `.cursor/mcp.json` for a single project:

```json
{
  "mcpServers": {
    "hallway-cloud": {
      "url": "https://hallway.ai/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_HALLWAY_API_KEY"
      }
    }
  }
}
```

If you already have other servers, add `hallway-cloud` alongside them inside `mcpServers`.
{% endtab %}

{% tab title="Claude Code" %}
Run this in your terminal to register `hallway-cloud` for all projects:

```bash
claude mcp add --transport http --scope user hallway-cloud "https://hallway.ai/api/mcp" \
  --header "Authorization: Bearer YOUR_HALLWAY_API_KEY"
```

{% endtab %}

{% tab title="Codex" %}
Add `hallway-cloud` to `~/.codex/config.toml`:

```toml
[mcp_servers.hallway-cloud]
url = "https://hallway.ai/api/mcp"
http_headers = { Authorization = "Bearer YOUR_HALLWAY_API_KEY" }
```

{% endtab %}

{% tab title="Other clients" %}
Configure a streamable HTTP MCP server with:

* **URL:** `https://hallway.ai/api/mcp`
* **Header:** `Authorization: Bearer YOUR_HALLWAY_API_KEY`
  {% endtab %}
  {% endtabs %}

{% hint style="warning" %}
Don't commit a config file that contains your real key.
{% endhint %}
{% endstep %}

{% step %}

### Test it

Reload MCP servers in your client, then ask your assistant:

> Use hallway-cloud run\_agent with task "Reply with exactly: Hallway MCP works. Do not browse or take any other actions."
> {% endstep %}
> {% endstepper %}

## Tools

| Tool               | Inputs                                                                   | Returns                                                                                                                                                                                                                                  |
| ------------------ | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_agent`        | `task`, and optional `sessionId`, `model`, `browser`, and `resultSchema` | The run's `status`, `answer`, and `sessionId` for follow-ups, plus `result`, `reason`, or `error` like the `run.completed` [event](https://hallway.gitbook.io/embed/cloud-agent-api/run-a-task.md#events). Waits up to about 13 minutes. |
| `get_conversation` | `sessionId`                                                              | The conversation's latest 100 messages, including any saved `result`.                                                                                                                                                                    |

To ask a follow-up, pass the `sessionId` from the previous `run_agent` result.

To run in a browser you host, pass `browser` with the same `url` and `headers` as the HTTP API. See [Bring Your Own Browser](https://hallway.gitbook.io/embed/cloud-agent-api/bring-your-own-browser.md).

To get JSON fields back, pass `resultSchema`. See [Structured Results](https://hallway.gitbook.io/embed/cloud-agent-api/structured-results.md).
