Connect
Bolt.new
Bolt.new generates full-stack apps from prompts. No native MCP yet, but Bolt-built apps can call Dock's REST API from the generated code. Store the key as a project env secret and let Bolt wire the fetch calls.
Client
Bolt.new
StackBlitz app builder. REST via fetch + env secret.
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
- Bolt.new account (free tier works).
- A Dock
dk_key.
Env secret
Bolt project · .env ·
DOCK_API_KEY=dk_...Prompt template
"Use the
DOCK_API_KEY env var. Dock base URL is https://trydock.ai/api. Auth is Bearer on every call. Append rows to /workspaces/<slug>/rows when the form submits."Generated server action (Bolt will produce something like)typescript
export async function addTask(title: string, status: string) {
const res = await fetch(
"https://trydock.ai/api/workspaces/content-pipeline/rows",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DOCK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ data: { title, status } }),
}
);
if (!res.ok) throw new Error(await res.text());
return res.json();
}Troubleshooting
Symptom
Fix
Bolt hard-codes the key in source
Re-prompt with "use
process.env.DOCK_API_KEY, never inline the literal key".Preview works, deployed app 401s
Env secret only in dev. Add it in Bolt's deploy config too.
Frequently asked questions
- How do I connect Dock to Bolt.new?
- Add Dock as a remote MCP server in Bolt.new. Either let Bolt.new's OAuth 2.1 + DCR flow handle auth (recommended; no credential ceremony), or paste a scoped Dock `dk_` API key in Bolt.new's MCP config under the `Authorization: Bearer dk_…` header.
- Does Bolt.new 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 Bolt.new, discovers them via the standard `tools/list` handshake. Learn more →
- How do I limit which Dock workspaces Bolt.new can write to?
- When you mint the `dk_` key for Bolt.new 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 Bolt.new did in my Dock workspace?
- Open the workspace in your browser. Every row Bolt.new 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 Bolt.new 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 Bolt.new's `dk_` key in Settings → API keys.
- Can multiple Bolt.new sessions share state through Dock?
- Yes. Every Bolt.new 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 Bolt.new need OAuth or a dk_ API key for Dock?
- Either works. OAuth 2.1 + DCR is the recommended path: Bolt.new 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 Bolt.new generate apps that use Dock as a backend?
- Yes. Bolt generates code in the WebContainer; ask it to fetch from `https://trydock.ai/api/workspaces/<slug>/rows` with your Bearer token. The prototype runs against a real Dock workspace immediately.
- How do I keep my Dock API key out of a Bolt.new project's source?
- Use Bolt's environment variable support (Settings → Env). Reference `process.env.DOCK_API_KEY` in the generated server-side code. Bolt keeps env vars out of the client bundle automatically.
- Can a Bolt.new app subscribe to Dock's real-time stream?
- Yes. Generate a React component that uses EventSource pointed at `https://trydock.ai/api/workspaces/<slug>/stream` with the Bearer header. Real-time updates work in the WebContainer the same way they would in production.