Skip to main content

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.

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.2.0.tar.gz (27.3 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.2.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: penpot_api_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.2.0.tar.gz
Algorithm Hash digest
SHA256 b83c4f3a9ce77100d6cdfefb03a7ab805dbda5649ec1cd41f015a049b0f30079
MD5 49224960461961b307c8604cf1daf0c0
BLAKE2b-256 4289f4600f0bf6c33153516b672fd48a47c7971d2726a498bd5089638e149026

See more details on using hashes here.

File details

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

File metadata

  • Download URL: penpot_api_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1c13b906ca9823d96b5d8a11b46b9c467682e2ff1ab5edcc5aa37389528b900
MD5 5402354d6d1ea6512a51ab4742f945e9
BLAKE2b-256 2770f9479f5bb16fe224e0116f8bc956d5c8d3f7bc43b8b4d6369ccf23da681b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.3

2 files

0.1.1

2 files

Supported by

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