# Disconnect, revoke or remove the agent

> Click Disconnect to stop an agent now. To stop it for good, revoke its key, turn off AI agent access, remove the bridge and delete its saved key.

- Question: How do I switch off or remove the DiceyTable agent?
- Source: https://diceytable.com/docs/ai-agents/setup/uninstall
- Last verified: 2026-10-09

To stop an agent right now, click **Disconnect** on the **Agent connected** chip in your tab. To stop it for good, revoke
its key, turn off AI agent access, remove the bridge from your AI client and delete the saved key.

Each step below works on its own. Pick the one that matches how far you want to go.

## Pick how far to go

| You want to… | Do this | Undo it by… |
|---|---|---|
| Stop this session | Click **Disconnect** | Asking the agent to connect again |
| Stop one key everywhere | **Revoke** the key in Settings | Creating a new key |
| Stop every agent at once | Turn off AI agent access | Turning it back on |
| Remove everything from your computer | Remove the bridge, then run `logout` | Installing it again |

## Disconnect the current session

Any of these ends the session, and every tab paired with it lets go:

- **Disconnect** in the chip's menu. In the editor, **Help ▸ Disconnect AI agent** does the same.
- **End** beside the session in [**Settings ▸ AI agents**](https://diceytable.com/play/settings#ai-agents) under **Active now**.
- The agent calls `session_disconnect`.
- Your AI client exits. The bridge closes with it and ends its session.

Closing a tab lets go of that tab only. If the bridge stops sending heartbeats, the small "still here" messages it
sends on a timer, our server ends the session after about 90 seconds. [Watch, pause or stop your agent](https://diceytable.com/docs/ai-agents/setup/indicator)
covers the chip and its menu.

## Revoke a key

In **Settings ▸ AI agents**, click **Revoke** beside the key. DiceyTable refuses it from that moment, wherever a copy of
it still exists. Every session using it ends, and the page says how many.

Revoke a key when it may have leaked, or when you retire the computer it lived on. Running `logout` is not enough on
its own. It only deletes the copy on your computer, and the key stays valid until it expires.
[Create an API key](https://diceytable.com/docs/ai-agents/setup/api-keys) covers making a new one.

## How do I stop every agent at once?

In **Settings ▸ AI agents**, turn off **Allow AI agents to connect to DiceyTable as you**. This is the master switch.
While it is off:

- every key is refused, and the bridge reports `agent-access-disabled`;
- every live agent session ends, and the page says how many;
- you can't create a new key.

Your keys are kept. Turn the switch back on, and every key that hasn't expired or been revoked works again. If you never
want a key back, revoke it before you turn the switch on.

## Remove the bridge from your AI client

Your AI client starts the bridge for you, so removing it means deleting the `diceytable` entry from the client's MCP
settings. Each client page shows exactly where:

- [Claude Code](https://diceytable.com/docs/ai-agents/setup/claude-code): run `claude mcp remove diceytable`.
- [Claude Desktop](https://diceytable.com/docs/ai-agents/setup/claude-desktop): delete the entry from its config file, then restart it.
- [Cursor](https://diceytable.com/docs/ai-agents/setup/cursor): delete the entry from `mcp.json`.
- [VS Code](https://diceytable.com/docs/ai-agents/setup/vs-code): delete the entry from `mcp.json`, or uninstall it from **MCP: List Servers**.

When the client stops the bridge, the bridge ends its session and every paired tab lets go. `npx` keeps a copy of the
package in its cache. That copy is harmless to leave. `npm cache clean --force` removes it, along with everything else
npm has cached.

## Delete the saved key

The bridge saved your key on your computer when you ran `login`. Delete it with:

```sh
npx -y @diceytable/mcp-bridge@1 logout
```

That removes the key saved for DiceyTable's API. If you ever saved keys for other API addresses, add `--all` to remove
them all:

```sh
npx -y @diceytable/mcp-bridge@1 logout --all
```

If `DICEYTABLE_TOKEN` is still set in your environment, `logout` reminds you, because that variable still works. Remove
it from your shell profile or your client's `env` settings. The [bridge command line reference](https://diceytable.com/docs/ai-agents/reference/bridge-cli)
lists every command.

## What stays behind, on purpose

- **Session history.** **Settings ▸ AI agents ▸ Recent sessions** keeps a record of past sessions: the client, how long
  each ran, its tool calls and screenshots.
- **The URL-import list**, for 90 days after each download.
- **AI-attested credit records** in any game the agent worked on. They are part of the game's manifest, and publishing
  still needs you to review them. See [review credits an AI agent added](https://diceytable.com/docs/ai-agents/concepts/ai-attested-credits).
- **Restore points** the agent made, named *Before AI agent changes &lt;time&gt;*, in each project's Versions panel.

[AI agent privacy](https://diceytable.com/docs/ai-agents/concepts/privacy) explains what each of these records holds.

## Related

- [Watch, pause or stop your agent](https://diceytable.com/docs/ai-agents/setup/indicator): pause or disconnect from the tab
- [Create an API key](https://diceytable.com/docs/ai-agents/setup/api-keys): make a fresh key when you come back
- [Install the DiceyTable MCP bridge](https://diceytable.com/docs/ai-agents/setup/install): set it up again
