feat(penpot-mcp): add create_file tool #88
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/73"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
create_file(project_id, name, features?)topenpot_mcp/tools/canvas.py, wrapping thecreate-fileRPC directly (not a change-op — file is initialised server-side). Returns{file_id, name, revn}.featuresdefaults to Penpot's current baseline set (components/v2,layout/grid,styles/v2,design-tokens/v1,fdata/path-data,fdata/objects-map,fdata/shape-data-type,variants/v1,plugins/runtime), derived from theclaude-hooks — dashboardreference file.projectId,name,features) and return value mapping (file_idnot rawid).pytest -m live) creates a temp file in the Drafts project, round-trips the name viaget-file, and deletes it infinally.pyproject.tomlversion bumped to 0.6.0.Test plan
pytest tests/test_canvas.py— all 18 unit tests pass (3 new forcreate_file)pytest -m liveagainst a live Penpot instance —test_create_file_roundtrip_in_drafts_projectcreates and cleans up a temp fileCloses #73
Adds create_file(project_id, name, features?) to the canvas module, wrapping the create-file RPC directly. Returns {file_id, name, revn}. Features default to Penpot's current baseline set derived from the claude-hooks dashboard reference file. Includes unit tests asserting camelCase RPC payload and return value, and a live test (pytest -m live) that creates a temp file in Drafts, round-trips the name via get-file, and deletes the file in finally. Bumps penpot-mcp-server to 0.6.0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>Review: feat(penpot-mcp): add create_file tool
CI: run #1609 (SHA
a4c8779) →success✅Acceptance criteria (issue #73): all met ✅
create_file(project_id, name, features?)implemented incanvas.py, callingcreate-fileRPC directly (correct — not a change-op). Returns{file_id, name, revn}. ✅_DEFAULT_FEATURESlist matches the spec exactly (all 9 flags). ✅features if features is not None else _DEFAULT_FEATUREScorrectly passes through an explicit empty list rather than silently replacing it with the default. ✅file_idnot rawid). ✅get-file, and deletes infinally. ✅pyproject.tomlversion bumped to 0.6.0. ✅Note on missing
@pytest.mark.asynciointest_canvas_live.py: not an issue —pyproject.tomlsetsasyncio_mode = "auto", so the decorator is optional project-wide.Code is correct, tests are thorough, no safety or logic issues. LGTM.
create_file(project_id, name, features?)(#73) #89