Invite-only.
Connect

Vercel AI SDK

The Vercel AI SDK can pull Dock's tools into any generateText or streamText call via the experimental MCP client.

Client
Vercel AI SDK
TypeScript SDK for agent apps. MCP via experimental_createMCPClient.
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

  • Node 20+.
  • ai and @ai-sdk/anthropic installed (npm i ai @ai-sdk/anthropic).
  • A Dock dk_ key.
agent.tstypescript
import { experimental_createMCPClient as createMCPClient, generateText } from "ai";
import { anthropic } from "@ai-sdk/anthropic";

const dock = await createMCPClient({
  transport: {
    type: "http",
    url: "https://trydock.ai/api/mcp",
    headers: {
      Authorization: `Bearer ${process.env.DOCK_API_KEY}`,
    },
  },
});

const tools = await dock.tools();

const { text } = await generateText({
  model: anthropic("claude-opus-4-7"),
  prompt: "List my Dock workspaces.",
  tools,
  maxSteps: 5,
});

console.log(text);
await dock.close();

Verify

DOCK_API_KEY=dk_live_... npx tsx agent.ts
# → Found 3 workspaces: content-pipeline, research-queue, product-brief

Troubleshooting

Symptom
Fix
Import fails: experimental_createMCPClient not exported
Upgrade ai to a recent version (4.x+). MCP client support moved out of experimental in mid-2025; the name may be createMCPClient on newer builds.
streamText stalls after first tool call
maxSteps defaults to 1. Set it to at least 5 for multi-step agent loops that include Dock tool calls.

Related