Crystallize MCP

io.github.HayoDev由 GitHub 账号 HayoDev 发布v0.2.0更新于 Oct 25, 2026

Crystallize headless commerce tools for AI agents via Model Context Protocol

已验证STDIO仅桌面效率与工作流商业与电商

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手读写 Crystallize 无头电商租户的商品目录、形状、订单、客户和内容。

可以做什么
浏览、获取并按关键词搜索商品目录条目,列出带价格和库存的商品变体,每个响应都附带返回 Crystallize 界面的深链接。查看形状及其可查询字段,并按筛选、分页和字段选择浏览某个形状下的条目。读取形状和租户配置,包括可用语言(需要认证)。分页列出并查看订单和客户(需要认证)。创建条目并更新单个组件值,包括嵌套内容块,仅写入草稿。
适用场景
适合让助手在 Crystallize 店铺内工作:查询商品和内容、回答订单与客户相关问题,或起草新条目和组件修改,再由人工在 Crystallize 界面中审核并发布。
运行要求
通过 npx 在本地运行,需要 Node.js。必须设置 CRYSTALLIZE_TENANT_IDENTIFIER;目录和发现类工具无需认证。PIM 工具(形状、租户信息、订单、客户)需要 CRYSTALLIZE_ACCESS_TOKEN_ID 和 CRYSTALLIZE_ACCESS_TOKEN_SECRET,或 CRYSTALLIZE_STATIC_AUTH_TOKEN。写入工具需要把 CRYSTALLIZE_ACCESS_MODE 设为 write 或 admin,并使用有写权限的令牌。需要能访问 Crystallize 的网络。
安装前请注意
令牌继承创建者的权限,因此用只读角色创建令牌才能限制助手。write 和 admin 模式可以创建和修改内容;CRYSTALLIZE_DRY_RUN 可预览变更而不执行。客户和订单数据默认不脱敏返回;可将 CRYSTALLIZE_PII_MODE 设为 masked 或 none。可选的审计日志会原样记录参数,可能包含个人信息。除非使用钥匙串存储,配置文件中的令牌为明文。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Crystallize MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Crystallize MCP

[npm version] [npm downloads] [license] [node]

MCP server for Crystallize headless commerce. Gives AI agents read and write access to your catalogue, products, shapes, orders, customers, and tenant config — with deep links back to the Crystallize UI, dry-run safety for mutations, and PII masking for customer data.

Works with Claude Code, Claude Desktop, Cursor, Windsurf, Copilot, and any MCP-compatible client.

Getting started

Setup wizard

The interactive wizard handles config, auth tokens, keychain storage, and PII mode in one step:

bash
# Project-level — writes .mcp.json in the current directory (shared with your team)npx @hayodev/crystallize-mcp --setup
# Global — registers via `claude mcp add` (Claude Code) or writes Claude Desktop confignpx @hayodev/crystallize-mcp --setup --global

Manual config

Standard MCP config (works in any client):

json
{  "mcpServers": {    "crystallize": {      "command": "npx",      "args": ["-y", "@hayodev/crystallize-mcp@latest"],      "env": {        "CRYSTALLIZE_TENANT_IDENTIFIER": "your-tenant"      }    }  }}

Add CRYSTALLIZE_ACCESS_TOKEN_ID and CRYSTALLIZE_ACCESS_TOKEN_SECRET to the env block for PIM tools (shapes, orders, customers). See Authentication.

Claude Code (CLI)
bash
claude mcp add crystallize \  -e CRYSTALLIZE_TENANT_IDENTIFIER=your-tenant \  -e CRYSTALLIZE_ACCESS_TOKEN_ID=your-token-id \  -e CRYSTALLIZE_ACCESS_TOKEN_SECRET=your-token-secret \  -- npx -y @hayodev/crystallize-mcp@latest

Use --scope project to write to .mcp.json (shared with your team) or --scope user for personal use across all projects.

Claude Desktop

Add the standard config to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

Cursor

Add the standard config to your Cursor MCP settings (~/.cursor/mcp.json or the project-level .cursor/mcp.json).

VS Code / GitHub Copilot

Add the standard config to .vscode/mcp.json in your project root.

json
{  "servers": {    "crystallize": {      "command": "npx",      "args": ["-y", "@hayodev/crystallize-mcp@latest"],      "env": {        "CRYSTALLIZE_TENANT_IDENTIFIER": "your-tenant",        "CRYSTALLIZE_ACCESS_TOKEN_ID": "your-token-id",        "CRYSTALLIZE_ACCESS_TOKEN_SECRET": "your-token-secret"      }    }  }}
Windsurf

