Connect
claude-code logo

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.

Client
Claude Code
Terminal-native. OAuth or Bearer. Config at ~/.claude.json.
HTTP JSON-RPC (streamable-http)
Dock MCP
trydock.ai/api/mcp
37 tools · OAuth 2.1 + DCR · Bearer
Auth path
1
Mint a dk_ key in Dock Settings → API keys.
2
Paste it as Authorization: Bearer dk_… in the client config.
3
Client calls Dock MCP directly on every request.

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.

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.

trydock.ai

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.

content-pipeline
Name
Key
Scope
Last used
Argus · content
dk_live_f4a9c1…8d2e
content-pipeline
2m ago
Scout · research
dk_live_71b0a3…c52f
research-queue
1h ago
Flint · brief
dk_live_ab82ef…019a
product-brief
3d ago
Settings → API keys · trydock.ai/settings

The 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):

CLI: mint a dk_ keybash
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):

Add via claude CLIbash
claude mcp add dock \
  --transport http \
  --header "Authorization: Bearer $DOCK_API_KEY" \
  https://trydock.ai/api/mcp

The --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.

Config file
~/.claude.json
Scope
User-global. Applies to every Claude Code session on your machine. For project-scoped config, use .claude/settings.json at the project root.
Reload
Claude Code reads config on every invocation. No daemon restart, no IDE reload. Your next claude run picks it up.
~/.claude.json (merge into existing file)json
{
  "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_ticket

Or verify the MCP handshake directly from curl (no Claude Code needed, useful for debugging):

curl sanity checkbash
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

Symptom
Fix
401 Unauthorized on every call
The dk_ 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.
Claude Code shows dock but tools list is empty
The MCP server is reachable but auth silently failed. Check ~/.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.
OAuth flow opens browser but hangs
A local callback URL on 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).
Tools return Workspace not found
The key's scope doesn't include that workspace slug, or a different org owns a workspace with the same slug. Re-mint the key with the correct workspace, or use the canonical URL /{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 →
Updated