@decantr/mcp-server 2.4.0 → 3.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,12 +8,12 @@
8
8
  Support status: `core-supported`
9
9
  Release channel: `stable`
10
10
 
11
- Design intelligence for AI-generated UI. Make Claude, Cursor, and Windsurf generate better code.
11
+ AI Frontend Governance for codebases touched by AI agents. Give Claude, Cursor, Windsurf, VS Code, Zed, and Continue a typed Contract, scoped Context, and repairable Evidence instead of a giant rule dump.
12
12
 
13
13
  ![Decantr MCP demo](https://raw.githubusercontent.com/decantr-ai/decantr/main/packages/mcp-server/assets/decantr-demo.gif)
14
14
 
15
- - **Structured design context** -- gives your AI assistant patterns, layouts, component specs, Brownfield/Hybrid authority, local law, and task-time context instead of letting it guess
16
- - **Evidence-backed repair loops** -- gives AI agents Project Health, Evidence Bundles, workspace health, and scoped repair prompts without uploading source
15
+ - **Structured Contract context** -- gives your AI assistant patterns, layouts, component specs, typed graph context, Brownfield/Hybrid authority, local law, and task-time context instead of letting it guess
16
+ - **Evidence-backed repair loops** -- gives AI agents Project Health, component reuse drift, accepted style bridge drift, stable diagnostic codes, typed repair IDs, graph-anchored Evidence Bundles, workspace health, and scoped repair prompts without uploading source
17
17
  - **Drift detection** -- catches when generated code deviates from your design intent
18
18
  - **Zero config** -- run with `npx`, no API keys or accounts required
19
19
 
@@ -122,25 +122,32 @@ MCP tools are only available in Continue.dev agent mode.
122
122
 
123
123
  ## Key Tools
124
124
 
125
- The server exposes Decantr registry, context, benchmark, and verification tools. Highlights:
125
+ The server exposes Decantr vocabulary, context, benchmark, and verification tools. Highlights:
126
126
 
127
127
  | Tool | Description | Example Input |
128
128
  |------|-------------|---------------|
129
129
  | `decantr_create_essence` | Generate an Essence spec skeleton from a project description | `{ "description": "SaaS dashboard with analytics and billing", "framework": "react" }` |
130
130
  | `decantr_read_essence` | Read the current `decantr.essence.json` from the working directory | `{}` or `{ "path": "./custom.essence.json" }` |
131
131
  | `decantr_validate` | Validate an Essence file against the schema and guard rules | `{ "path": "./decantr.essence.json" }` |
132
- | `decantr_search_registry` | Search the community registry for patterns, archetypes, themes, and shells | `{ "query": "kanban", "type": "pattern" }` |
132
+ | `decantr_search_registry` | Search official/community vocabulary for patterns, archetypes, themes, and shells | `{ "query": "kanban", "type": "pattern" }` |
133
133
  | `decantr_resolve_pattern` | Get full pattern details: layout spec, components, presets, code examples | `{ "id": "data-table", "preset": "product" }` |
134
134
  | `decantr_resolve_archetype` | Get archetype details: default pages, layouts, features, suggested theme | `{ "id": "saas-dashboard" }` |
135
135
  | `decantr_resolve_blueprint` | Get a full app composition with page structure and personality traits | `{ "id": "ecommerce" }` |
136
136
  | `decantr_suggest_patterns` | Given a page description plus optional route/source excerpt, get ranked pattern suggestions | `{ "description": "recipe feed with avatars and infinite scroll", "route": "/feed" }` |
137
137
  | `decantr_check_drift` | Check if generated code violates the design intent in the Essence spec | `{ "page_id": "overview", "components_used": ["Card", "LineChart"], "theme_used": "auradecantism" }` |
138
138
  | `decantr_get_execution_pack` | Read compiled scaffold, section, page, review, or mutation execution packs, with hosted fallback when local context is missing | `{ "pack_type": "page", "id": "overview", "format": "json" }` |
139
- | `decantr_prepare_task_context` | Resolve compact route/task context, authority lane, local law, evidence, and changed-file impact before editing a Brownfield, Hybrid, or Essence route | `{ "route": "/feed", "task": "improve recipe card loading" }` |
139
+ | `decantr_get_project_state` | Read a compact typed summary of Essence, generated packs, graph artifacts, capsule source-handle bounds, source artifacts available for file impact, local snapshot history, typed diff counts, local law, style bridge, stable diagnostic catalog, and recommended next tools | `{ "project_path": "apps/web" }` |
140
+ | `decantr_prepare_task_context` | Resolve compact route/task context, task-ranked typed route graph, optional graph-shaped changed-file impact, authority lane, local law, style bridge mappings, and evidence before editing a Brownfield, Hybrid, or Essence route | `{ "project_path": "apps/web", "route": "/feed", "task": "improve recipe card loading" }` |
141
+ | `decantr_get_contract_capsule` | Read the cache-friendly Contract capsule generated by `decantr graph`, including bounded SourceArtifact paths that can be reused as `file_path` handles | `{ "project_path": "apps/web" }` |
142
+ | `decantr_get_graph_snapshot` | Read graph metadata with snapshot-history status and typed diff counts, a compact local history index, a route-scoped graph subgraph, node or source-file impact context, task-aware ranked context, a specific history snapshot, or a typed diff between local snapshots | `{ "project_path": "apps/web", "file_path": "src/app/page.tsx", "task": "edit source" }` |
143
+ | `decantr_query_graph` | Query current or historical graph nodes, source files, payload fields, relations, and optional node-impact context without reading the full snapshot | `{ "project_path": "apps/web", "snapshot_id": "current", "file_path": "src/app/page.tsx", "include_impact": true }` |
144
+ | `decantr_traverse_graph` | Traverse the current or historical typed graph from one or more node IDs or a source file by relation, direction, and depth | `{ "project_path": "apps/web", "snapshot_id": "current", "file_path": "src/app/page.tsx", "direction": "in", "relations": ["NODE_DERIVED_FROM_SOURCE"] }` |
140
145
  | `decantr_compile_execution_packs` | Compile a hosted execution-pack bundle from a local or inline essence document | `{ "path": "./decantr.essence.json", "namespace": "@official" }` |
141
146
  | `decantr_audit_project` | Run the schema-backed Decantr project audit against essence and compiled packs, with hosted fallback when local pack artifacts are missing | `{ "namespace": "@official" }` |
142
147
  | `decantr_critique` | Critique a file against the compiled review contract, with hosted fallback when local review packs are missing | `{ "file_path": "./src/pages/Overview.tsx", "namespace": "@official" }` |
143
- | `decantr_get_evidence_bundle` | Generate the local privacy-redacted Evidence Bundle for a project | `{ "project_path": "apps/web" }` |
148
+ | `decantr_get_findings` | Return typed Project Health findings with stable codes, repair IDs, graph anchors, and optional repair prompts | `{ "project_path": "apps/web", "code": "TOKEN010" }` |
149
+ | `decantr_get_repair_plan` | Return a structured repair plan for a finding with repair ID, graph anchor, optional impact context, action payload, evidence, read targets, constraints, and rerun commands | `{ "project_path": "apps/web", "code": "TOKEN010" }` |
150
+ | `decantr_get_evidence_bundle` | Generate the local privacy-redacted Evidence Bundle for a project, including graph anchors and graph artifact provenance when `.decantr/graph` exists | `{ "project_path": "apps/web" }` |
144
151
  | `decantr_workspace_health` | Discover Decantr projects and return aggregate workspace health | `{ "workspace_root": ".", "max_projects": 100 }` |
145
152
  | `decantr_get_repair_prompt` | Return the scoped repair prompt for a health finding | `{ "finding_id": "assertion-contract-context-pack-manifest" }` |
146
153
  | `decantr_run_health_loop` | Run health, evidence, and next repair prompt in one local agent loop | `{ "project_path": "apps/web" }` |
@@ -150,7 +157,7 @@ For the broader product surface and support policy, see the root Decantr docs an
150
157
 
151
158
  ## Security And Permissions
152
159
 
153
- The MCP server reads Decantr files and selected project files from the active workspace. Write access is limited to explicit write tools such as `decantr_update_essence` and `decantr_accept_drift`, and paths are contained to the active workspace root.
160
+ The MCP server reads Decantr files, including `.decantr/graph` typed graph artifacts, and selected project files from the active workspace. Write access is limited to explicit write tools such as `decantr_update_essence` and `decantr_accept_drift`, and paths are contained to the active workspace root.
154
161
 
155
162
  Registry and pack-resolution tools may call the configured Decantr API. Source upload fallbacks for hosted critique/audit are disabled unless the tool call explicitly passes `allow_hosted_upload: true`. The MCP server does not emit Decantr telemetry. See [security permissions](https://decantr.ai/reference/security-permissions.md).
156
163
 
@@ -177,13 +184,19 @@ The AI assistant calls these tools behind the scenes:
177
184
  3. `decantr_suggest_patterns` -- recommends `kpi-grid`, `chart-grid`, `data-table`, and `form-sections` for the described pages
178
185
  4. `decantr_resolve_pattern` -- fetches layout specs and component lists for each pattern
179
186
  5. `decantr_get_execution_pack` -- loads the compiled scaffold/page/review packs as the task contract, falling back to hosted compilation when local pack artifacts are missing
180
- 6. `decantr_prepare_task_context` -- resolves route-local Brownfield/Hybrid context, active authority, accepted local law, changed-file impact, visual evidence, and theme inventory before editing an existing app
181
- 7. `decantr_compile_execution_packs` -- compiles the hosted pack bundle when the task needs a fresh remote contract from the essence document
182
- 8. `decantr_check_drift` -- validates the generated code against the Essence spec before presenting it
183
- 9. `decantr_critique` -- critiques a specific file, falling back to the hosted verifier when the local review pack is missing
184
- 10. `decantr_audit_project` -- runs the stronger project-level audit once the implementation is in place
185
- 11. `decantr_get_evidence_bundle` -- returns the local evidence bundle for the AI repair loop
186
- 12. `decantr_get_repair_prompt` -- gives the assistant exact finding evidence, constraints to preserve, and commands to rerun
187
+ 6. `decantr_get_project_state` -- checks Essence, packs, graph readiness, capsule source-handle bounds, source artifacts available for file impact, local snapshot history, typed diff counts, local law, stable diagnostic codes, and the next useful tool calls
188
+ 7. `decantr_prepare_task_context` -- resolves route-local Brownfield/Hybrid context, task-ranked typed route graph context, graph-shaped changed-file impact when changed files resolve to SourceArtifact nodes, active authority, accepted local law, accepted style bridge mappings, visual evidence, and theme inventory before editing an existing app
189
+ 8. `decantr_get_contract_capsule` -- loads the compact Contract graph capsule, including the bounded SourceArtifact path index, when `.decantr/graph` exists
190
+ 9. `decantr_get_graph_snapshot` -- reads graph metadata, snapshot-history status, optional compact history, typed diff counts, route-scoped graph nodes/edges with optional task-aware ranking, impact graph nodes/edges through `node_id` or `file_path`, specific history snapshots through `snapshot_id`, and local snapshot diffs through `compare_to`
191
+ 10. `decantr_query_graph` and `decantr_traverse_graph` -- answer typed follow-up questions against current or historical snapshots, such as which pages use a route, component, token, source file, rule, or diagnostic code; `decantr_query_graph` can include an impact subgraph for matched node IDs or a `file_path` SourceArtifact so agents can inspect blast radius before changing a component, token, rule, finding, or source artifact, and `decantr_traverse_graph` can resolve `file_path` into the SourceArtifact start node for relation walks
192
+ 11. `decantr_compile_execution_packs` -- compiles the hosted pack bundle when the task needs a fresh remote contract from the essence document
193
+ 12. `decantr_check_drift` -- validates the generated code against the Essence spec before presenting it
194
+ 13. `decantr_critique` -- critiques a specific file, falling back to the hosted verifier when the local review pack is missing
195
+ 14. `decantr_audit_project` -- runs the stronger project-level audit once the implementation is in place
196
+ 15. `decantr_get_findings` -- returns compact typed findings with diagnostic codes, repair IDs, and optional prompts
197
+ 16. `decantr_get_repair_plan` -- returns typed repair actions, graph anchors, optional graph impact context, evidence, read targets, preserve/avoid constraints, and rerun commands
198
+ 17. `decantr_get_evidence_bundle` -- returns the local evidence bundle, graph anchors, and graph artifact provenance for the AI repair loop
199
+ 18. `decantr_get_repair_prompt` -- gives the assistant exact finding evidence, constraints to preserve, and commands to rerun
187
200
 
188
201
  The AI now generates code with the right layout structure, correct components, and consistent styling, then gets a scoped evidence-backed repair loop instead of a generic guess.
189
202
 
package/dist/bin.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-P2K3R43N.js";
2
+ import "./chunk-IB5HP7DE.js";