Connect
Sourcegraph Cody
Cody's agentic mode (and Sourcegraph Amp) supports remote MCP servers. Add Dock in the Cody config file and your code-aware agent can fold in Dock workspaces as context.
Client
Sourcegraph Cody
Code-aware AI with agent mode. MCP via Amp / Cody settings.
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
- Cody installed (VS Code, JetBrains, or CLI).
- A Dock
dk_key.
Config file
~/.config/sourcegraph/cody.jsoncody.json (merge mcpServers)json
{
"mcpServers": {
"dock": {
"url": "https://trydock.ai/api/mcp",
"headers": {
"Authorization": "Bearer dk_c914f1c6..."
}
}
}
}Verify
Use the dock MCP to list my workspaces.Troubleshooting
Symptom
Fix
Cody can't see Dock tools
Reload the Cody extension (in VS Code, "Developer: Reload Window"). Config is loaded at startup.
Frequently asked questions
- How do I connect Dock to Sourcegraph Cody?
- Add Dock as a remote MCP server in Sourcegraph Cody. Either let Sourcegraph Cody's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in Sourcegraph Cody's MCP config under the `Authorization: Bearer dk_…` header.
- Does Sourcegraph Cody work with Dock's MCP server?
- Yes. Dock exposes 43 MCP tools at `https://trydock.ai/api/mcp` over HTTP transport with OAuth 2.1 + DCR and Bearer-token auth. Any MCP-spec-compliant client, including Sourcegraph Cody, discovers them via the standard `tools/list` handshake. Learn more →
- How do I limit which Dock workspaces Sourcegraph Cody can write to?
- When you mint the `dk_` key for Sourcegraph Cody in Settings → API keys, pick the workspace from the dropdown. The key returns 403 on every other workspace regardless of what the prompt asks. To scope across multiple, mint multiple keys or add the agent as an explicit member of each. Learn more →
- How do I see what Sourcegraph Cody did in my Dock workspace?
- Open the workspace in your browser. Every row Sourcegraph Cody created or updated is stamped with the agent's identity (orb + name) in the createdBy / updatedBy field. The workspace activity feed shows every action chronologically. Learn more →
- How do I undo a row Sourcegraph Cody 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 Sourcegraph Cody's `dk_` key in Settings → API keys.
- Can multiple Sourcegraph Cody sessions share state through Dock?
- Yes. Every Sourcegraph Cody session reads and writes the same workspace, so handoffs across machines or across long-running multi-session workflows just work. The Dock workspace IS the shared state; no separate message bus required.
- Does Sourcegraph Cody need OAuth or a dk_ API key for Dock?
- Either works. OAuth 2.1 + DCR is the recommended path: Sourcegraph Cody hits Dock's discovery endpoint at `/.well-known/oauth-authorization-server` and auto-registers as a client. The `dk_` Bearer token path is fine for owned-code agents and CI scripts; pick whichever fits your stack. Learn more →
- How do I use Dock with Sourcegraph Cody?
- Cody supports OpenCtx providers; wrap Dock as an OpenCtx context provider that calls `list_rows` or `get_doc` for the current repo's matching Dock workspace. Cody then uses Dock content as additional context.
- Can Cody write its code search results to a Dock workspace?
- Yes, via Sourcegraph extensions or a custom Cody command. Configure the extension to call Dock's `create_row` with the search query + results; your team gets a Dock-backed audit trail of Cody's search activity.
- How is Dock different from Sourcegraph Notebooks?
- Sourcegraph Notebooks are query-focused, code-search-centric. Dock is general-purpose shared workspace state agents can read and write. Use both: Notebooks for code-aware investigation, Dock for the durable team-visible artifacts.