# Connect your agent

Connect an AI agent to Mestra with the MCP server.

The MCP server lets an AI agent work with Mestra through ready-made tools. Its address is:

```
https://app.withmestra.com/mcp
```

Add the address to your agent and sign in to Mestra when it asks. There's no key to make or paste. On the consent screen you choose the organisation and the permissions, and you can disconnect the agent later in **Developer** > **API and MCP**, under **Connected apps**.

If you'd rather use a [key](https://withmestra.com/docs/api/authentication/), each section shows how. The examples read it from `MESTRA_TOKEN`.

## Claude Code

```bash
claude mcp add --transport http mestra https://app.withmestra.com/mcp
```

Then run `/mcp` in Claude Code, choose **mestra** and sign in.

With a key, add `--header "Authorization: Bearer $MESTRA_TOKEN"` to the command.

## Claude.ai and Claude Desktop

Add a custom connector with the address, then sign in when asked.

## ChatGPT

Add a connector with the address, then sign in when asked.

## Codex

```bash
codex mcp add mestra --url https://app.withmestra.com/mcp
```

Sign in when Codex asks.

With a key, add `--bearer-token-env-var MESTRA_TOKEN` to the command, or put it in `~/.codex/config.toml`:

```toml
[mcp_servers.mestra]
url = "https://app.withmestra.com/mcp"
bearer_token_env_var = "MESTRA_TOKEN"
```

Codex reads `MESTRA_TOKEN` when it starts, so set it first.

## Cursor

Add this to your `mcp.json`, then sign in when asked:

```json
{
  "mcpServers": {
    "mestra": { "url": "https://app.withmestra.com/mcp" }
  }
}
```

With a key, add `"headers": { "Authorization": "Bearer ${env:MESTRA_TOKEN}" }` next to `url`.

## MCP Inspector

```bash
npx @modelcontextprotocol/inspector
```

Choose the **Streamable HTTP** transport and enter the address. Then sign in, or add an `Authorization` header with `Bearer <key>`.

## Not verified apps

An agent that registers itself when it connects shows as **Not verified** on the consent screen. Check the name and the address it sends you back to before you allow it.

Once you're connected, see [Tools](https://withmestra.com/docs/mcp/tools/) for what your agent can do.

## Network

Mestra Network has its own MCP server, separate from this one, with tools for the customers that book on a network and for its staff. See [Network tools](https://withmestra.com/docs/mcp/network-tools/).
