vex
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| VEX_ENV | No | Per-project default Vendure environment name for the MCP server (for example, "myproject-staging"). | |
| VEX_TOOLS | No | Set to "lean" (alias "minimal") to register only the universal interface: vex_setup, vex_current_env, vex_refetch_schema, vex_query, vex_mutate, and vex_schema. The default (unset or "full") registers all 15 tools. | full |
| VEX_PRETTY_JSON | No | Set to "1" to pretty-print MCP responses. Responses are compact JSON by default. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
vex exposes the Vendure Admin GraphQL API as MCP tools, including custom plugin extensions.
No interactive authentication or login flow is required — vex authenticates to Vendure via the API key stored in the active environment (sent as the vendure-api-key header on every request). If a tool returns an auth error, the key is missing, wrong, or revoked; ask the user to update it via vex_setup rather than initiating a login.
If vex_setup action="show" reports no active env, ask the user for URL + API key and add one. The cached schema lives at the resource vendure://schema/<envName>; call vex_refetch_schema if stale.
Action-dispatch tools
Most tools take an action parameter that selects the operation; each tool's description lists its valid actions and the fields each one needs. Set action first, then supply only that action's fields. Example: vex_customers {action:"list", filterByEmail:"…"} or vex_products {action:"get", id:"…"}.
Choosing the environment
Most tools accept an optional env param to target a specific environment for that call; without it, vex uses VEX_ENV, then a project link matching the server's working directory, then the active environment. (vex_setup edits config directly, and vex_refetch_schema takes an explicit environment name.) Call vex_current_env to see which environment is currently in use.
Choosing the right tool
Pick the highest-level tool that matches the user's request:
Typed entity tools (
vex_customers,vex_products,vex_orders,vex_zones,vex_tax,vex_channels,vex_assets) are the preferred path for standard Vendure entities. They validate input with Zod and return shaped JSON.vex_assetsuploads local files as assets (actionuploadwithfilePaths).Schema discovery (
vex_schemawith actionlist_operations,describe_operation,describe_type,list_custom_fields, orlist_permissions) — use to discover what's available before falling back to raw GraphQL. This lists operations on the schema; don't confuse it withvex_operations(replayable queries the user has saved).Raw GraphQL (
vex_query,vex_mutate) — escape hatch for custom plugin operations or anything the typed tools don't cover. Read the schema resource or usevex_schemafirst so the document is correct.vex_mutateaccepts afilesmap (dotted variable path → local file path) for Upload-scalar mutations.
Reusable queries
Fragments (
vex_fragmentswith actionlist/get/save/delete) are reusable selection sets on a specific type. Reach for them when you keep rewriting the same field list.Saved operations (
vex_operationswith actionlist/get/run/delete) are full queries or mutations persisted with their default variables.action:"run"re-executes one with optionalvariableOverrides(shallow-merge into defaults) orreplaceVariables(full replacement). Save operations the user is likely to repeat.
Lean mode
When started with the env var VEX_TOOLS=lean, only the universal interface is
exposed (vex_setup, vex_current_env, vex_refetch_schema, vex_query,
vex_mutate, vex_schema). Drive everything via vex_schema discovery plus
raw vex_query/vex_mutate.
Permission errors
A FORBIDDEN/UNAUTHORIZED failure means the API key's role lacks a permission. The error names the operation and suggests likely Permission values; verify with vex_schema action "list_permissions" and tell the user which permission to assign to the key's role in the Vendure admin UI.
Vendure quick reference
Mutations often return unions (Entity | ErrorResult) — branch on the response and surface errorCode/message from the error branch. List queries take ListOptions { take, skip, filter, sort }; default to small take (~10). Filter values use real JSON types (true not "true", 10 not "10"). Never echo full API keys back to the user.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| vex_setupC | Manage Vendure API environments: add, remove, list, switch, show, or set (update). |
| vex_current_envA | Show which Vendure environment vex is using and why (env param > VEX_ENV > project link > active). Returns {name, host, source, projectPath?} or a none-configured notice. |
| vex_refetch_schemaA | Re-fetch and cache the GraphQL schema for a Vendure environment. Uses introspection or the configured schema source. |
| vex_queryC | Execute a raw GraphQL query. |
| vex_mutateB | Execute a raw GraphQL mutation. Supports Upload-scalar file uploads via |
| vex_schemaA | Discover the Vendure Admin GraphQL schema (types, operations, custom fields). Actions:
|
| vex_customersB | Manage Vendure customers. Actions:
|
| vex_productsB | Manage Vendure products and their variants. Actions:
|
| vex_ordersB | Manage Vendure orders and draft orders. Actions:
|
| vex_zonesB | Manage Vendure zones and their country/region members. Actions:
|
| vex_taxB | Manage Vendure tax categories and tax rates. Actions:
|
| vex_channelsB | Manage Vendure channels. Actions:
|
| vex_assetsA | Manage Vendure assets (images/files), incl. multipart upload of local files. Actions:
|
| vex_fragmentsA | Manage reusable GraphQL fragments (named selection sets). Actions:
|
| vex_operationsA | Manage saved (replayable) GraphQL operations: queries or mutations persisted with default variables. (Distinct from vex_schema's list_operations, which lists schema-defined operations.) Actions:
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Tools are cleanly partitioned by domain (customers, products, orders, zones, tax, channels, assets, fragments, operations) with distinct CRUD-style actions inside each. Minor overlaps exist between vex_setup's 'show' action and vex_current_env, and separately the description of vex_operations explicitly disambiguates itself from vex_schema's list_operations — showing the authors know these boundaries need clarifying. vex_refetch_schema vs vex_schema is also close but distinguishable (cache refresh vs schema discovery).
Every tool uses a consistent vex_ prefix and snake_case, with actions also in snake_case (list_categories, create_rate, add_members). The only pattern deviation is verb-first names for action tools (vex_query, vex_mutate, vex_refetch_schema) versus plural-noun names for resource tools (vex_customers, vex_products), but this maps sensibly to the tool type rather than being arbitrary.
15 tools sits at the top of the comfortable range but each maps to a genuine Vendure admin domain, so none feel gratuitous. Because each tool bundles many actions, the effective operation count is far higher, which is a reasonable trade-off for keeping the top-level tool list scannable.
The surface covers core commerce entities (customers, products, orders, zones, tax, channels, assets) plus an escape hatch via vex_query/vex_mutate and schema introspection for anything uncovered. Notable gaps remain — promotions, shipping methods, collections/facets, and admin/role management have no dedicated tools — but agents can work around these with raw GraphQL.