# Connect an AI assistant

CarrierCloud runs a remote [Model Context Protocol](https://modelcontextprotocol.io) server. Connect an assistant to it and the assistant can list your partners, read loads and orders, look up equipment and drivers, pull positions and hours of service, and geocode addresses, using the same API key and the same Partner Network rules as the REST API.

| | |
|---|---|
| Endpoint | `https://carriercloud.ai/mcp` |
| Transport | Streamable HTTP |
| Authentication | `Authorization: Bearer YOUR_API_KEY` (your CarrierCloud key) |
| Tools | 36, all read-only. See the [tool catalog](/docs/mcp/tools). |

The [MCP Server reference page](/mcp) shows the endpoint card with copy-paste setup for each client. The essentials per client are below.

## Claude

**Claude Code** (terminal):

```bash
claude mcp add --transport http carriercloud https://carriercloud.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"
```

**Claude Desktop and claude.ai:** Settings → Connectors → Add custom connector, URL `https://carriercloud.ai/mcp`, and add the `Authorization` header with your key where the client offers custom headers. Then, in a project or conversation, tell Claude your partner code once (see below).

## Cursor

Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):

```json
{
  "mcpServers": {
    "carriercloud": {
      "url": "https://carriercloud.ai/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}
```

## VS Code (GitHub Copilot)

Add to `.vscode/mcp.json`:

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

## ChatGPT and other clients

Any client that supports remote MCP servers over streamable HTTP with a custom `Authorization` header can connect. Use the endpoint and header above; the client's own documentation shows where to enter them.

## Tell the assistant your partner code

Every partner-scoped tool takes a `partnercode` argument, exactly like the REST routes. Assistants work best when the code is in their standing instructions, for example in a Cursor rule, a Claude project instruction or a VS Code prompt file:

> When using CarrierCloud tools, my partner code is `MIST`. If a tool needs a partner code, use it without asking. Use `get_active_partners` to see other codes available to me.

If the assistant does not know a code, it can call `get_active_partners` itself; the tool needs no partner code.

## Try it

Prompts that exercise the server end to end:

- "Which partners can I act for on CarrierCloud?"
- "List the loads for MIST that changed today and summarise where each one is."
- "Which of MIST's tractors has the oldest last contact time?"
- "Geocode 28000 Oregon Rd, Perrysburg OH."

## Troubleshooting

| Symptom | Cause |
|---|---|
| The client reports `401` on connect | The `Authorization` header is missing or the key is wrong. Test the key with `curl https://carriercloud.ai/v1/partners -H "Authorization: Bearer YOUR_API_KEY"`. |
| A tool answers `Not authorized to partner.` | The partner has not approved API access for your company. See [The Partner Network](/docs/concepts/partner-network). |
| A tool answers `Sandbox Limit` | The underlying operation is [gated](/docs/environments#gated-operations). |
| A tool answers `No orders found.` | An empty result; the REST operation answers the same way. |

Deliveries, keys and partnerships are the same as for the REST API, so the [error catalog](/docs/concepts/errors) applies unchanged.
