Skip to main content

Thin MCP server for managing StyleDex design library artifacts.

Project description

styledex-mcp

Thin MCP server for managing the StyleDex design library at ~/.styledex/designs.

The server owns aliases, curated Playwright capture, metadata, artifact writes, validation summaries, rename, list, and delete. It does not expose generic browser controls; it only captures the StyleDex evidence types agents need.

Install

Install the MCP server:

uv tool install styledex-mcp

Install the Playwright browser used for captures:

uvx --from styledex-mcp playwright install chromium

If styledex-mcp is not found after installation, add uv's tool directory to your shell path:

uv tool update-shell

Restart your shell after updating the path.

Upgrade later with:

uv tool upgrade styledex-mcp

Uninstall with:

uv tool uninstall styledex-mcp

MCP Config

Use the installed styledex-mcp executable in your MCP client config.

{
  "mcpServers": {
    "styledex": {
      "command": "styledex-mcp"
    }
  }
}

For opencode:

{
  "mcp": {
    "styledex": {
      "type": "local",
      "command": ["styledex-mcp"],
      "enabled": true
    }
  }
}

Restart your MCP client after changing MCP config.

styledex-mcp uses stdio transport. Running it directly in a terminal is only useful for smoke testing; it waits for an MCP client on stdin.

Environment

  • STYLEDEX_ROOT: optional override for the design library root. Defaults to ~/.styledex/designs.
  • Legacy fallback: when STYLEDEX_ROOT is unset, ~/.styledex/designs does not exist, and the old Style Mirror root exists, StyleDex reads STYLE_MIRROR_ROOT or ~/.style-mirror/designs so existing captures remain available after the rename.

Tools

  • styledex_list
  • styledex_get
  • styledex_create
  • styledex_capture_screenshot
  • styledex_capture_snapshot
  • styledex_capture_extract
  • styledex_save
  • styledex_rename
  • styledex_delete

styledex_create supports mode="overwrite".

styledex_delete permanently removes an alias directory.

Capture Contract

styledex_create
styledex_capture_screenshot
styledex_capture_snapshot
styledex_capture_extract
styledex_save

styledex_get and styledex_save include a validation summary, so there is no separate public validation tool.

styledex_capture_extract supports links, cssVariables, and computedStyles.

styledex_save accepts profile artifacts plus explicit metadata fields: status, confidence, caveats, and observedNoise. The MCP updates protected metadata fields such as alias, createdAt, lastUpdated, and files itself.

Artifact Layout

Each saved site is isolated by alias under ~/.styledex/designs/<alias>/. Screenshots for one alias are never shared with another alias.

Use artifact-type directories inside each alias:

  • Screenshots: screenshots/
  • Structured evidence: evidence/

Seed screenshots use the paths returned by styledex_create in suggestedScreenshotPaths, such as screenshots/desktop-fold.png.

Supporting page screenshots should also stay under the same alias-level screenshots/ directory. Use the returned suggestedPageScreenshotPaths patterns, for example:

  • screenshots/pricing-desktop-full.png
  • screenshots/pricing-mobile-full.png

Do not put screenshots under evidence/. Page-specific JSON evidence can use paths such as evidence/pages/pricing/computed-styles.json.

Development Setup

python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'
.venv/bin/python -m playwright install chromium

Run validation:

.venv/bin/python -m pytest
.venv/bin/python -m mypy

Verify the package installs as a persistent tool:

uv tool install .
uv tool list

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

styledex_mcp-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

styledex_mcp-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file styledex_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: styledex_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for styledex_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e04aa731ddc8a4dde8861d2d24e53fcef964dc1d68d7ff3d17e2c73bc5b4bb0a
MD5 d645f94240498b5a3024044139247607
BLAKE2b-256 2f38e1ae8175cb3a0357e8b7027cc1dadb93df46d33f4c91b9626c4fc3a4a759

See more details on using hashes here.

File details

Details for the file styledex_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: styledex_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for styledex_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e36910402b5d34900c4651554486e2a925c9f781f700c251a229bde3b32aeac
MD5 41d8b13e6ce8b7d76bdf6539822ae961
BLAKE2b-256 89578a4ec8f80fab5ac4c281defcf8982eb4042e65f053ebdcfa246a9424375e

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