Connect
crewai logo

CrewAI

CrewAI's MCPServerAdapter wraps any MCP server so every CrewAI agent can call it as a regular tool. Plug Dock in once and your crews can co-edit shared workspaces across sub-tasks.

Client
CrewAI
Python multi-agent orchestrator. MCP via crewai-tools MCPServerAdapter.
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

  • Python 3.10+.
  • crewai-tools with MCP support installed (pip install "crewai-tools[mcp]").
  • A Dock dk_ key.
crew.pypython
import os
from crewai import Agent, Crew, Task
from crewai_tools import MCPServerAdapter

dock_server = MCPServerAdapter({
    "url": "https://trydock.ai/api/mcp",
    "transport": "streamable-http",
    "headers": {
        "Authorization": f"Bearer {os.environ['DOCK_API_KEY']}"
    },
})

with dock_server as dock_tools:
    editor = Agent(
        role="Dock editor",
        goal="Keep content-pipeline tidy and moving.",
        tools=dock_tools,
    )

    seal = Task(
        description="Seal every drafted row older than 14 days.",
        agent=editor,
    )

    Crew(agents=[editor], tasks=[seal]).kickoff()

Verify

DOCK_API_KEY=dk_... python crew.py
# → Crew kicked off. Editor sealed 3 rows.

Troubleshooting

Symptom
Fix
ImportError: MCPServerAdapter not found
You installed crewai-tools without the MCP extra. Reinstall with pip install "crewai-tools[mcp]".
Adapter context exits without listing tools
Some environments strip the trailing slash from URLs. Use the exact string https://trydock.ai/api/mcp (no trailing slash, no path mangling).

Frequently asked questions

How do I connect Dock to CrewAI?
Add Dock as a remote MCP server in CrewAI. Either let CrewAI's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in CrewAI's MCP config under the `Authorization: Bearer dk_…` header.
Does CrewAI 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 CrewAI, discovers them via the standard `tools/list` handshake. Learn more →
How do I limit which Dock workspaces CrewAI can write to?
When you mint the `dk_` key for CrewAI 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 CrewAI did in my Dock workspace?
Open the workspace in your browser. Every row CrewAI 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 CrewAI 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 CrewAI's `dk_` key in Settings → API keys.
Can multiple CrewAI sessions share state through Dock?
Yes. Every CrewAI 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 CrewAI need OAuth or a dk_ API key for Dock?
Either works. OAuth 2.1 + DCR is the recommended path: CrewAI 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 connect a CrewAI agent to Dock?
Use CrewAI's MCP tool support: wrap Dock's MCP endpoint with `MCPServerHttp` and pass it as a tool to `Agent(tools=[dock_mcp])`. Each crew member can read and write the same Dock workspace, with attribution per agent.
Can CrewAI roles map to Dock signed-agent identities?
Yes. Mint one `dk_` key per CrewAI Role (Researcher, Writer, Editor) so each role's writes attribute correctly in Dock. Your team sees who-did-what at the role level, not just at the crew level.
How do CrewAI agents hand off work to each other through Dock?
Use Dock's row.status column as the handoff signal: Researcher writes rows with status=drafted, Writer subscribes via webhook, transitions to status=writing, then Editor takes status=ready-for-review. Each transition fires a `row.updated` event.

Related

Updated