Skip to main content
M

dsh-pen-dev

maxlee/dsh-pen-dev

Mounts the pen.dev desktop app MCP server in a DSH session so the model can read and edit the .pen document open in Pen through the get_app_state, read_skill, execute, get_style and browser tools; finds the server binary by probing the usual install paths, and adds a pen-dev skill plus a listener that turns pen.dev plan-limit failures into a short bilingual notice. Unofficial, and ships no pen.dev binaries.

Install

dsh plugin --profile web add github:maxlee/dsh-pen-dev

README

dsh-pen-dev

Unofficial pen.dev integration for DeepSeek Harness.

It connects the pen.dev desktop app's MCP server to a DSH session, so the model can design on the live pen.dev canvas, inspect frames and components, reproduce web pages as editable layers, and use pen.dev's own style archetypes. It also adds a small pen-dev skill that teaches the canvas workflow and points at pen.dev's authoritative read_skill documentation.

Not affiliated with or endorsed by pen.dev. pen.dev and its desktop app are their authors' property; this package ships no pen.dev binaries — it locates the MCP server inside an installed app.

What you get

ToolUse
mcp__pen__get_app_stateActive document, selection, top-level frames, components, browser state
mcp__pen__read_skillpen.dev's own canvas API docs (execute, schema, guides)
mcp__pen__executeRun canvas operations against the open .pen document
mcp__pen__get_styleLoad visual style archetypes (fonts, colors, imagery)
mcp__pen__browserOpen a real site in the app's browser, reproduce it as editable layers

Plus the bundled pen-dev skill.

Requirements

  • DeepSeek Harness with the @deepseek-ai/dsh-mcp-client plugin available. Developed and tested against DSH 0.2.1-rc.2.
  • pen.dev desktop app installed. Developed and tested with Pen 1.2.19 on macOS (arm64). The app ships its MCP server at Pen.app/Contents/Resources/app.asar.unpacked/out/mcp-server-<platform>-<arch>.

Install

Sidebar Plugins → Add plugin → Install third-party plugin, then enter the package name:

dsh-pen-dev

Accept a local path or Git URL there too.

From the CLI

dsh plugin --profile <profile> add dsh-pen-dev

The bundle is enabled when it is installed. With HMR on, the tools appear without a restart; otherwise restart the app.

From a plugin market

If a market index lists this plugin, open Plugins → Explore → Add index source, paste the index URL, then install from the results. market/index.json is a ready format-1 entry; PUBLISHING.md explains hosting one and why this DSH build has no official submission channel yet.

Manual equivalent

If you prefer the explicit YAML (for example while the package is not on npm yet, using a local path), install the package into the profile and let its bundle patch apply. The two rows it adds are:

- insert:
    - id: pen-dev
      name: dsh-pen-dev
    - id: pen-dev-skill
      name: dsh-pen-dev/skill

If you previously hand-wired pen.dev, delete your manual mcp-client row first. Two mcp-client instances cannot share one serverName; the second one fails with serverName "pen" is already in use.

How this relates to the official pen.dev MCP config

pen.dev documents the desktop integration as:

{"name":"pencil","transport":"stdio","command":"…/mcp-server-<platform>-<arch>","args":["--app","desktop"],"env":{}}

This bundle mounts exactly that server: same binary, same --app desktop, same five tools (browser, execute, get_app_state, get_style, read_skill). On top of the minimal config it:

  • locates the binary by probing /Applications, ~/Applications, /opt, and (on Windows) %LOCALAPPDATA%\Programs, so a non-standard install works without editing config files
  • passes --agent deepseekHarness so the pen.dev app can tell this connection apart from Claude Code or Codex; override it with PEN_MCP_AGENT
  • forwards PEN_MCP_CONVERSATION_ID as --conversation_id
  • raises the per-call timeout to 120 s, because execute and browser can exceed the 60 s default

--enable_spawn_agents is off by default: it would let pen.dev start its own agents outside DeepSeek Harness. Set PEN_MCP_ENABLE_SPAWN_AGENTS=1 to enable it deliberately.

The @pencil.dev/cli npm package ships a different MCP server build — nine filePath-based tools for its headless .pen editor. It is not a drop-in replacement for this integration: against the desktop app that server's IPC methods are not implemented (No handler found for method 'get-editor-state').

Configuration

VariableDefaultMeaning
PEN_MCP_BIN—Absolute path to the pen.dev MCP server binary. Use it for a non-standard install or another platform.
PEN_APP_PATHauto-detectedAbsolute path to the pen.dev app bundle, when detection misses it.
PEN_MCP_AGENTdeepseekHarness--agent value the pen.dev app sees for this connection.
PEN_MCP_CONVERSATION_ID—Forwarded as --conversation_id.
PEN_MCP_ENABLE_SPAWN_AGENTSoff1 or true passes --enable_spawn_agents (adds a spawn_agents tool).
PEN_MCP_SERVER_NAMEpenMCP namespace, i.e. the mcp__<name>__* prefix.

The binary path is computed when the profile activates. The patch probes the usual install roots with node:fs, so PEN_APP_PATH is only needed when the app lives somewhere unusual. If nothing is found, mcp-client reports the spawn failure, adds no tools, and the rest of the harness keeps working.

Notes and caveats

  • .pen files are encrypted. Only the MCP tools can read or write them — never open them with filesystem tools.
  • The tools edit the document the user is looking at. Treat execute as a visible, destructive action.
  • One editor per canvas at a time: if another agent (for example Claude Code) is also connected to Pen, avoid having both write simultaneously.
  • PEN_MCP_BIN requires the enclosing app (or a launcher that sets the variable) to pass it through. On macOS, GUI apps do not inherit your shell environment; PEN_APP_PATH exists mainly for launchers that do.
  • Windows/Linux: the path probe understands the usual Electron layouts, but only macOS is tested; PEN_MCP_BIN always wins when set.

Plan limits

pen.dev meters MCP usage as active days: each distinct calendar day (in your timezone) on which any pen tool is called counts once toward the plan's allowance for the current billing period. Free plans cap this at a few days per month; the Pro plan removes the cap ("Design with agents every day"). The CLI is metered by the same system.

While the allowance is exhausted, every pen tool fails — including reads. The bundled pen-dev-quota-guard rewrites the upstream "STOP … do not work around this" text into a short bilingual notice with the upgrade link, so the model stops instead of retrying. There is no local counter to reset: the check happens on pen.dev's servers, per organization.

Uninstall

Remove the bundle from the profile (Plugins UI, or dsh plugin --profile <profile> remove dsh-pen-dev). If you had a manual mcp-pen row before, restore it.

License

MIT. Unofficial community package; see the disclaimer above.

Related plugins