plandesk connect
Copy page
plandesk connect is the recommended way to wire MCP credentials and teach agent repo conventions — without committing secrets.
With plandesk serve running, from a codebase you want bound to a Plan Desk project:
plandesk connect --project "Checkout Revamp"What it writes
Section titled “What it writes”connect is idempotent — safe to re-run:
| Path | Committed? | Purpose |
|---|---|---|
.plandesk/config.json | yes | Pins repo → project or workspace. --project: v1 (projectId, projectName, serverUrl). --workspace: plandesk-connect-v2 ({ serverUrl, orgId, workspaceId, workspaceName, projectIds }) |
.plandesk/skill.md | yes | Agent conventions (The Skill) |
.plandesk/token | no (gitignored) | Scoped agent key — written for a hosted connect --to (project- or workspace-scoped); local loopback needs none |
.claude/skills/plandesk/SKILL.md / .agents/skills/plandesk/SKILL.md | yes | Symlinks → .plandesk/skill.md (skill discovery) |
.mcp.json | yes | MCP server entry with a headersHelper that reads the token |
CLAUDE.md / AGENTS.md | yes | Sentinel block @.plandesk/skill.md |
.codex/commands/plandesk.md | yes | Codex command → skill file |
Workflow
Section titled “Workflow”-
Resolves the project (by id or name) or workspace (by name) the repo binds to. A workspace bind resolves the workspace and collects all of its project ids into
config.json. -
Local (default): no token — loopback is zero-auth, so
.plandesk/tokenis not written unless you pass--tokenexplicitly. Hosted (--to <org>): mints a scoped agent key into.plandesk/token(gitignored), using the owner keyplandesk loginstored — project-scoped with--project, workspace-scoped with--workspace. A workspace-scoped key reaches every project in that workspace and nothing else in the org. -
Writes
.plandesk/config.json(committed project binding). -
Merges the
plandeskentry into.mcp.json. The entry uses aheadersHelperthat reads.plandesk/tokenat connection time, so the token works with zero manual setup — noexportneeded. SetPLANDESK_MCP_TOKENonly if you want to override the file. -
Symlinks the skill into
.claude/skills/plandesk/and.agents/skills/plandesk/(created if missing) so agents discover it as a skill. -
Inserts an idempotent sentinel block in
CLAUDE.md(andAGENTS.mdif present):<!-- plandesk:start -->@.plandesk/skill.md<!-- plandesk:end --> -
Writes
.codex/commands/plandesk.mdfor Codex.
After connecting, start a new agent session so MCP tools reload. No token export is required.
Options
Section titled “Options”plandesk connect [--repo <dir>] [--project <id|name>] [--workspace <name>] [--url <url>] [--token <token>] [--agent claude|codex|both] [--print]plandesk connect --to <org> [--project <id|name>] [--workspace <name>] [--repo <dir>] [--print] # hosted: mint a scoped key--project <id|name>— bind the repo to a single project (writes a v1 config).--workspace <name>— bind the repo to a whole workspace (writes aplandesk-connect-v2config). On--to, mints a workspace-scoped key.--to <org>— hosted: mint a scoped agent key with the login owner key. Local is the default when--tois omitted.--print— dry-run without writing files.--agent— target Claude, Codex, or both (default: detect).
A repo already bound to a workspace cannot be silently rebound to a different project/workspace — rebind with an explicit --project or --workspace.
Connect to a workspace
Section titled “Connect to a workspace”--workspace is for multi-project engagements — one client or product with several projects. The agent’s MCP list_projects then returns only that workspace’s projects (token-enforced; cross-workspace project ids return 404). See Workspaces.
plandesk connect --workspace "Fiji TV" # localplandesk connect --to <org> --workspace "Fiji TV" # hosted: workspace-scoped keyThe bound config:
{ "version": "plandesk-connect-v2", "serverUrl": "http://127.0.0.1:7526", "orgId": "<org-id>", "workspaceId": "<team-id>", "workspaceName": "Fiji TV", "projectIds": ["<project-id>", "<project-id>"]}Disconnect
Section titled “Disconnect”Remove binding: plandesk disconnect (does not revoke the token).
Manual alternative
Section titled “Manual alternative”If you prefer not to use connect, see MCP Setup for manual token creation and claude mcp add / codex mcp add registration.