Add the standard config to ~/.codeium/windsurf/mcp_config.json.

Gemini CLI

Add the standard config to ~/.gemini/settings.json.

JetBrains AI Assistant

Add the standard config to .junie/mcp.json in your project root.

Warp

Add the standard config to ~/.warp/mcp.json.

Raycast

Open "Install MCP Server" in Raycast and fill in:

  • Command: npx
  • Arguments: -y @hayodev/crystallize-mcp@latest
  • Environment: add CRYSTALLIZE_TENANT_IDENTIFIER and your token vars

Or copy the standard config JSON above before opening the command — Raycast will auto-fill the form.

From source (maintainers)

The --local flag is for developing crystallize-mcp itself. It writes .mcp.json pointing to the local build output — run this from the repo root only:

bash
git clone https://github.com/HayoDev/crystallize-mcp.gitcd crystallize-mcpnpm install && npm run buildnpx . --setup --local   # writes .mcp.json pointing to ./build/

Or point your MCP client directly at the built entry point:

json
{  "mcpServers": {    "crystallize": {      "command": "node",      "args": ["/path/to/crystallize-mcp/build/src/bin/crystallize-mcp.js"],      "env": {        "CRYSTALLIZE_TENANT_IDENTIFIER": "your-tenant"      }    }  }}

Tools (16)

Catalogue (4 tools)

ToolDescription
browse_catalogueTraverse the item tree by path
get_itemFetch an item by path or ID with full component data
search_catalogueKeyword search across all items
get_product_variantsList variants with pricing and stock

Discovery (3 tools)

ToolDescription
list_discovery_shapesList all shapes with their queryable fields
browse_shapeBrowse items of a shape with filters, pagination, and field selection
get_shape_fieldsDetailed field info for a specific shape

Shapes & Tenant (3 tools, requires auth)

ToolDescription
list_shapesAll shapes with component summaries
get_shapeFull component definition for a shape
get_tenant_infoTenant configuration and available languages

Orders (2 tools, requires auth)

ToolDescription
list_ordersList orders for a customer with pagination
get_orderFull order details — cart, payments, customer, totals

Customers (2 tools, requires auth)

ToolDescription
list_customersSearch and list customers with pagination
get_customerFull customer profile — addresses, meta, external references

Content (2 tools, requires auth + write mode)

ToolDescription
create_itemCreate a new item (product, document, or folder) with components
update_componentUpdate a single component value — supports nested content chunks via dot notation (e.g. hero.title)

Write tools

Write tools require CRYSTALLIZE_ACCESS_MODE=write (or admin) and a token with write permissions.

Dry-run mode

Set CRYSTALLIZE_DRY_RUN=true to preview mutations without executing them. The response shows exactly what would change — the mutation payload, before/after values, and a deep link to the item:

json
"env": {  "CRYSTALLIZE_ACCESS_MODE": "write",  "CRYSTALLIZE_DRY_RUN": "true"}

Example prompts

Create an item:

"Create a new blog post under /blog using the article shape with title 'Getting Started'"

Update a top-level component:

"Find the item at /products/summer-collection and update its description to 'New summer arrivals'"

Update a component inside a content chunk:

"Get the item at /articles/my-post, then update hero.title to 'Updated Headline' and give me the deep link to review the draft"

Update with change summary:

"Get the item at /articles/guides/my-guide, update its title component to 'New Guide Title', give me the deep link, and show a table of which fields in the chunk changed vs remained unchanged with before/after values"

The agent will update the target component in draft only, preserve all sibling components in the chunk, and return a summary like:

ComponentStatusBeforeAfter
title✏️ UpdatedOld Guide TitleNew Guide Title
imageUnchanged(existing image)(existing image)
descriptionUnchanged(existing text)(existing text)

No publishing happens — you review the change in the Crystallize UI via the deep link and publish when ready.

Authentication

Catalogue and Discovery tools work without auth — just set CRYSTALLIZE_TENANT_IDENTIFIER.

For PIM tools (shapes, tenant info, orders, customers), create an access token at: https://app.crystallize.com/{tenant}/en/settings/access-tokens

Note: Crystallize tokens inherit permissions from the user who created them. To restrict an agent to read-only access, generate the token under a user with a read-only role. See Crystallize Roles.

