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_live_... 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 @trydock/cli key new --name "Claude Code · me" --workspace content-pipeline
# → dk_live_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_live_c914f1c6..."
}
}
}
}Step 3. Verify
Start a Claude Code session and ask it to list Dock tools. If the connection works you'll see 37 tools.
$ claude
You: list the tools available from the "dock" MCP server
Claude: Here are the 37 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":[...37 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.Related
- MCP reference · full tool schemas
- Claude Cowork · desktop agent variant
- OpenClaw · open-source Claude-Code-like agent