Skip to main content

MCP server wrapping the Penpot REST API for headless design automation

Project description

penpot-api-mcp

MCP server wrapping the Penpot REST API for headless design automation. Provides read, search, and export access to Penpot projects, files, and design objects — without requiring a browser session.

Part of the Bodai Ecosystem alongside Mahavishnu, Akosha, Dhara, Session-Buddy, and Crackerjack.

Why this exists

The official @penpot/mcp (TypeScript) requires a live browser plugin to operate — it is the right tool for interactive canvas manipulation. This server targets the complementary use case: background automation, asset export pipelines, and AI-driven design queries that run without a browser.

Tools

Tool Description
list_projects List all projects for the authenticated user
get_project_files List design files in a project
get_file Fetch the full content of a design file
get_object_tree Return the design object hierarchy for a file
search_objects Search objects by name or type
export_object Export a design object as PNG/SVG (base64-encoded)

Setup

uv sync
cp .env.example .env   # fill in credentials

Configuration

Environment variables (prefix PENPOT_):

Variable Description Default
PENPOT_ACCESS_TOKEN API access token (preferred)
PENPOT_EMAIL Email for password auth (fallback)
PENPOT_PASSWORD Password for password auth (fallback)
PENPOT_BASE_URL API base URL for self-hosted instances https://design.penpot.app/api

Either PENPOT_ACCESS_TOKEN or PENPOT_EMAIL + PENPOT_PASSWORD must be set.

Running

# HTTP mode (default — Claude Code compatible)
uv run python -m penpot_api_mcp start --force

# stdio mode
uv run python -m penpot_api_mcp

Server listens on http://localhost:3051/mcp.

MCP configuration

{
  "mcpServers": {
    "penpot-api": {
      "type": "http",
      "url": "http://localhost:3051/mcp"
    }
  }
}

Development

uv run pytest                          # Run tests
uv run crackerjack                     # Full quality suite (ruff + mypy + pytest + bandit)
uv run ruff check --fix                # Lint
uv run mypy .                          # Type check

Architecture

penpot_api_mcp/
├── utils/transit.py      # Transit+JSON encode/decode (Penpot's wire format)
├── config/settings.py    # Pydantic settings (PENPOT_* env vars)
├── clients/              # httpx async client with dual auth
├── models/               # Pydantic models: Project, File, Object, ObjectTree
├── tools/                # FastMCP tool registrations
├── server.py             # FastMCP app + health endpoints
└── __main__.py           # MCPServerCLIFactory entrypoint (Oneiric)

Transit+JSON

Penpot's RPC layer uses Transit+JSON — a Clojure serialization format where map keys are ~:keyword and UUIDs are ~uUUID. The utils/transit.py module handles encode/decode at the API boundary, keeping all Python models clean.

Authentication

Two modes are supported:

  • API token (PENPOT_ACCESS_TOKEN): sent as Authorization: Token <token> header
  • Email + password: authenticates via /rpc/command/login-with-password, then relies on the httpx cookie jar (auth-token cookie) for all subsequent requests

License

BSD 3-Clause. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

penpot_api_mcp-0.1.3.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

penpot_api_mcp-0.1.3-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file penpot_api_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: penpot_api_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for penpot_api_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fe383f4707cddbf91aacf28630f91c96e2919471843b77f4b0be6bc7a999ec01
MD5 d09c80de828fa77109c4de33ea7c69cb
BLAKE2b-256 994f7fc7be4bf76f650e38dd3052b1bb20acc9ab0deb34533fda5ca9bfc26e4e

See more details on using hashes here.

File details

Details for the file penpot_api_mcp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: penpot_api_mcp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for penpot_api_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0123f704d88a01b3b8e4a8af9ca17074584853cbca8db1b5c4f4e80f832c59d7
MD5 8e034cf0337fb6a61d5a082eadfc6f36
BLAKE2b-256 11febfa017125fc162b537cf4509f03cb062572e535cf8128d837eed0c5d1216

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page