# Claude Code

> Add your Plugsight MCP server to Claude Code in the terminal, with a browser sign-in or an API key, and check it's connected.

Claude Code can use your Plugsight accounts from the terminal, alongside your files and scripts. You can connect it in two ways: sign in with your browser (recommended), or use an API key when no browser is available.

## What you need

- Claude Code installed in your terminal (the `claude` command).
- A Plugsight MCP server and its **Server URL**. On the server's page in Plugsight, the steps under **Connect an AI app** → **Claude Code** show the commands with your server's URL and name already filled in.

In the commands below, replace `work` with your server's name in lowercase, with dashes instead of spaces (a server called "Acme (client)" becomes `acme-client`), and replace the URL with your **Server URL**.

## Option A: sign in with your browser (recommended)

1. Run this in your terminal:

   ```
   claude mcp add --transport http work https://app.plugsight.app/mcp/YOUR_SERVER_ID
   ```

2. Start Claude Code by running `claude`.
3. Type `/mcp`.
4. Choose your server (for example `work`), then **Authenticate**.
5. Your browser opens Plugsight. Sign in if asked, check the server name, then click **Allow access**.

## Option B: use an API key (no browser)

Useful on servers and in scripts, where no browser can open.

1. In Plugsight, open your MCP server's page.
2. Under **API key**, click **Create API key** (or **Regenerate key** if the server already has one).
3. Copy the key straight away. It isn't shown again.
4. Run this in your terminal, replacing `YOUR_KEY` with the key:

   ```
   claude mcp add --transport http work https://app.plugsight.app/mcp/YOUR_SERVER_ID --header "Authorization: Bearer YOUR_KEY"
   ```

> [!WARNING]
> Keep the key private: anyone with it can use this MCP server's accounts. If it leaks, use **Regenerate key** (the old key stops working straight away) or **Revoke key** on the server's page.

When you create a key, Plugsight also shows the full Claude Code command with the key filled in, ready to copy.

## Use it in every project

To use the server in every project, add `--scope user` to the add command, before the name:

```
claude mcp add --transport http --scope user work https://app.plugsight.app/mcp/YOUR_SERVER_ID
```

## Check it's connected

1. Run `claude mcp list`.
2. Your server (for example `work`) should show as connected.
3. Start `claude` and ask, for example, "List my connected accounts."

The first time Claude Code uses a Plugsight tool, it may ask your permission. Choose **Allow**. See [Approvals in your AI app](https://docs.plugsight.app/ai-apps/approvals.md).

## Refresh after adding a new type of account

After you connect the first account of a new type (your first Zendesk, say):

1. In Claude Code, type `/mcp`.
2. Choose your server, then **Reconnect**.

Or quit and start Claude Code again. See [Refresh the tools list](https://docs.plugsight.app/ai-apps/refresh-tools.md).

## Troubleshooting

### The server doesn't show as connected in claude mcp list

**What it means:** with Option A, you haven't finished signing in yet. With Option B, the key is wrong, was regenerated or was revoked.

**How to fix it:** for Option A, type `/mcp` in Claude Code, choose the server and **Authenticate**, then click **Allow access** in the browser. For Option B, create a new key on the server's page and run the add command again with it.

### It stopped working after I regenerated or revoked the key

**What it means:** regenerating or revoking a key stops the old key straight away. Anything using it is refused until you give it the new key. Apps that signed in with the browser aren't affected.

**How to fix it:** create or copy the new key, then add the server again with the new key in the `--header` option.

### This connector points at an MCP server that isn't in your account.

**What it means:** the browser is signed in to a different Plugsight account from the one that created the server.

**How to fix it:** click **Switch account** on the approval screen and sign in with the right account.

## Related articles

- [Cursor](https://docs.plugsight.app/ai-apps/cursor.md)
- [Other MCP apps](https://docs.plugsight.app/ai-apps/other-apps.md)
- [Disconnect an AI app](https://docs.plugsight.app/ai-apps/disconnect.md)

---

Web version: https://docs.plugsight.app/ai-apps/claude-code
