---
title: "Connect Clam to Claude Code"
description: "One terminal command adds your Shell to Claude Code. Sign in to Clam, click Allow, and Claude Code uses your Gmail only as far as your rules allow."
route: /docs/agents/claude-code
---

# Connect Clam to Claude Code

One terminal command adds your Shell to Claude Code. Sign in to Clam, click Allow, and Claude Code can use your Gmail only as far as the Shell's rules allow. No Shell yet? Start with the [Quickstart](https://useclam.ai/docs/get-started/quickstart).

Claude Code talks to Clam over MCP, the standard way an AI agent plugs in an outside tool. Each Shell is its own MCP server, so a second Shell installs beside the first.

## Connect Claude Code

Three ways in. Start with the first; the others are for when it doesn't fit.

### Terminal sign-in (Recommended)

The simplest path: one command, and Claude Code opens your browser to sign in. Pick this unless your machine has no browser. Already added Clam to Claude with the same account? Run `/mcp` first. It may be listed already.

1. Paste this in your terminal

   On the Shell's **Install** tab, pick Claude Code and copy the command under **Sign in from the terminal**. It has your server name and address filled in. Then press Enter.

   ```bash
   claude mcp add --transport http <server name> <your Shell's address>
   ```

2. Open Claude Code and run /mcp

   Run `/mcp`, then pick your server in the list.

3. Sign in to Clam and Allow

   Your browser opens on Clam, asking to connect your Shell to Claude Code. Its window is titled "Let Claude use a Shell". Sign in if you need to, then click **Allow**.

Then click **Check connection** on the Install tab.

### Access key

For a machine with no browser, like a server you reach over SSH. The key works only for Claude Code, and you see it once.

1. Paste this in your terminal

   Copy the command under **Use a key** on the Install tab. Copying creates the key and fills it in. Then press Enter.

   ```bash
   claude mcp add --transport http <server name> <your Shell's address> --header "Authorization: Bearer <your key>"
   ```

2. Open Claude Code and run /mcp

   Run `/mcp`. You should see your server in the list.

Then click **Check connection** on the Install tab.

### .mcp.json file

To keep Clam in the project's own file, so everyone who opens the project gets it. Each person still signs in to Clam themselves.

1. Add this block to .mcp.json

   The file sits in your project root, under `mcpServers`. Create it if it isn't there. Keep the `type` line, or Claude Code ignores the server.

   ```json
   {
     "mcpServers": {
       "<server name>": {
         "type": "http",
         "url": "<your Shell's address>"
       }
     }
   }
   ```

2. Open Claude Code and run /mcp

   Run `/mcp`, then pick your server in the list.

3. Sign in to Clam and Allow

   Your browser opens on Clam, asking to connect your Shell to Claude Code. Its window is titled "Let Claude use a Shell". Sign in if you need to, then click **Allow**.

Then click **Check connection** on the Install tab.

## Try it

With the starter policy from the Quickstart, ask Claude Code:

Ask "Summarize the work email I got this week." Claude Code answers from your work email. Ask "Find my latest bank statement." Clam blocks it, and Claude Code tells you so. That refusal is Clam working as intended.

If Claude Code holds other mail tools, name the Shell in the prompt.

## Remove access

Run `claude mcp remove <server name>`, or delete the entry from `.mcp.json`. That only tidies Claude Code. Clam's removal is the one that counts: on the Install tab, under Connected agents, click **Remove access** for Claude Code. A sign-in stops at its next request; a key at once. More in [Remove access](https://useclam.ai/docs/trust/remove-access).

## Next steps

- Not in the /mcp list, paused, or lost access? [Common issues & solutions](https://useclam.ai/docs/troubleshooting)
- [Write your own rules](https://useclam.ai/docs/policies/writing-effective-policies)
- [Have Claude Code ask before it acts](https://useclam.ai/docs/trust/approvals)