Environment variables

VariableRequiredDescription
CRYSTALLIZE_TENANT_IDENTIFIERYesYour tenant identifier from app.crystallize.com/{tenant}
CRYSTALLIZE_ACCESS_TOKEN_IDNoAccess token ID for PIM API
CRYSTALLIZE_ACCESS_TOKEN_SECRETNoAccess token secret (paired with token ID)
CRYSTALLIZE_STATIC_AUTH_TOKENNoStatic auth token (alternative to ID/secret pair)
CRYSTALLIZE_ACCESS_MODENoread (default), write, or admin — controls which tools are registered
CRYSTALLIZE_DRY_RUNNotrue to preview write operations without executing — see Write tools
CRYSTALLIZE_PII_MODENofull (default), masked, or none — controls PII in customer/order responses
CRYSTALLIZE_AUDIT_LOGNoPath to write an audit log — ~ is expanded (e.g. ~/.crystallize-mcp/audit.log)

PII mode (opt-in)

By default all customer and order data is returned as-is (full). Set CRYSTALLIZE_PII_MODE to opt in to data minimisation:

ModeBehaviour
fullDefault — all fields returned unchanged
maskedEmails → h***@example.com, phones → ***-1234, addresses → city + country only
noneContact/PII fields stripped — names, emails, phones, addresses, meta, and external references removed. Non-contact data (order lines, payment types, totals) may still be present.

Applies to list_customers, get_customer, list_orders, and get_order. No effect on catalogue or shape tools.

Relevant for teams handling real customer data, GDPR Article 25 compliance (data minimisation by design), or environments where the AI doesn't need raw contact details to do its job. A common pattern is masked on production and full on dev.

Audit log (opt-in)

Set CRYSTALLIZE_AUDIT_LOG to an absolute file path to enable structured logging of every tool call:

json
{  "ts": "2026-04-03T14:38:41Z",  "tool": "list_customers",  "params": { "first": 10 },  "result": "ok",  "tenant": "my-store"}

One JSON line per call — timestamp, tool name, params, result (ok/error), and tenant. Write tools also log mutation metadata (before/after state) for audit trails.

Note: Params are logged as-is and may contain PII — for example, a searchTerm of [email protected] or a customerIdentifier. Treat the audit log file as sensitive data and restrict access accordingly. Param scrubbing is on the roadmap but not yet implemented.

Easy to pipe into log aggregators (Datadog, CloudWatch, Splunk) — but ensure your pipeline handles the file with appropriate access controls.

Keychain storage (optional)

The setup wizard (npx @hayodev/crystallize-mcp --setup) can store tokens in the OS keychain (macOS Keychain, Windows Credential Manager, or libsecret on Linux) so they never appear as plain text in config files. The MCP server resolves credentials from the keychain automatically at startup — no extra configuration needed.

This is useful when:

  • Your .mcp.json is committed to git — keychain keeps tokens out of the repository
  • You prefer not to have secrets in plain text config files — the config only needs CRYSTALLIZE_TENANT_IDENTIFIER

When using --setup --global with Claude Code, this applies only if keychain storage is available and you opt into it: in that case, the wizard runs claude mcp add with only the non-secret env vars, and tokens are read from the keychain at runtime so they do not appear in Claude Code config. If keychain storage is unavailable or you choose not to use it, the wizard passes token env vars to claude mcp add, and Claude Code may store them in plain text.

Access mode

CRYSTALLIZE_ACCESS_MODE controls which tools the MCP server registers at startup:

  • read (default) — read-only tools only
  • write — includes content creation and component updates (with dry-run support)
  • admin — full access including shape modifications and tenant config

Deep links

Every response includes clickable links to the Crystallize UI:

  • Items → app.crystallize.com/@{tenant}/{language}/catalogue/{type}/{itemId}
  • Shapes → app.crystallize.com/@{tenant}/{language}/settings/shapes/{identifier}
  • Orders → app.crystallize.com/@{tenant}/{language}/orders/{orderId}

The language segment is automatically set from the tenant's default language, bootstrapped at server startup — no configuration needed. Tools that accept a language parameter (catalogue, search) use the requested language in both the API call and the generated link.

Development

bash
npm installnpm run buildnpm run dev          # build + startnpm run lint         # oxlintnpm run format       # oxlint --fix + oxfmtnpm run typecheck    # tsc --noEmitnpm run test         # build + node --test

License

MIT

来源:README.md,提交 68282f3

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分