# Govern Claude Desktop and Claude Code

> Put Thoth in front of the MCP servers developers use in Claude Desktop and Claude Code, start in observe, and see what is and is not covered today.

Source: https://docs.atensecurity.com/docs/mcp/claude-desktop-and-claude-code

This guide is for a team that wants to govern the MCP tools its developers use
from Claude Desktop and Claude Code on their own machines. It starts in observe,
so nothing is held or denied while you see what Thoth would have decided, and
ends with a person switching to enforce.

Two different things use the word "Claude" here, and it helps to keep them apart:

| What you want | Use |
| --- | --- |
| Check the `tools/call` requests that Claude Desktop or Claude Code sends to MCP servers | The [MCP proxy](https://docs.atensecurity.com/docs/mcp/proxy) (`thoth`), wrapped around each MCP server |
| Configure Thoth itself from Claude Code (read setup, preview and commit changes) | The [configuration server](https://docs.atensecurity.com/docs/mcp/configure-thoth), added with `thothctl mcp config --client claude-code` |

The second one does not govern anything Claude Code does. It is how an admin
operates Thoth from a coding client.

## 1. Before you start

- A Thoth workspace and a workspace admin. Admin changes that matter here (an
  agent's mode, data handling, approvers) need a signed-in admin with a recent
  second factor.
- The `thoth` and `thothctl` binaries on each machine (see
  [installation](https://docs.atensecurity.com/docs/mcp/proxy#installation)). `thoth wrap-config --help` and
  `thothctl --help` list every command named below.
- Sign in: `thothctl auth login --tenant-id <tenant> --admin-email <you>`.
- An agent registered in the workspace for each MCP server you wrap, and each
  wrapped server's agent ID must match it. A signed-in session enforces only
  for a registered agent ID; see the proxy page.

## 2. Put every agent in observe first

An agent with no mode set enforces. Set observe before the first developer
connects, so the first week records decisions without holding or denying
anything:

```bash
thothctl agents mode set --agent-id filesystem --mode observe
thothctl agents mode get --agent-id filesystem
```

For governed endpoints (managed machines) the same switch exists per endpoint:

```bash
thothctl endpoints set-mode --endpoint-id <id> --mode observe
```

Both need an admin with a recent second factor. From an MCP client connected to
the configuration server, `preview_enforcement_mode` does the same for an agent.
[Observe and enforce](https://docs.atensecurity.com/docs/operations/enforcement-modes) describes the modes.

## 3. Claude Desktop

`thoth wrap-config` rewrites an existing `claude_desktop_config.json` so each
MCP server runs behind the proxy. It leaves your other configuration alone and
is safe to run twice.

```bash
thoth wrap-config \
  --tenant-id "$THOTH_TENANT_ID" \
  --env THOTH_USER_ID="$THOTH_USER_ID" \
  --output ~/Library/Application\ Support/Claude/claude_desktop_config.json \
  ~/Library/Application\ Support/Claude/claude_desktop_config.json
```

Restart Claude Desktop, then check coverage:

```bash
thoth status
```

Servers without a check mark run without Thoth. The
[proxy page](https://docs.atensecurity.com/docs/mcp/proxy) has the Windows form, manual configuration,
session intent and the environment variables.

**Observe or enforce is set in the workspace:**
  Whether a wrapped server only records or also holds and denies is decided by
  the agent's mode in your workspace (step 2), not by the config file. Check the
  mode before you rely on either behaviour.

## 4. Claude Code

Claude Code reads MCP servers from `.mcp.json` (project) or its own user
configuration, using the same `mcpServers` shape. The proxy wraps servers that
start a local command (stdio):

```bash
thoth wrap-config \
  --tenant-id "$THOTH_TENANT_ID" \
  --env THOTH_USER_ID="$THOTH_USER_ID" \
  --output .mcp.json .mcp.json
```

`wrap-config` refuses an entry that has no `command`, such as a remote HTTP
server. If your file lists both kinds, wrap only the local ones with
`--servers name1,name2`. Remote servers are not checked by the proxy.

To also operate Thoth from Claude Code, add the configuration server:

```bash
thothctl mcp config --client claude-code --tenant-id <tenant> > thoth-mcp.json
```

Merge the `thoth` entry into `.mcp.json` by hand if the file already exists.
Add `--trial` for a trial or self-serve workspace. See
[Configure Thoth from Claude Code or Cursor](https://docs.atensecurity.com/docs/mcp/configure-thoth).

## 5. Roll out to a team

For managed machines, ship the binary and the wrapped configuration with your
MDM and enrol the machines in a fleet. Follow
[Claude Desktop fleet configuration](https://docs.atensecurity.com/docs/mcp/fleet-deployment) and the
[Jamf](https://docs.atensecurity.com/docs/deployments/jamf-overview) or
[Intune](https://docs.atensecurity.com/docs/deployments/intune-overview) overview. Start one small fleet in
observe before widening it.

## 6. Review, then enforce

After a few days of normal use, read what enforcing would have done:

```bash
thothctl agents observe-summary --agent-id filesystem --days 7
```

The summary counts what would have been denied, held, modified or deferred, with
the rules that matched most and recent examples, and says whether the agent is
ready to enforce. The check is: at least 7 days of observation, at least 50
recorded actions, no more than 2% that would have been held or denied, and
nothing that would have been denied in the last 3 days. Thoth never switches an
agent for you. A person does:

```bash
thothctl agents mode set --agent-id filesystem --mode enforce
```

Treat the ready-to-enforce check as a prompt to look, not a sign-off. You can
also replay a candidate rule change over recent decisions before applying it
(see [Policy rules](https://docs.atensecurity.com/docs/operations/policy-rules) and `simulate_policy` and
`replay_policy_change` on the configuration server).

## 7. Settings worth choosing before the first user

### Outside-recipient guard

The guard holds sends, shares and invitations addressed outside your workspace.
It defaults to observe; enforcing it is opt-in:

```bash
thothctl settings recipient-policy set --mode observe \
  --internal-domains example.com
thothctl settings recipient-policy set --mode enforce
```

In observe it records what it would have held, visible with
`get_recipient_policy` on the configuration server.

### Data handling for workspaces that handle protected health information

By default Thoth keeps argument names with each value hashed, and keeps no
prompts, model output or tool results. A workspace can also lock its data
handling with `locked`, so tool arguments and prompts are never stored as sent:

```bash
thothctl settings data-handling set --tool-arguments redact --locked true
```

The lock is one way: only Aten support can lift it. It limits what Thoth keeps.
It does not detect or remove personal data in what an agent sends, and it does
not make a deployment compliant with any regulation. See
[Data handling](https://docs.atensecurity.com/docs/operations/data-handling). The `--locked` flag needs a
`thothctl` build that includes it; run `thothctl settings data-handling set --help`
to check yours.

### Who approves a held action

A held action waits for a person.

- With Slack connected, reviewers approve in Slack. See
  [Slack approvals](https://docs.atensecurity.com/docs/operations/slack-approvals).
- Without Slack, a list of approvers set by an org admin approves in the
  dashboard, with `thothctl approvals resolve`, or from an MCP client. Until the
  list is set, nobody can approve and a hold ends in a deny when it times out.
  See [Approvers without Slack](https://docs.atensecurity.com/docs/operations/approvers).

The person a request is for, the agent's owner and the creator of the raising
key cannot approve it.

## What this does not cover today

Read this before you tell a team that Claude Code is governed.

- **Claude Code's built-in tools are not checked.** Bash, Edit, Write and Read
  are not MCP calls, so the proxy never sees them. A hook adapter for Claude Code
  is in development; until it ships and is installed, those tools run unchecked.
- **Tool results are not scanned.** Thoth checks the request to a tool. It does
  not yet read what a tool returns before the model does.
- **Credentials in a local config stay on that machine.** A local stdio server's
  credentials live in the configuration file on the developer's machine, and
  wrapping a server does not move them.
- **Sequences.** Thoth does not detect chains of calls across a session beyond
  what the docs already state for each rule.
- **Remote MCP servers** listed in `.mcp.json` are not wrapped by the proxy.
- This governs what developers do through MCP. It makes no claim about
  coverage of any regulation or framework.
