Credentials & Security
Dragble uses three separate credentials for MCP access. Understanding which to use where is critical: get it wrong and you'll either expose secrets or hit 401 errors.
The three keys
editor_key ā browser-safe SDK credential
Where you configure it: Once, at editor mount.
tsx<DragbleEditor editorKey="db_pxl81cxn92wignwx" />Where to find: Dashboard ā Projects ā {your project} ā Editor Key
Domain enforcement: Required. Must include an
Originheader matching your allowed domains list.Exposed in browser: Yes (this is intentional)
What it authenticates: Editor ā Dragble server traffic, including loading the editor and the editor's internal calls when you invoke
sdk.joinMCP({ id })orsdk.startMCPPairing({ id }). You only passidā the editor sendseditor_keyautomatically.Permissions: Editor flows ā load editor, create MCP session from browser, generate pairing codes
mcp_key ā backend server-secret credential
- Where to use: Your backend AI orchestrator and BYOI session lifecycle calls
- Where to find: Dashboard ā Projects ā {your project} ā MCP Key ā Backend MCP Key
- Domain enforcement: None (server-to-server credential)
- Exposed in browser: NEVER
- Permissions: Backend MCP access ā create/manage sessions, force-disconnect sessions, and call tools with a frontend-created
sessionId. Design tools still require a live editor session.
mcp_client_key ā AI-client pairing credential
- Where to use: Claude Code, OpenCode, Cursor, Codex, Continue, Zed, Claude Desktop, and other third-party MCP client configs
- Where to find: Dashboard ā Projects ā {your project} ā MCP Key ā Client MCP Pairing Key
- Domain enforcement: None (MCP client credential)
- Exposed in browser: NEVER
- Permissions: Pairing-only MCP client access ā list tools, call
pair_with_editorwith an 8-digit code, then use tools only for that paired live editor session. It cannot create, destroy, or claim raw backend sessions.
Which credential goes where
The rule is simple:
| You're doing this | Use this credential |
|---|---|
| Loading the editor in your SaaS frontend | editor_key (set once at mount) |
Calling sdk.joinMCP({ id }) from the frontend | Nothing new ā the editor uses its mounted editor_key automatically |
| Configuring OpenCode, Claude Code, Codex, Cursor, etc. | mcp_client_key |
| Running an AI orchestrator from your backend | mcp_key |
Third-party AI clients need mcp_client_key. They reject editor_key, and the backend MCP key is reserved for server-side session lifecycle. This is by design: the editor key is browser-public, and the backend key can manage raw sessions. Third-party clients only get pairing-scoped access.
Backend AI orchestration should receive the live editor's sessionId from your frontend after sdk.joinMCP({ id }). Your backend then connects to MCP with mcp_key, injects that sessionId into each tool call, and MCP routes the call to the live editor.
Generating your MCP keys
- Open the Dragble dashboard at https://developers.dragble.com
- Click your project, then MCP Key in the sidebar
- Generate the key you need:
- Backend MCP Key for your own backend orchestration (
db_mcp_...) - Client MCP Pairing Key for Claude/OpenCode/Cursor/Codex-style clients (
db_mcp_client_...)
- Backend MCP Key for your own backend orchestration (
- Copy it immediately ā the dashboard shows it once, then masks the middle (you'll see
db_mcp_ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢ā¢l2K1l2) - Store backend keys in your backend's environment variables:
# .env on your backend (NEVER in frontend)
DRAGBLE_MCP_KEY=db_mcp_A1b2C3d4E5f6G7h8I9j0K1l2
For third-party MCP clients, use the client key in local client config:
DRAGBLE_MCP_CLIENT_KEY=db_mcp_client_A1b2C3d4E5f6G7h8I9j0K1l2
What you can do after generation
| Button | Effect |
|---|---|
| Rotate | Issues a new key, invalidates the old one immediately. Backends or AI clients using the old matching key receive 401 until updated. |
| Revoke | Removes the key entirely. MCP server access is denied until you generate a new one. |
Where to NEVER put MCP keys
Both MCP keys are sensitive Dragble credentials. Treat them like:
- ā Browser JavaScript bundles ā anyone visiting your site can extract it
- ā Public GitHub repos ā secret scanners + crawlers will find it
- ā
.envfiles committed to git ā even private repos leak through team members - ā URL query parameters ā server logs, browser history, referrer headers
- ā Client-side .env (
NEXT_PUBLIC_*,VITE_*) ā these are inlined into the browser bundle - ā Mobile app builds ā easily extracted via decompilation
Safe storage
- ā
Backend env vars loaded server-side only (e.g., Node
process.env, Cloud Run secrets, Vercel env vars withoutNEXT_PUBLIC_prefix) - ā Secret managers: AWS Secrets Manager, GCP Secret Manager, Vault, Doppler
- ā CI/CD secrets for deploy-time injection
- ā
Developer's local OpenCode/Claude Code config at
~/.config/...formcp_client_keyonly (never committed)
How the keys work together
The browser never sees MCP keys. The backend MCP key stays on your server. The AI client never sees editor_key; it only receives the client pairing key. Each credential stays in its own safe context:
The credentials never travel through the same channel. Backend flows skip pairing codes and use mcp_key with the frontend-created sessionId; third-party client flows use mcp_client_key plus pair_with_editor.
Key rotation strategy
| Scenario | Action |
|---|---|
| Suspect key compromise | Rotate immediately. Update backend env vars or MCP client configs for the affected key. |
| Routine rotation | Every 90 days minimum (or per your security policy) |
| Developer leaves team | Rotate all keys they had access to |
| Migrating to production | Generate fresh keys; don't reuse dev keys |
| First production deploy | Generate new key, store in deploy environment, never reuse the dashboard-shown copy |
Audit timestamps
Every MCP key tracks when it was created and last rotated. View these in the dashboard's MCP Key page so you can confirm key freshness during security reviews.