Claude Code
Add Dock to Claude Code in under two minutes. Your terminal agent can then read, write, and co-edit any Dock workspace you have access to, using the same 13 MCP tools your web-based agents see.
dk_ key in Dock Settings → API keys.Authorization: Bearer dk_… in the client config.Prerequisites
- Claude Code installed. Check with
claude --version. If not installed, follow code.claude.com/docs. - A Dock account. Dock is invite-only during beta. If you don't have access, request an invite.
Path A. OAuth (recommended)
Claude Code ships with built-in OAuth 2.1 support. Add Dock as a remote MCP server and it opens your browser to authorize, no key ceremony required.
$ claude mcp add dock --transport http https://trydock.ai/api/mcp
◐ Detected OAuth 2.1 protected-resource metadata
◐ Opening browser to https://trydock.ai/oauth/authorize...
✓ Authorized as you@work.com
✓ Server "dock" added to ~/.claude.json (user scope)
Run claude to start a session with Dock tools enabled.That's it. Start any Claude Code session and the 13 Dock tools are available. Try "use the Dock MCP to list my workspaces".
Path B. Bearer token
Prefer a static token? Mint a scoped dk_ key and paste it into the config. Works the same as OAuth but skips the browser.
Step 1. Mint an API key
Sign in to Dock. Open Settings → API keys, name the agent, pick the workspace(s) it should access, click Create key.
API keys
One key per agent. Keys inherit the workspace permissions of the agent they belong to. The plaintext is shown once; store it, Dock can't recover it.
dk_live_f4a9c1…8d2edk_live_71b0a3…c52fdk_live_ab82ef…019aThe dk_... secret is shown once. Store it somewhere (password manager, env var). You can always mint a new one, but this exact string is not recoverable.
Or skip the dashboard and mint one from your terminal using the CLI (docs):
npx -y @trydock/cli key new --name "Claude Code · me" --workspace content-pipeline
# → dk_c914f1c6... (shown once)Step 2. Add Dock to Claude Code
Two ways. Both write to the same file.
CLI (recommended):
claude mcp add dock \
--transport http \
--header "Authorization: Bearer $DOCK_API_KEY" \
https://trydock.ai/api/mcpThe --header flag is interpolated at config-write time. Export DOCK_API_KEY before running, or paste the literal dk_... string in place of $DOCK_API_KEY.
Manual: open the config file and add the mcpServers.dock entry.
~/.claude.json.claude/settings.json at the project root.claude run picks it up.{
"mcpServers": {
"dock": {
"url": "https://trydock.ai/api/mcp",
"transport": "http",
"headers": {
"Authorization": "Bearer dk_c914f1c6..."
}
}
}
}Step 3. Verify
Start a Claude Code session and ask it to list Dock tools. If the connection works you'll see 63 tools.
$ claude
You: list the tools available from the "dock" MCP server
Claude: Here are the 63 tools exposed by "dock":
- list_workspaces
- get_workspace
- list_rows
- create_row
- update_row
- delete_row
- create_workspace
- get_recent_events
- get_billing
- upgrade_plan
- downgrade_plan
- request_limit_increase
- create_support_ticketOr verify the MCP handshake directly from curl (no Claude Code needed, useful for debugging):
curl -X POST https://trydock.ai/api/mcp \
-H "Authorization: Bearer $DOCK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# → {"jsonrpc":"2.0","id":1,"result":{"tools":[...63 tools...]}}Troubleshooting
401 Unauthorized on every calldk_ key is revoked, expired, or pasted wrong. Open Settings → API keys, confirm the key is still listed (not greyed out), re-copy, re-paste. If using OAuth, run claude mcp remove dock then re-add to re-authorize.dock but tools list is empty~/.claude.json · the headers.Authorization string must start with Bearer + space + token. Quotes around the whole value are fine; quotes around the token only are a common typo.127.0.0.1:<random> is being blocked. Check that no firewall is eating localhost ports. As a fallback, switch to Path B (Bearer token).Workspace not found/{org}/{workspace} in your prompts.Frequently asked questions
- How do I give Claude Code persistent state across sessions?
- Connect Claude Code to a Dock workspace via MCP. The workspace doc bodies and table rows are your persistent state, written to and read from across every Claude session. No CLAUDE.md round-trip required. Learn more →
- Does Claude Code work with Dock's MCP server?
- Yes. Claude Code ships with built-in OAuth 2.1 + DCR support, so `claude mcp add dock --transport http https://trydock.ai/api/mcp` works in one command. Bearer-token (`dk_` key) is also supported via `--header`. Learn more →
- How do I add Dock to my Claude Code config?
- Run `claude mcp add dock --transport http https://trydock.ai/api/mcp` for OAuth, or pass `--header "Authorization: Bearer dk_…"` for a bearer token. Both write to `~/.claude.json` so every session sees Dock. Learn more →
- Can multiple Claude Code sessions share state through Dock?
- Yes. Every session reads and writes the same workspace, so handoffs across machines or across long-running multi-session workflows just work. The workspace IS the shared state.
- How is Dock different from Claude-Mem or MemoryForge for Claude Code?
- Those are local memory layers scoped to one Claude Code agent on one machine. Dock is a hosted, shared workspace your team and your agents both write to in real time, with principal attribution stamping every edit so you can see exactly which agent did what.
- How do I see what Claude Code did in my Dock workspace?
- Open the workspace in your browser. Every row Claude Code created or updated is stamped with its agent identity (orb + name) in the row's createdBy / updatedBy field. The workspace activity feed shows every action chronologically.
- How do I undo a row Claude Code wrote to Dock?
- Open the row, click the kebab menu, choose Delete (soft-delete preserves history). For bulk reverts use the activity feed to find the agent's session and delete its rows in batch. To prevent future writes, revoke the agent's `dk_` key in Settings → API keys.
- How do I let Claude Code write to a workspace my team can see?
- Set the workspace visibility to `org` (Settings → Visibility). Every org member auto-gets editor access. Claude Code's writes show up in real time for everyone on your team via the SSE stream. Learn more →
- Can I @mention Claude Code in a Dock comment?
- Yes. Comments support `@agent-name` mentions; Dock fires a `comment.added` webhook which Claude Code can subscribe to via your own bridge. Native @mention-triggered Claude Code replies are on the roadmap. Learn more →
- How do I limit which Dock workspaces Claude Code can write to?
- Mint a per-workspace `dk_` key (Settings → API keys → New, pick the workspace from the dropdown). The key returns 403 on every other workspace, so Claude Code is hard-scoped to one slug regardless of what your prompt asks. Learn more →
Related
- MCP reference · full tool schemas
- Claude Cowork · desktop agent variant
- OpenClaw · open-source Claude-Code-like agent
- Claude Code: MCP integration (official Anthropic docs) · canonical
claude mcp add+ config-file reference