Connect
v0 logo

v0

v0 generates React + Next.js apps. Since v0 output is Vercel AI SDK-friendly by default, Dock integration is a few prompts: drop a Dock client, add the key to Vercel env, deploy.

Client
v0
Vercel's UI generator. Native Vercel AI SDK integration.
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

  • A v0 account.
  • A Vercel project (v0 deploys to Vercel by default).
  • A Dock dk_ key.
Env var
Vercel project · Settings · Environment Variables · add DOCK_API_KEY=dk_...
Prompt template
"Import from @/lib/dock. Fetch workspaces on page load. Show rows grouped by status. Use the DOCK_API_KEY env var."
lib/dock.ts (paste into v0 prompt, ask v0 to use it)typescript
const BASE = "https://trydock.ai/api";
const H = () => ({
  Authorization: `Bearer ${process.env.DOCK_API_KEY}`,
});

export async function listRows(slug: string) {
  const r = await fetch(`${BASE}/workspaces/${slug}/rows`, {
    headers: H(),
  });
  return r.json();
}

export async function appendRow(slug: string, data: Record<string, unknown>) {
  const r = await fetch(`${BASE}/workspaces/${slug}/rows`, {
    method: "POST",
    headers: { ...H(), "Content-Type": "application/json" },
    body: JSON.stringify({ data }),
  });
  return r.json();
}

Troubleshooting

Symptom
Fix
v0 generates client components that expose the key
Dock key must stay server-side. Move the fetch into a Server Component or Route Handler. Re-prompt if v0 embeds it in a client component.

Frequently asked questions

How do I connect Dock to v0?
Add Dock as a remote MCP server in v0. Either let v0's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in v0's MCP config under the `Authorization: Bearer dk_…` header.
Does v0 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 v0, discovers them via the standard `tools/list` handshake. Learn more →
How do I limit which Dock workspaces v0 can write to?
When you mint the `dk_` key for v0 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 v0 did in my Dock workspace?
Open the workspace in your browser. Every row v0 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 v0 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 v0's `dk_` key in Settings → API keys.
Can multiple v0 sessions share state through Dock?
Yes. Every v0 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 v0 need OAuth or a dk_ API key for Dock?
Either works. OAuth 2.1 + DCR is the recommended path: v0 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 →
Can v0 use Dock as a backend for prototyped apps?
Yes. v0 generates Next.js code that can hit Dock's REST API. In your prompt, ask v0 to fetch from `https://trydock.ai/api/workspaces/<slug>/rows` with `Authorization: Bearer dk_...`. Your prototype reads/writes a real Dock workspace.
How do I set up Dock auth in a v0-generated Next.js app?
Add `DOCK_API_KEY` to your env vars in v0 (Settings → Environment), then have v0 generate a server action that calls Dock's API with the key. v0 keeps the key server-side automatically.
Can a v0 prototype real-time-stream Dock workspace updates?
Yes, via Dock's SSE endpoint. Ask v0 to generate a React component that subscribes to `https://trydock.ai/api/workspaces/<slug>/stream` with EventSource. Updates render live as agents write to the workspace.

Related

Updated