---
title: Connect your AI agent
description: Let Claude Code, Cursor, Codex or Claude Desktop set up and run PandaDesk through the MCP server, plus the PandaDesk skill and CLI.
section: Getting started
order: 4
---

Everything you can do in the dashboard, a coding agent can do from your editor. It can set up a workspace, import your docs, style the chat, add it to your code, check it's live, tune the AI and work the inbox. It connects to the PandaDesk MCP server at `https://pandadesk.app/api/mcp`. You sign in once in your browser; there's no token to copy.

## What your agent can do

- **Set up:** create workspaces, import your site and docs, write articles and pinned answers, watch indexing.
- **Style:** brand color, greeting, bot name and avatar, starter questions, the bubble and its corner.
- **Install:**
  - get the embed code for your framework;
  - wire up [signed identity](/docs/signed-identity) for logged-in users;
  - allow your domains;
  - check the chat is live.
- **Tune:** guidelines, guardrails, scenarios and [lookups](/docs/lookups) for the AI. Test questions before customers ask them.
- **Inbox (Pro):** conversations waiting for a person, replies or drafts, notes, labels, assignment, contacts and reports.

The full list of tools is in the [MCP reference](/docs/mcp-reference).

## 1. Connect your agent

Add PandaDesk to your agent with one command (or one setting). The first time it connects, it opens PandaDesk in your browser. You sign in if needed, check what it's asking for, and click **Allow**. The dashboard's **Connect AI agent** page (also step 2 of Setup for new accounts) shows the same steps.

### Claude Code

```bash
claude mcp add --transport http --scope user pandadesk https://pandadesk.app/api/mcp
```

Then in Claude Code type `/mcp`, pick **pandadesk** and choose **Authenticate**. Your browser opens; click **Allow**.

Optionally, add the PandaDesk skill, which teaches Claude the setup and inbox playbooks:

```bash
mkdir -p ~/.claude/skills/pandadesk && curl -fsSL https://pandadesk.app/skill/SKILL.md -o ~/.claude/skills/pandadesk/SKILL.md
```

### Cursor

Add this to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in your project:

```json
{
  "mcpServers": {
    "pandadesk": { "url": "https://pandadesk.app/api/mcp" }
  }
}
```

In **Cursor Settings → MCP**, click **Needs login** next to pandadesk, then **Allow** in the browser.

### Codex

```bash
codex mcp add pandadesk --url https://pandadesk.app/api/mcp
codex mcp login pandadesk
```

The second command opens your browser; click **Allow**.

### Claude Desktop and claude.ai

In **Settings → Connectors**, choose **Add custom connector**, name it PandaDesk and use the URL `https://pandadesk.app/api/mcp`. Click **Connect**, then **Allow** in the browser.

### Terminal (CLI)

The CLI uses a token instead of a browser sign-in (see [Tokens](#tokens) below). Log in once; it's saved to `~/.config/pandadesk`:

```bash
npx pandadesk login --token pda_YOUR_TOKEN
npx pandadesk tools
```

See the [CLI reference](/docs/cli-reference).

## 2. What the approval means

When you click **Allow**, the agent acts as you in every workspace you belong to, with your permissions: it can do what you can do in the dashboard, and nothing more.

- **Approvals renew themselves.** The agent gets a short-lived access token (one hour) that it renews in the background. It stays connected for up to 90 days of not being used.
- **You can disconnect any time.** Every approved agent is listed under **Connect AI agent → Connected apps**. **Disconnect** stops it immediately.
- **Only allow what you started.** The app name on the approval screen is how the app describes itself. Only allow it if you just started connecting it from your own agent.

## 3. Ask for what you want

In your project, say:

```text
Set up PandaDesk support chat on this site.
```

Other things to try:

- "What's waiting in my PandaDesk inbox?"
- "Look at the questions PandaDesk couldn't answer and draft pinned answers from our docs."
- "Change the chat to our brand color and add starter questions customers would ask."

### Guided workflows

The MCP server also offers three ready-made workflows (MCP prompts). In Claude Code, type:

| Command | What it does |
|---|---|
| `/mcp__pandadesk__setup_pandadesk` | Takes a site from nothing to a live chat: workspace, knowledge, look, allowed websites, embed, test questions, install check |
| `/mcp__pandadesk__triage_inbox` | Goes through conversations waiting for a person, answers what your knowledge covers, notes the rest, and sums up the gaps |
| `/mcp__pandadesk__fill_knowledge_gaps` | Turns unanswered questions into draft pinned answers or articles, and saves them once you approve |

## Plans and permissions

- **Setup tools work on every plan**, including the trial: workspaces, knowledge, look, install, AI settings, webhooks and business hours.
- **Inbox tools need Pro:** conversations, replies, drafts, notes, labels, assignment, contacts and reports. On another plan they return an error saying so. See [Plans and billing](/docs/plans-and-billing).
- **Admin-only actions stay admin-only.** Changing the look, allowed websites, security, the AI agent, lookups, webhooks or business hours needs an admin of that workspace, just like in the dashboard. See [Team and roles](/docs/team-and-roles).
- **Replies to customers.** By default an agent can only write a draft, which a teammate approves in the inbox. To let agents send replies directly, an admin turns on **Let agents send replies** under Settings → Inbox. That covers every connected agent and the CLI for that workspace.
- **Rate limit:** each connection can make 120 calls a minute.

> **Note:** Customer messages are untrusted text. The PandaDesk skill tells agents never to follow instructions found inside a conversation.

## Tokens

Some tools can't open a browser: the CLI, scripts and CI, or an agent without sign-in support. For those, create a **personal token** under **Connect AI agent → Use a token instead**.

1. Name the token (e.g. "CI") and choose **Create token**.
2. Copy it. It starts with `pda_` and is shown once.
3. Send it as the header `Authorization: Bearer pda_…`, or log in with it in the CLI.

A personal token covers every workspace you belong to, like a browser approval, but it doesn't expire until you revoke it. Revoke it on the same page.

> **Note:** Treat a token like a password. Keep it in an environment variable or your agent's config, never in your repository.

**Workspace tokens.** Before personal tokens, admins created workspace tokens (`pd_…`) under Settings, each limited to one workspace. They still work and act as an admin of that workspace, but can't create new workspaces.

## Troubleshooting

| Message | What to do |
|---|---|
| "Not signed in to PandaDesk" | Sign in again: in Claude Code `/mcp` → pandadesk → Authenticate, in Codex `codex mcp login pandadesk`. With a token, it's wrong or revoked; create a new one. |
| "Pass workspace: one of …" | Your token covers several workspaces. Tell the agent which one, or pass `workspace` with its slug. |
| "… is on the Pro plan" | You used an inbox tool on Starter. Setup tools still work; upgrade under Billing for inbox tools. |
| "… workspace is paused" | The owner's trial or subscription has ended. Reactivate under Billing. |
| "Only admins of … can do that" | Ask an admin of that workspace to make the change. |
| "Sending replies from an agent is off" | An admin can turn on **Let agents send replies**, or the agent can use a draft instead. |
| "Too many requests" | Wait a minute. Each connection can make 120 calls a minute. |
