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â
db_pxl81cxn92wignwx
ââŽâââââââââââââââââ
â 16 random alphanumeric chars
âââ "db_" prefix
-
Where you configure it: Once, at editor mount.
<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â
db_mcp_A1b2C3d4E5f6G7h8I9j0K1l2
ââââââââââââââââââââââââââââââ
â 24 random alphanumeric chars (mixed case)
âââ "db_mcp_" prefix
- 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â
db_mcp_client_A1b2C3d4E5f6G7h8I9j0K1l2
âââââââââââââââââââââââââââââââââââââ
â 24 random alphanumeric chars (mixed case)
âââ "db_mcp_client_" prefix
- 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:
1. Your SaaS loads the editor with editor_key (domain-bound)
2. User clicks "Connect AI" in your UI
3. The editor creates an MCP session and shows an 8-digit pairing code
ââââââââââââââââââââââ
â AI Pairing Code: â
â 47289153 â
â stored per session â
ââââââââââââââââââââââ
4. User pastes: "Connect with Dragble MCP using pairing code 47289153"
into their AI client (OpenCode, Claude Code, etc.)
5. AI client (configured with mcp_client_key) redeems the code â gets paired
6. Tool calls from AI stream back to the editor live on canvas
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.