@decantr/mcp-server 3.6.2 → 3.7.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
@@ -12,7 +12,7 @@ AI Frontend Governance for codebases touched by AI agents. Give Claude, Cursor,
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 Contract context** -- gives your AI assistant patterns, layouts, component specs, typed graph context, Brownfield/Hybrid authority, local law, behavior obligations, and task-time context instead of letting it guess
15
+ - **Structured Contract context** -- gives your AI assistant patterns, layouts, component specs, shared Brownfield discovery metadata, typed graph context, Brownfield/Hybrid authority, local law, behavior obligations, and task-time context instead of letting it guess
16
16
  - **Evidence-backed repair loops** -- gives AI agents Project Health, component reuse drift, accepted behavior-obligation 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
@@ -138,12 +138,12 @@ The server exposes a hard 8-tool MCP surface. Pass an `action` to select the rou
138
138
 
139
139
  | Tool | Description | Example Input |
140
140
  |------|-------------|---------------|
141
- | `decantr_project` | Read local project state and workspace health | `{ "action": "state", "project_path": "apps/web" }` |
141
+ | `decantr_project` | Read local project state, shared discovery summary, and workspace health | `{ "action": "state", "project_path": "apps/web" }` |
142
142
  | `decantr_contract` | Read Essence, validate, check drift, generate a skeleton, or read the Contract capsule | `{ "action": "validate", "path": "./decantr.essence.json" }` |
143
- | `decantr_context` | Read scaffold, section, page, task, and execution-pack context | `{ "action": "task", "project_path": "apps/web", "route": "/feed", "task": "improve recipe card loading" }` |
143
+ | `decantr_context` | Read scaffold, section, page, task, shared discovery summary, and execution-pack context | `{ "action": "task", "project_path": "apps/web", "route": "/feed", "task": "improve recipe card loading" }` |
144
144
  | `decantr_graph` | Read graph snapshots, query graph nodes/edges, or traverse graph relations | `{ "action": "query", "project_path": "apps/web", "file_path": "src/app/page.tsx", "include_impact": true }` |
145
145
  | `decantr_registry` | Search and resolve hosted registry content, benchmarks, and execution packs | `{ "action": "resolve_pattern", "id": "data-table", "preset": "product" }` |
146
- | `decantr_verify` | Run audit, critique, findings, v2 evidence bundles, or health-loop reads | `{ "action": "evidence_bundle", "project_path": "apps/web" }` |
146
+ | `decantr_verify` | Run audit, critique, findings, v2 evidence bundles with discovery metadata, or health-loop reads | `{ "action": "evidence_bundle", "project_path": "apps/web" }` |
147
147
  | `decantr_repair` | Return typed findings, repair plans, repair prompts, and v2 health-loop guidance | `{ "action": "health_loop", "project_path": "apps/web" }` |
148
148
  | `decantr_contract_write` | Explicit write surface for accepting drift, deferring drift to the drift log, or mutating Essence v4 | `{ "action": "update_essence", "operation": "add_feature", "payload": { "feature": "billing" } }` |
149
149
 
@@ -167,7 +167,7 @@ Registry and pack-resolution tools may call the configured Decantr API. Source u
167
167
 
168
168
  ### 3.4 Tool Surface Migration
169
169
 
170
- Decantr 3.4 consolidated legacy MCP tool names into the eight action-based tools above. Decantr 3.6 keeps that surface, preserves v2 task/evidence/workspace-health/health-loop contracts, and adds compatible metadata only through the consolidated tools. For example, `decantr_get_project_state` becomes `decantr_project` with `{ "action": "state" }`, `decantr_get_graph_snapshot` becomes `decantr_graph` with `{ "action": "snapshot" }`, and the legacy write tools become `decantr_contract_write` with `{ "action": "accept_drift" }` or `{ "action": "update_essence" }`.
170
+ Decantr 3.4 consolidated legacy MCP tool names into the eight action-based tools above. Decantr 3.7 keeps that surface, preserves v2 task/evidence/workspace-health/health-loop contracts, and adds compatible discovery metadata only through the consolidated tools. For example, `decantr_get_project_state` becomes `decantr_project` with `{ "action": "state" }`, `decantr_get_graph_snapshot` becomes `decantr_graph` with `{ "action": "snapshot" }`, and the legacy write tools become `decantr_contract_write` with `{ "action": "accept_drift" }` or `{ "action": "update_essence" }`.
171
171
 
