Connect
LlamaIndex
LlamaIndex agents can load Dock's MCP tools via the llama-index-tools-mcp adapter. Useful when you want Dock writes tied into a RAG pipeline.
Client
LlamaIndex
Data framework for LLMs. MCP via llama-index-tools-mcp.
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+.
llama-indexandllama-index-tools-mcpinstalled.- A Dock
dk_key.
agent.pypython
import os
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec
from llama_index.core.agent import ReActAgent
from llama_index.llms.anthropic import Anthropic
mcp = BasicMCPClient(
"https://trydock.ai/api/mcp",
headers={"Authorization": f"Bearer {os.environ['DOCK_API_KEY']}"},
)
spec = McpToolSpec(client=mcp)
tools = await spec.to_tool_list_async()
# Bring your own LlamaIndex LLM, any provider (Anthropic, OpenAI, Google, Mistral, ...).
agent = ReActAgent.from_tools(tools, llm=llm)Troubleshooting
Symptom
Fix
to_tool_list_async hangsThe MCP client is waiting for an
initialize response. Double-check the URL has no trailing slash and the Authorization header is passed.Frequently asked questions
- How do I connect Dock to LlamaIndex?
- Add Dock as a remote MCP server in LlamaIndex. Either let LlamaIndex's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in LlamaIndex's MCP config under the `Authorization: Bearer dk_…` header.
- Does LlamaIndex 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 LlamaIndex, discovers them via the standard `tools/list` handshake. Learn more →
- How do I limit which Dock workspaces LlamaIndex can write to?
- When you mint the `dk_` key for LlamaIndex 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 LlamaIndex did in my Dock workspace?
- Open the workspace in your browser. Every row LlamaIndex 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 LlamaIndex 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 LlamaIndex's `dk_` key in Settings → API keys.
- Can multiple LlamaIndex sessions share state through Dock?
- Yes. Every LlamaIndex 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 LlamaIndex need OAuth or a dk_ API key for Dock?
- Either works. OAuth 2.1 + DCR is the recommended path: LlamaIndex 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 call Dock's MCP server from a LlamaIndex agent?
- Use LlamaIndex's `MCPClient` with HTTP transport, `https://trydock.ai/api/mcp`, and Bearer auth. Wrap the resulting tool list with `FunctionTool.from_defaults` and pass to `ReActAgent` or `OpenAIAgent`.
- Can LlamaIndex's data ingestion pipeline write to a Dock workspace?
- Yes. Use a custom Transformation that calls Dock's `create_row` for each parsed document chunk. Your LlamaIndex pipeline becomes a Dock-backed knowledge base your team can browse + edit + comment on.
- How does Dock complement LlamaIndex's vector store?
- Vector stores are great for semantic retrieval; Dock is great for structured, attributed, human-readable shared state. Common pattern: LlamaIndex retrieves context, the agent writes its conclusions to Dock, your team reviews in the workspace UI.