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

# Run agents over MCP

> Run and manage H agents from any MCP host, no HTTP or SDK code.

Computer-Use Agents ship an official [Model Context Protocol](https://modelcontextprotocol.io) server, so hosts like Cursor, Claude Code, VS Code, Codex, and Hermes can run and manage H agents as tools, with no HTTP or SDK code. (Looking to search this documentation from an AI tool instead? That's the separate [docs MCP server](/docs-mcp-server).) The server is a remote streamable-HTTP endpoint at `/mcp` on your [region's host](/computer-use-agents/sdks#region), authenticated with the same H API key (`Authorization: Bearer hk-...`). Any client that can send a bearer header works; clients that require OAuth, like Claude.ai web or the ChatGPT app, aren't supported.

## Add to your editor

One click installs the `hai-agents` server, then paste your [API key](/computer-use-agents/quickstart#get-your-api-key) when prompted. The buttons target the EU region (the default):

<CardGroup cols={2}>
  <Card title="Add to Cursor" icon="https://cdn.simpleicons.org/cursor/6b6b70" href="cursor://anysphere.cursor-deeplink/mcp/install?name=hai-agents&config=eyJ1cmwiOiAiaHR0cHM6Ly9hZ3AuZXUuaGNvbXBhbnkuYWkvbWNwIiwgImhlYWRlcnMiOiB7IkF1dGhvcml6YXRpb24iOiAiQmVhcmVyIGhrLVlPVVJfS0VZIn19">
    Opens Cursor and prompts to install.
  </Card>

  <Card title="Add to VS Code" icon="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vscode/vscode-original.svg" href="vscode:mcp/install?%7B%22name%22%3A%20%22hai-agents%22%2C%20%22type%22%3A%20%22http%22%2C%20%22url%22%3A%20%22https%3A//agp.eu.hcompany.ai/mcp%22%2C%20%22headers%22%3A%20%7B%22Authorization%22%3A%20%22Bearer%20hk-YOUR_KEY%22%7D%7D">
    Opens VS Code and prompts to install.
  </Card>
</CardGroup>

On the US region, use [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=hai-agents\&config=eyJ1cmwiOiAiaHR0cHM6Ly9hZ3AuaGNvbXBhbnkuYWkvbWNwIiwgImhlYWRlcnMiOiB7IkF1dGhvcml6YXRpb24iOiAiQmVhcmVyIGhrLVlPVVJfS0VZIn19) or [Add to VS Code](vscode:mcp/install?%7B%22name%22%3A%20%22hai-agents%22%2C%20%22type%22%3A%20%22http%22%2C%20%22url%22%3A%20%22https%3A//agp.hcompany.ai/mcp%22%2C%20%22headers%22%3A%20%7B%22Authorization%22%3A%20%22Bearer%20hk-YOUR_KEY%22%7D%7D) instead. Registry-aware clients can also find it in the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.hcompai/hai-agents`.

## Connect manually

Point your client at the `/mcp` URL for your [region](/computer-use-agents/sdks#region) and add the `Authorization` header.

<CodeGroup>
  ```json Cursor theme={null}
  // ~/.cursor/mcp.json
  {
    "mcpServers": {
      "hai-agents": {
        "url": "https://agp.eu.hcompany.ai/mcp",
        "headers": { "Authorization": "Bearer hk-..." }
      }
    }
  }
  ```

  ```bash Claude Code theme={null}
  claude mcp add --scope user --transport http hai-agents https://agp.eu.hcompany.ai/mcp \
    --header "Authorization: Bearer hk-..."
  ```

  ```json VS Code theme={null}
  // user mcp.json (MCP: Open User Configuration)
  {
    "servers": {
      "hai-agents": {
        "type": "http",
        "url": "https://agp.eu.hcompany.ai/mcp",
        "headers": { "Authorization": "Bearer hk-..." }
      }
    }
  }
  ```

  ```toml Codex theme={null}
  # ~/.codex/config.toml
  [mcp_servers.hai-agents]
  url = "https://agp.eu.hcompany.ai/mcp"
  bearer_token_env_var = "HAI_API_KEY"   # export HAI_API_KEY=hk-...
  ```

  ```yaml Hermes theme={null}
  # ~/.hermes/config.yaml
  mcp_servers:
    hai-agents:
      url: https://agp.eu.hcompany.ai/mcp
      headers:
        Authorization: "Bearer hk-..."
  ```
</CodeGroup>

Your API key is a secret: keep it in your local client config, never in a committed or shared workspace file.

In a network-restricted sandbox (for example NVIDIA NemoClaw / OpenShell), also allow your region's `/mcp` host in the sandbox egress policy, scoped to the process that makes the call, or the agent can't reach the server. The [computer-use-agents-demos](https://github.com/hcompai/computer-use-agents-demos/tree/main/nemoclaw) repo has a worked NemoClaw example.

## Tools

| Tool               | What it does                                                                                                                     |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `run_agent`        | Start an agent on a task. Returns the answer, or a session handle to wait on if the task runs long.                              |
| `wait_for_session` | Long-poll a session for its answer, or fetch its current snapshot.                                                               |
| `list_agents`      | List the agents you can run: your org's agents plus the public `h/` ones. Pass an agent's `name` as the `agent` for `run_agent`. |
| `send_message`     | Send a follow-up message to a running session.                                                                                   |
| `cancel_session`   | Cancel a session.                                                                                                                |
| `share_session`    | Make a session publicly viewable and return a share link.                                                                        |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="arrow-right" href="/computer-use-agents/quickstart">
    Run your first session end to end with the API or SDKs.
  </Card>

  <Card title="SDKs" icon="code" href="/computer-use-agents/sdks">
    The typed Python and TypeScript clients and the `hai` CLI.
  </Card>

  <Card title="Agents" icon="robot" href="/computer-use-agents/agents/overview">
    Configure the agents the MCP tools run, including the public `h/` ones.
  </Card>

  <Card title="Coding assistants" icon="screwdriver-wrench" href="/computer-use-agents/coding-skills">
    Teach your assistant the H APIs with the hai-agents skill.
  </Card>
</CardGroup>
