@decantr/mcp-server 1.0.0-beta.6 → 1.0.0-beta.8
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/LICENSE +21 -0
- package/dist/bin.js +1 -1
- package/dist/{chunk-IWYOFW2H.js → chunk-NZBC33FN.js} +58 -0
- package/dist/index.js +1 -1
- package/package.json +10 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Decantr AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/bin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-NZBC33FN.js";
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
8
|
|
|
9
9
|
// src/tools.ts
|
|
10
|
+
import { existsSync, readFileSync } from "fs";
|
|
10
11
|
import { readFile as readFile2 } from "fs/promises";
|
|
11
12
|
import { join as join2, dirname as dirname2 } from "path";
|
|
12
13
|
import { validateEssence, evaluateGuard, isV3 as isV32 } from "@decantr/essence-spec";
|
|
@@ -381,6 +382,20 @@ var TOOLS = [
|
|
|
381
382
|
required: ["operation", "payload"]
|
|
382
383
|
},
|
|
383
384
|
annotations: WRITE_TOOL
|
|
385
|
+
},
|
|
386
|
+
// 13. decantr_get_section_context — local read
|
|
387
|
+
{
|
|
388
|
+
name: "decantr_get_section_context",
|
|
389
|
+
title: "Get Section Context",
|
|
390
|
+
description: "Get the self-contained context for a specific section of the project. Returns guard rules, theme tokens, decorators, pattern specs, zone context, and pages \u2014 everything an AI needs to work on that section.",
|
|
391
|
+
inputSchema: {
|
|
392
|
+
type: "object",
|
|
393
|
+
properties: {
|
|
394
|
+
section_id: { type: "string", description: 'Section ID (archetype ID, e.g., "ai-chatbot", "auth-full", "settings-full")' }
|
|
395
|
+
},
|
|
396
|
+
required: ["section_id"]
|
|
397
|
+
},
|
|
398
|
+
annotations: READ_ONLY
|
|
384
399
|
}
|
|
385
400
|
];
|
|
386
401
|
async function handleTool(name, args) {
|
|
@@ -942,6 +957,49 @@ async function handleTool(name, args) {
|
|
|
942
957
|
return { error: `Failed to update essence: ${e.message}` };
|
|
943
958
|
}
|
|
944
959
|
}
|
|
960
|
+
case "decantr_get_section_context": {
|
|
961
|
+
const err = validateStringArg(args, "section_id");
|
|
962
|
+
if (err) return { error: err };
|
|
963
|
+
const sectionId = args.section_id;
|
|
964
|
+
let essence;
|
|
965
|
+
try {
|
|
966
|
+
const result = await readEssenceFile();
|
|
967
|
+
essence = result.essence;
|
|
968
|
+
} catch {
|
|
969
|
+
return { error: "No valid essence file found. Run decantr init first." };
|
|
970
|
+
}
|
|
971
|
+
if (!isV32(essence)) {
|
|
972
|
+
return { error: "Section context requires a v3 essence file. Run decantr migrate first." };
|
|
973
|
+
}
|
|
974
|
+
const sections = essence.blueprint.sections || [];
|
|
975
|
+
const section = sections.find((s) => s.id === sectionId);
|
|
976
|
+
if (!section) {
|
|
977
|
+
return {
|
|
978
|
+
error: `Section "${sectionId}" not found.`,
|
|
979
|
+
available_sections: sections.map((s) => ({ id: s.id, role: s.role, pages: s.pages.length }))
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
const contextPath = join2(process.cwd(), ".decantr", "context", `section-${sectionId}.md`);
|
|
983
|
+
if (existsSync(contextPath)) {
|
|
984
|
+
return {
|
|
985
|
+
section_id: sectionId,
|
|
986
|
+
role: section.role,
|
|
987
|
+
shell: section.shell,
|
|
988
|
+
features: section.features,
|
|
989
|
+
pages: section.pages.map((p) => ({ id: p.id, route: p.route, layout: p.layout })),
|
|
990
|
+
context: readFileSync(contextPath, "utf-8")
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
section_id: sectionId,
|
|
995
|
+
role: section.role,
|
|
996
|
+
shell: section.shell,
|
|
997
|
+
features: section.features,
|
|
998
|
+
description: section.description,
|
|
999
|
+
pages: section.pages.map((p) => ({ id: p.id, route: p.route, layout: p.layout })),
|
|
1000
|
+
note: "Section context file not found. Run decantr refresh to generate it."
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
945
1003
|
default:
|
|
946
1004
|
return { error: `Unknown tool: ${name}` };
|
|
947
1005
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-NZBC33FN.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decantr/mcp-server",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"description": "MCP server for Decantr — exposes design intelligence tools to AI coding assistants",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -15,18 +15,20 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
18
|
-
"files": [
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
19
21
|
"publishConfig": {
|
|
20
22
|
"access": "public"
|
|
21
23
|
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
26
|
+
"@decantr/essence-spec": "1.0.0-beta.7",
|
|
27
|
+
"@decantr/registry": "1.0.0-beta.7"
|
|
28
|
+
},
|
|
22
29
|
"scripts": {
|
|
23
30
|
"build": "tsup",
|
|
24
31
|
"test": "vitest run",
|
|
25
32
|
"test:watch": "vitest"
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
29
|
-
"@decantr/essence-spec": "workspace:*",
|
|
30
|
-
"@decantr/registry": "workspace:*"
|
|
31
33
|
}
|
|
32
|
-
}
|
|
34
|
+
}
|