172
172
  ## How It Works
173
173
 
package/dist/bin.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-XCTAGWHI.js";
2
+ import "./chunk-S3XFNHZ5.js";
@@ -35,6 +35,7 @@ import {
35
35
  createEvidenceTier,
36
36
  createLoopReadiness,
37
37
  deriveVerificationDiagnostic,
38
+ discoverProject,
38
39
  KNOWN_VERIFICATION_DIAGNOSTICS,
39
40
  LOOP_READINESS_V2_SCHEMA_URL,
40
41
  PROJECT_HEALTH_REPORT_V2_SCHEMA_URL,
@@ -234,6 +235,65 @@ function displayProjectFile(projectRoot, path) {
234
235
  if (isAbsolute2(path)) return displayWorkspacePath(path);
235
236
  return displayWorkspacePath(join2(projectRoot, path));
236
237
  }
238
+ function mcpDiscoverySummary(projectRoot) {
239
+ const discovery = discoverProject(projectRoot);
240
+ return {
241
+ schema_version: "discovery.v1",
242
+ project_path: discovery.workspace.projectPath,
243
+ workspace_scope: discovery.workspace.scope,
244
+ project: {
245
+ framework: discovery.project.framework,
246
+ framework_version: discovery.project.frameworkVersion,
247
+ package_manager: discovery.project.packageManager,
248
+ primary_language: discovery.project.primaryLanguage,
249
+ has_typescript: discovery.project.hasTypeScript,
250
+ has_tailwind: discovery.project.hasTailwind,
251
+ has_decantr: discovery.project.hasDecantr,
252
+ package_name: discovery.project.packageName,
253
+ evidence: discovery.project.evidence
254
+ },
255
+ routes: {
256
+ strategy: discovery.routes.strategy,
257
+ route_signal_count: discovery.routes.routeSignalCount,
258
+ taskable_route_count: discovery.routes.taskableRouteCount,
259
+ confidence: discovery.routes.confidence,
260
+ taskable_routes: discovery.routes.taskableRoutes.slice(0, 20).map((route) => ({
261
+ path: route.path,
262
+ file: route.file,
263
+ source: route.source,
264
+ confidence: route.confidence
265
+ })),
266
+ signals: discovery.routes.routeSignals.slice(0, 20).map((signal) => ({
267
+ path: signal.path,
268
+ file: signal.file,
269
+ kind: signal.kind,
270
+ taskable: signal.taskable,
271
+ confidence: signal.confidence
272
+ }))
273
+ },
274
+ components: {
275
+ component_count: discovery.components.componentCount,
276
+ page_count: discovery.components.pageCount,
277
+ confidence: discovery.components.confidence,
278
+ directories: discovery.components.directories,
279
+ evidence: discovery.components.evidence,
280
+ limitations: discovery.components.limitations
281
+ },
282
+ styling: {
283
+ approach: discovery.styling.approach,
284
+ config_file: discovery.styling.configFile,
285
+ css_variable_count: discovery.styling.cssVariableCount,
286
+ color_token_count: discovery.styling.colorTokenCount,
287
+ dark_mode: discovery.styling.darkMode,
288
+ theme_signals: discovery.styling.themeSignals
289
+ },
290
+ assistant: {
291
+ rule_files: discovery.assistant.ruleFiles
292
+ },
293
+ confidence: discovery.confidence,
294
+ limitations: discovery.limitations
295
+ };
296
+ }
237
297
  function graphAvailableRoutes(snapshot) {
238
298
  return snapshot.nodes.filter((node) => node.type === "Route").map((node) => graphPayloadString(node.payload, "path") ?? node.id.replace(/^rt:/, "")).sort();
239
299
  }
@@ -2292,7 +2352,7 @@ async function handleLegacyTool(name, args) {
2292
2352
  if (args.components_used && Array.isArray(args.components_used) && args.page_id && typeof args.page_id === "string") {
2293
2353
  const pages = listEssencePages(essence);
2294
2354
  const page = pages.find((p) => p.id === args.page_id);
2295
- if (page && page.layout) {
2355
+ if (page?.layout) {
2296
2356
  const expectedPatterns = /* @__PURE__ */ new Set();
2297
2357
  for (const item of page.layout) {
2298
2358
  if (typeof item === "string") {
@@ -2621,6 +2681,7 @@ async function handleLegacyTool(name, args) {
2621
2681
  return {
2622
2682
  source: "local_workspace",
2623
2683
  project_root: displayWorkspacePath(projectRoot),
2684
+ discovery: mcpDiscoverySummary(projectRoot),
2624
2685
  essence: essence ? {
2625
2686
  present: true,
2626
2687
  version: typeof essence.version === "string" ? essence.version : null,
@@ -3651,6 +3712,7 @@ async function handleLegacyTool(name, args) {
3651
3712
  verifyCommand
3652
3713
  };
3653
3714
  return {
3715
+ discovery: mcpDiscoverySummary(projectRoot),
3654
3716
  route: resolvedRoute,
3655
3717
  page_id: pageId,
3656
3718
  section_id: section.id,
@@ -4072,7 +4134,10 @@ async function handleLegacyTool(name, args) {
4072
4134
  try {
4073
4135
  const projectRoot = resolveMcpProjectRoot(args.project_path);
4074
4136
  const state = await getMcpHealthState(projectRoot);
4075
- return state.evidence;
4137
+ return {
4138
+ ...state.evidence,
4139
+ discovery: mcpDiscoverySummary(projectRoot)
4140
+ };
4076
4141
  } catch (error) {
4077
4142
  return { error: error.message };
4078
4143
  }
@@ -4111,6 +4176,7 @@ async function handleLegacyTool(name, args) {
4111
4176
  }
4112
4177
  return {
4113
4178
  project: state.evidence.project,
4179
+ discovery: mcpDiscoverySummary(projectRoot),
4114
4180
  health: state.evidence.health,
4115
4181
  finding: {
4116
4182
  id: finding.id,
@@ -4329,7 +4395,7 @@ function describeUpdate(operation, payload) {
4329
4395
  }
4330
4396
 
4331
4397
  // src/index.ts
4332
- var VERSION = "3.6.2";
4398
+ var VERSION = "3.7.0";
4333
4399
  var server = new Server({ name: "decantr", version: VERSION }, { capabilities: { tools: {} } });
4334
4400
  server.setRequestHandler(ListToolsRequestSchema, async () => {
4335
4401
  return { tools: TOOLS };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import "./chunk-XCTAGWHI.js";
1
+ import "./chunk-S3XFNHZ5.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decantr/mcp-server",
3
- "version": "3.6.2",
3
+ "version": "3.7.0",
4
4
  "mcpName": "io.github.decantr-ai/mcp-server",
5
5
  "description": "MCP server for Decantr — exposes Contract context, typed graph artifacts, and verification evidence to AI coding assistants",
6
6
  "keywords": [
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@modelcontextprotocol/sdk": "^1.29.0",
54
- "@decantr/core": "3.6.0",
55
- "@decantr/verifier": "3.6.1",
56
54
  "@decantr/essence-spec": "3.4.0",
57
- "@decantr/registry": "3.4.0"
55
+ "@decantr/core": "3.6.0",
56
+ "@decantr/registry": "3.4.0",
57
+ "@decantr/verifier": "3.7.0"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsup",