Connect
OpenAI Agents SDK
The OpenAI Agents SDK has a built-in MCPServer helper. Wire up Dock, hand the server to an Agent, done.
Client
OpenAI Agents SDK
Python + JS. First-class MCPServer class.
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+ or Node 20+.
openai-agentsinstalled (pip install openai-agentsornpm i @openai/agents).- A Dock
dk_key.
Pythonpython
import os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
dock = MCPServerStreamableHttp(
params={
"url": "https://trydock.ai/api/mcp",
"headers": {
"Authorization": f"Bearer {os.environ['DOCK_API_KEY']}"
},
}
)
async def main():
async with dock:
agent = Agent(
name="Content agent",
instructions="You manage the content-pipeline workspace.",
mcp_servers=[dock],
)
result = await Runner.run(agent, "List my workspaces.")
print(result.final_output)TypeScripttypescript
import { Agent, run } from "@openai/agents";
import { MCPServerStreamableHttp } from "@openai/agents/mcp";
const dock = new MCPServerStreamableHttp({
url: "https://trydock.ai/api/mcp",
headers: {
Authorization: `Bearer ${process.env.DOCK_API_KEY}`,
},
});
await dock.connect();
const agent = new Agent({
name: "Content agent",
instructions: "You manage the content-pipeline workspace.",
mcpServers: [dock],
});
const result = await run(agent, "List my workspaces.");
console.log(result.finalOutput);
await dock.close();Verify
DOCK_API_KEY=dk_live_... python agent.py
# → Found 3 workspaces: content-pipeline, research-queue, product-briefTroubleshooting
Symptom
Fix
Agent can't discover MCP tools
Make sure you connected the server before running. In Python, use
async with dock:. In JS, await dock.connect().Streamable-http class not found
Some older builds only ship SSE transport. Upgrade the package, or switch to
MCPServerSse with the same trydock.ai/api/mcp URL (Dock responds to both).