pac-vector
Local stdio MCP server: an SVG editor over in-memory virtual documents (one per "window", like Inkscape), with a live browser preview of every edit.
- Content goes in as SVG markup; structure (layers, groups, masks, z-order) has typed tools.
- Layers are real Inkscape layers, so exported files open in Inkscape with layers intact.
- Path booleans (union, difference, intersection, exclusion, division) via Skia PathOps.
- Every edit is atomic (a failed call changes nothing), one undo/redo step, and autosaved: windows of a crashed session reopen in the next one.
renderreturns a PNG the agent can look at; rendering is resvg (no browser, no Cairo).
Install
Same shape as pac-pincers: a pip package, run as a module by whatever Python it was installed into.
python -m pip install --upgrade pac-vector
claude mcp add pac-vector --scope user -- python -m pac_vector
As a plugin .mcp.json entry (mirrors the datatopia plugin's pac-pincers entry):
"pac-vector": {
"type": "stdio",
"command": "${PAC_VECTOR_PYTHON:-python}",
"args": ["-m", "pac_vector"],
"env": {}
}
Development:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\python.exe run_tests.py -q
.\.venv\Scripts\python.exe -m build # dist/pac_vector-<ver>.tar.gz + .whl
Tools (21)
| Group | Tools |
|---|---|
| Documents | doc_create (blank, file, markup, or duplicate an open window), doc_list, doc_set (size, units, viewBox, background, fit), doc_export (svg/png, page/drawing/ids, plain), doc_close |
| Reading | inspect (outline or xml), render (PNG, optional crop to ids + bbox) |
| Editing | add (markup → layer/group, defs auto-routed; SMIL animations into any element), update (attrs/style/text/transform/label/hidden/locked/text-on-path on many ids), replace (one element or the whole drawing), remove, arrange (z-order, move between layers, duplicate, offset), import_svg (file / other window / markup → editable group or embedded image, fitted into a box) |
| Structure | group (also new layers), ungroup, mask (mask or clip from id or markup), unmask |
| Geometry | boolean (union, difference, intersection, exclusion, division), align (align edges/centers, distribute evenly or by gap; relative to selection, page, first, last or an element) |
| History | undo, redo |
Preview
doc_create / doc_list / inspect print preview: http://127.0.0.1:<port>/#<doc>.
The page has a tab per document, outlines the elements each edit touched, and
shows (and copies) the id of anything you click. The server lives inside the MCP
process: it starts on the first doc_create and dies with the session.
Environment
| Variable | Default | Meaning |
|---|---|---|
PAC_VECTOR_PORT |
0 (random) |
Pin the preview port (falls back to random if busy) |
PAC_VECTOR_OPEN_BROWSER |
off | 1 opens the preview in the default browser on first start |
PAC_VECTOR_ROOT |
server cwd | Base directory for relative export/import paths |
PAC_VECTOR_LOG |
WARNING |
Log level (stderr only) |
PAC_VECTOR_AUTOSAVE |
on | 0 disables the crash-recovery mirror |
PAC_VECTOR_AUTOSAVE_DIR |
<tmp>/pac-vector-autosave |
Where the mirror lives (<pid>/<doc>.svg + .json) |
Notes
- stdout is the JSON-RPC pipe: nothing may print to it.
tests/test_stdout_safety.pyscans the package forprint()/sys.stdout, andtests/test_stdio.pyruns a real session. - Native modules are loaded before the stdio loop starts (
render.warm): on Windows a first native load from inside the FastMCP loop can hang (see pac-pincers'_excel.py). - Bounding boxes are measured from pixels (two-pass render), so they include strokes and
filters and work for text and curves; content further than two page-widths off-canvas isn't found.
alignuses them, so it aligns what you see. - Booleans use fill geometry only (strokes, text and images don't take part); the result
is a
<path>in the bottom operand's place, styled like it, keeping its id. - Animations are SMIL: the browser preview plays them;
render/ PNG export show the static first frame. - Version lives only in
pyproject.toml; a release is a commit named after the version.
Metadata
Release files for pac-vector 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pac_vector-0.2.0.tar.gz | 50.3 kB | Without provenance | Details for pac_vector-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pac_vector-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pac_vector-0.2.0-py3-none-any.whl |
Total release size: 97.4 kB
Release files / pac_vector-0.2.0.tar.gz
| Download URL | pac_vector-0.2.0.tar.gz |
|---|---|
| Size | 50.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c777cc39f3ef9d3c4894f845aca23e8d1962791fe3ca27b055880743389ff100
|
|
BLAKE2b-256 checksum How to use checksums |
4cd874947f3b478764ce6a82c9a7e0510d484e3b8a94b688044ec8ed3f6bbef3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / pac_vector-0.2.0-py3-none-any.whl
| Download URL | pac_vector-0.2.0-py3-none-any.whl |
|---|---|
| Size | 47.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ea3d10a3cd1a982c9bfc086fa00fc2a77cceb1d8b560f037bca0a2d0a6709a3
|
|
BLAKE2b-256 checksum How to use checksums |
4501745907dd8e8394d043431bb9cc8cdd3ceb8daff2eb558f070b9e8f156ecc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for pac-vector 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.