@paretools/make 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dave London
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.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { registerAllTools } from "./tools/index.js";
5
+ const server = new McpServer({ name: "@paretools/make", version: "0.7.0" }, {
6
+ instructions: "Structured Make/Just task runner operations (run, list). Auto-detects make vs just. Returns typed JSON. Use instead of running make/just in the terminal.",
7
+ });
8
+ registerAllTools(server);
9
+ const transport = new StdioServerTransport();
10
+ await server.connect(transport);
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7C;IACE,YAAY,EACV,2JAA2J;CAC9J,CACF,CAAC;AAEF,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAEzB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { MakeRunResult, MakeListResult } from "../schemas/index.js";
2
+ /** Formats structured run results into a human-readable output summary. */
3
+ export declare function formatRun(data: MakeRunResult): string;
4
+ /** Formats structured list results into a human-readable target listing. */
5
+ export declare function formatList(data: MakeListResult): string;
6
+ /** Compact run: target, exitCode, success, duration. Drop stdout/stderr. */
7
+ export interface MakeRunCompact {
8
+ [key: string]: unknown;
9
+ target: string;
10
+ success: boolean;
11
+ exitCode: number;
12
+ duration: number;
13
+ tool: "make" | "just";
14
+ }
15
+ export declare function compactRunMap(data: MakeRunResult): MakeRunCompact;
16
+ export declare function formatRunCompact(data: MakeRunCompact): string;
17
+ /** Compact list: total and tool. Drop individual target details. */
18
+ export interface MakeListCompact {
19
+ [key: string]: unknown;
20
+ total: number;
21
+ tool: "make" | "just";
22
+ }
23
+ export declare function compactListMap(data: MakeListResult): MakeListCompact;
24
+ export declare function formatListCompact(data: MakeListCompact): string;
25
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIzE,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAUrD;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CASvD;AAID,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,cAAc,CAQjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAG7D;AAED,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,eAAe,CAKpE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAG/D"}
@@ -0,0 +1,53 @@
1
+ // ── Full formatters ──────────────────────────────────────────────────
2
+ /** Formats structured run results into a human-readable output summary. */
3
+ export function formatRun(data) {
4
+ const lines = [];
5
+ if (data.success) {
6
+ lines.push(`${data.tool} ${data.target}: success (${data.duration}ms).`);
7
+ }
8
+ else {
9
+ lines.push(`${data.tool} ${data.target}: exit code ${data.exitCode} (${data.duration}ms).`);
10
+ }
11
+ if (data.stdout)
12
+ lines.push(data.stdout);
13
+ if (data.stderr)
14
+ lines.push(data.stderr);
15
+ return lines.join("\n");
16
+ }
17
+ /** Formats structured list results into a human-readable target listing. */
18
+ export function formatList(data) {
19
+ if (data.total === 0)
20
+ return `${data.tool}: no targets found.`;
21
+ const lines = [`${data.tool}: ${data.total} targets`];
22
+ for (const t of data.targets) {
23
+ const desc = t.description ? ` # ${t.description}` : "";
24
+ lines.push(` ${t.name}${desc}`);
25
+ }
26
+ return lines.join("\n");
27
+ }
28
+ export function compactRunMap(data) {
29
+ return {
30
+ target: data.target,
31
+ success: data.success,
32
+ exitCode: data.exitCode,
33
+ duration: data.duration,
34
+ tool: data.tool,
35
+ };
36
+ }
37
+ export function formatRunCompact(data) {
38
+ if (data.success)
39
+ return `${data.tool} ${data.target}: success (${data.duration}ms).`;
40
+ return `${data.tool} ${data.target}: exit code ${data.exitCode} (${data.duration}ms).`;
41
+ }
42
+ export function compactListMap(data) {
43
+ return {
44
+ total: data.total,
45
+ tool: data.tool,
46
+ };
47
+ }
48
+ export function formatListCompact(data) {
49
+ if (data.total === 0)
50
+ return `${data.tool}: no targets found.`;
51
+ return `${data.tool}: ${data.total} targets`;
52
+ }
53
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAEA,wEAAwE;AAExE,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,IAAmB;IAC3C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,cAAc,IAAI,CAAC,QAAQ,MAAM,CAAC,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I,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAoB;IACnD,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,cAAc,IAAI,CAAC,QAAQ,MAAM,CAAC;IACtF,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,eAAe,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,MAAM,CAAC;AACzF,CAAC;AASD,MAAM,UAAU,cAAc,CAAC,IAAoB;IACjD,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACrD,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO,GAAG,IAAI,CAAC,IAAI,qBAAqB,CAAC;IAC/D,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,UAAU,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type RunResult } from "@paretools/shared";
2
+ export type MakeTool = "make" | "just";
3
+ /**
4
+ * Auto-detects the task runner to use based on the presence of task files.
5
+ * Checks for Justfile/justfile first (use `just`), then falls back to `make`.
6
+ */
7
+ export declare function detectTool(cwd: string): MakeTool;
8
+ /**
9
+ * Resolves the tool to use: if "auto", detect from the filesystem; otherwise use the specified tool.
10
+ */
11
+ export declare function resolveTool(tool: "auto" | "make" | "just", cwd: string): MakeTool;
12
+ /** Runs a `make` command with the given arguments. */
13
+ export declare function makeCmd(args: string[], cwd?: string): Promise<RunResult>;
14
+ /** Runs a `just` command with the given arguments. */
15
+ export declare function justCmd(args: string[], cwd?: string): Promise<RunResult>;
16
+ //# sourceMappingURL=make-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-runner.d.ts","sourceRoot":"","sources":["../../src/lib/make-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAKhD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAGjF;AAED,sDAAsD;AACtD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAE9E;AAED,sDAAsD;AACtD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAE9E"}
@@ -0,0 +1,30 @@
1
+ import { run } from "@paretools/shared";
2
+ import { existsSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ /**
5
+ * Auto-detects the task runner to use based on the presence of task files.
6
+ * Checks for Justfile/justfile first (use `just`), then falls back to `make`.
7
+ */
8
+ export function detectTool(cwd) {
9
+ if (existsSync(join(cwd, "Justfile")) || existsSync(join(cwd, "justfile"))) {
10
+ return "just";
11
+ }
12
+ return "make";
13
+ }
14
+ /**
15
+ * Resolves the tool to use: if "auto", detect from the filesystem; otherwise use the specified tool.
16
+ */
17
+ export function resolveTool(tool, cwd) {
18
+ if (tool === "auto")
19
+ return detectTool(cwd);
20
+ return tool;
21
+ }
22
+ /** Runs a `make` command with the given arguments. */
23
+ export async function makeCmd(args, cwd) {
24
+ return run("make", args, { cwd, timeout: 300_000 });
25
+ }
26
+ /** Runs a `just` command with the given arguments. */
27
+ export async function justCmd(args, cwd) {
28
+ return run("just", args, { cwd, timeout: 300_000 });
29
+ }
30
+ //# sourceMappingURL=make-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-runner.js","sourceRoot":"","sources":["../../src/lib/make-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAkB,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QAC3E,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAA8B,EAAE,GAAW;IACrE,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAc,EAAE,GAAY;IACxD,OAAO,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAc,EAAE,GAAY;IACxD,OAAO,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { MakeRunResult, MakeListResult } from "../schemas/index.js";
2
+ import type { MakeTool } from "./make-runner.js";
3
+ /**
4
+ * Parses the output of a `make` or `just` run into structured result data.
5
+ */
6
+ export declare function parseRunOutput(target: string, stdout: string, stderr: string, exitCode: number, duration: number, tool: MakeTool): MakeRunResult;
7
+ /**
8
+ * Parses `just --list` output into structured target data.
9
+ *
10
+ * Expected format:
11
+ * ```
12
+ * Available recipes:
13
+ * build # Build the project
14
+ * test # Run tests
15
+ * clean
16
+ * ```
17
+ */
18
+ export declare function parseJustList(stdout: string): {
19
+ targets: {
20
+ name: string;
21
+ description?: string;
22
+ }[];
23
+ total: number;
24
+ };
25
+ /**
26
+ * Parses `make -pRrq` database output to extract user-defined target names.
27
+ *
28
+ * The make database output contains lines like:
29
+ * ```
30
+ * target-name: dependency1 dependency2
31
+ * # Not a target
32
+ * .PHONY: ...
33
+ * ```
34
+ *
35
+ * We extract lines matching `^[a-zA-Z0-9_-]+:` that are not built-in targets
36
+ * (starting with `.`) and not comments.
37
+ */
38
+ export declare function parseMakeTargets(stdout: string): {
39
+ targets: {
40
+ name: string;
41
+ }[];
42
+ total: number;
43
+ };
44
+ /**
45
+ * Builds a full MakeListResult from parsed target data and the detected tool.
46
+ */
47
+ export declare function buildListResult(parsed: {
48
+ targets: {
49
+ name: string;
50
+ description?: string;
51
+ }[];
52
+ total: number;
53
+ }, tool: MakeTool): MakeListResult;
54
+ //# sourceMappingURL=parsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../src/lib/parsers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,GACb,aAAa,CAUf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG;IAC7C,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClD,KAAK,EAAE,MAAM,CAAC;CACf,CAiBA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAyB/F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC5E,IAAI,EAAE,QAAQ,GACb,cAAc,CAMhB"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Parses the output of a `make` or `just` run into structured result data.
3
+ */
4
+ export function parseRunOutput(target, stdout, stderr, exitCode, duration, tool) {
5
+ return {
6
+ target,
7
+ success: exitCode === 0,
8
+ exitCode,
9
+ stdout: stdout.trimEnd() || undefined,
10
+ stderr: stderr.trimEnd() || undefined,
11
+ duration,
12
+ tool,
13
+ };
14
+ }
15
+ /**
16
+ * Parses `just --list` output into structured target data.
17
+ *
18
+ * Expected format:
19
+ * ```
20
+ * Available recipes:
21
+ * build # Build the project
22
+ * test # Run tests
23
+ * clean
24
+ * ```
25
+ */
26
+ export function parseJustList(stdout) {
27
+ const targets = [];
28
+ for (const line of stdout.split("\n")) {
29
+ const trimmed = line.trim();
30
+ if (!trimmed || trimmed.startsWith("Available"))
31
+ continue;
32
+ const match = trimmed.match(/^(\S+)\s*(?:#\s*(.+))?$/);
33
+ if (match) {
34
+ targets.push({
35
+ name: match[1],
36
+ description: match[2]?.trim() || undefined,
37
+ });
38
+ }
39
+ }
40
+ return { targets, total: targets.length };
41
+ }
42
+ /**
43
+ * Parses `make -pRrq` database output to extract user-defined target names.
44
+ *
45
+ * The make database output contains lines like:
46
+ * ```
47
+ * target-name: dependency1 dependency2
48
+ * # Not a target
49
+ * .PHONY: ...
50
+ * ```
51
+ *
52
+ * We extract lines matching `^[a-zA-Z0-9_-]+:` that are not built-in targets
53
+ * (starting with `.`) and not comments.
54
+ */
55
+ export function parseMakeTargets(stdout) {
56
+ const targets = [];
57
+ const seen = new Set();
58
+ // The make -pRrq output includes a "# Files" section followed by rules.
59
+ // Target lines appear as: "targetname: deps" or "targetname:"
60
+ const targetRe = /^([a-zA-Z0-9_][a-zA-Z0-9_.\-/]*):/;
61
+ for (const line of stdout.split("\n")) {
62
+ // Skip comments and empty lines
63
+ if (line.startsWith("#") || line.startsWith("\t") || !line.trim())
64
+ continue;
65
+ const match = line.match(targetRe);
66
+ if (match) {
67
+ const name = match[1];
68
+ // Skip built-in/special targets (start with .) and Makefile itself
69
+ if (name.startsWith(".") || name === "Makefile" || name === "makefile")
70
+ continue;
71
+ if (!seen.has(name)) {
72
+ seen.add(name);
73
+ targets.push({ name });
74
+ }
75
+ }
76
+ }
77
+ return { targets, total: targets.length };
78
+ }
79
+ /**
80
+ * Builds a full MakeListResult from parsed target data and the detected tool.
81
+ */
82
+ export function buildListResult(parsed, tool) {
83
+ return {
84
+ targets: parsed.targets,
85
+ total: parsed.total,
86
+ tool,
87
+ };
88
+ }
89
+ //# sourceMappingURL=parsers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/lib/parsers.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,MAAc,EACd,MAAc,EACd,QAAgB,EAChB,QAAgB,EAChB,IAAc;IAEd,OAAO;QACL,MAAM;QACN,OAAO,EAAE,QAAQ,KAAK,CAAC;QACvB,QAAQ;QACR,MAAM,EAAE,M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CAAC,IAAI,EAAE;YAAE,SAAS;QAE5E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,mEAAmE;YACnE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU;gBAAE,SAAS;YACjF,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,MAA4E,EAC5E,IAAc;IAEd,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI;KACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ /** Zod schema for structured make/just run output with stdout, stderr, exit code, and duration. */
3
+ export declare const MakeRunResultSchema: z.ZodObject<{
4
+ target: z.ZodString;
5
+ success: z.ZodBoolean;
6
+ exitCode: z.ZodNumber;
7
+ stdout: z.ZodOptional<z.ZodString>;
8
+ stderr: z.ZodOptional<z.ZodString>;
9
+ duration: z.ZodNumber;
10
+ tool: z.ZodEnum<{
11
+ make: "make";
12
+ just: "just";
13
+ }>;
14
+ }, z.core.$strip>;
15
+ export type MakeRunResult = z.infer<typeof MakeRunResultSchema>;
16
+ /** Zod schema for a single target entry with name and optional description. */
17
+ export declare const MakeTargetSchema: z.ZodObject<{
18
+ name: z.ZodString;
19
+ description: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ /** Zod schema for structured make/just list output with targets and total count. */
22
+ export declare const MakeListResultSchema: z.ZodObject<{
23
+ targets: z.ZodArray<z.ZodObject<{
24
+ name: z.ZodString;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>>;
27
+ total: z.ZodNumber;
28
+ tool: z.ZodEnum<{
29
+ make: "make";
30
+ just: "just";
31
+ }>;
32
+ }, z.core.$strip>;
33
+ export type MakeListResult = z.infer<typeof MakeListResultSchema>;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mGAAmG;AACnG,eAAO,MAAM,mBAAmB;;;;;;;;;;;iBAQ9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAEH,oFAAoF;AACpF,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAI/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ /** Zod schema for structured make/just run output with stdout, stderr, exit code, and duration. */
3
+ export const MakeRunResultSchema = z.object({
4
+ target: z.string(),
5
+ success: z.boolean(),
6
+ exitCode: z.number(),
7
+ stdout: z.string().optional(),
8
+ stderr: z.string().optional(),
9
+ duration: z.number(),
10
+ tool: z.enum(["make", "just"]),
11
+ });
12
+ /** Zod schema for a single target entry with name and optional description. */
13
+ export const MakeTargetSchema = z.object({
14
+ name: z.string(),
15
+ description: z.string().optional(),
16
+ });
17
+ /** Zod schema for structured make/just list output with targets and total count. */
18
+ export const MakeListResultSchema = z.object({
19
+ targets: z.array(MakeTargetSchema),
20
+ total: z.number(),
21
+ tool: z.enum(["make", "just"]),
22
+ });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC,CAAC;AAIH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerAllTools(server: McpServer): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QAIjD"}
@@ -0,0 +1,11 @@
1
+ import { shouldRegisterTool } from "@paretools/shared";
2
+ import { registerRunTool } from "./run.js";
3
+ import { registerListTool } from "./list.js";
4
+ export function registerAllTools(server) {
5
+ const s = (name) => shouldRegisterTool("make", name);
6
+ if (s("run"))
7
+ registerRunTool(server);
8
+ if (s("list"))
9
+ registerListTool(server);
10
+ }
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,CAAC,KAAK,CAAC;QAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,CAAC,CAAC,MAAM,CAAC;QAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerListTool(server: McpServer): void;
3
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QA0DjD"}
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ import { compactDualOutput, INPUT_LIMITS } from "@paretools/shared";
3
+ import { makeCmd, justCmd, resolveTool } from "../lib/make-runner.js";
4
+ import { parseJustList, parseMakeTargets, buildListResult } from "../lib/parsers.js";
5
+ import { formatList, compactListMap, formatListCompact } from "../lib/formatters.js";
6
+ import { MakeListResultSchema } from "../schemas/index.js";
7
+ export function registerListTool(server) {
8
+ server.registerTool("list", {
9
+ title: "Make/Just List Targets",
10
+ description: "Lists available make or just targets with optional descriptions. Auto-detects make vs just. Use instead of running `make` or `just --list` in the terminal.",
11
+ inputSchema: {
12
+ path: z
13
+ .string()
14
+ .max(INPUT_LIMITS.PATH_MAX)
15
+ .optional()
16
+ .describe("Project root path (default: cwd)"),
17
+ tool: z
18
+ .enum(["auto", "make", "just"])
19
+ .optional()
20
+ .default("auto")
21
+ .describe('Task runner to use: "auto" detects from files, or force "make"/"just"'),
22
+ compact: z
23
+ .boolean()
24
+ .optional()
25
+ .default(true)
26
+ .describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
27
+ },
28
+ outputSchema: MakeListResultSchema,
29
+ }, async ({ path, tool, compact }) => {
30
+ const cwd = path || process.cwd();
31
+ const resolved = resolveTool(tool || "auto", cwd);
32
+ let parsed;
33
+ let rawOutput;
34
+ if (resolved === "just") {
35
+ const result = await justCmd(["--list"], cwd);
36
+ rawOutput = result.stdout.trim();
37
+ parsed = parseJustList(result.stdout);
38
+ }
39
+ else {
40
+ const result = await makeCmd(["-pRrq", ":"], cwd);
41
+ // make -pRrq exits non-zero when the dummy target ":" fails, but still
42
+ // prints the database to stdout. We only care about stdout.
43
+ rawOutput = result.stdout.trim();
44
+ parsed = parseMakeTargets(result.stdout);
45
+ }
46
+ const data = buildListResult(parsed, resolved);
47
+ return compactDualOutput(data, rawOutput, formatList, compactListMap, formatListCompact, compact === false);
48
+ });
49
+ }
50
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,MAAM,CAAC,YAAY,CACjB,MAAM,EACN;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,6JAA6J;QAC/J,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC;iBAC1B,QAAQ,EAAE;iBACV,QAAQ,CAAC,kCAAkC,CAAC;YAC/C,IAAI,EAAE,CAAC;iBACJ,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;iBAC9B,QAAQ,EAAE;iBACV,OAAO,CAAC,MAAM,CAAC;iBACf,QAAQ,CAAC,uEAAuE,CAAC;YACpF,OAAO,EAAE,CAAC;iBACP,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,IAAI,CAAC;iBACb,QAAQ,CACP,kGAAkG,CACnG;SACJ;QACD,YAAY,EAAE,oBAAoB;KACnC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,IAAI,MAAM,EAAE,GAAG,CAAC,CAAC;QAElD,IAAI,MAA4E,CAAC;QACjF,IAAI,SAAiB,CAAC;QAEtB,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9C,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;YAClD,uEAAuE;YACvE,4DAA4D;YAC5D,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC/C,OAAO,iBAAiB,CACtB,IAAI,EACJ,SAAS,EACT,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerRunTool(server: McpServer): void;
3
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/tools/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,QAqEhD"}
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
3
+ import { makeCmd, justCmd, resolveTool } from "../lib/make-runner.js";
4
+ import { parseRunOutput } from "../lib/parsers.js";
5
+ import { formatRun, compactRunMap, formatRunCompact } from "../lib/formatters.js";
6
+ import { MakeRunResultSchema } from "../schemas/index.js";
7
+ export function registerRunTool(server) {
8
+ server.registerTool("run", {
9
+ title: "Make/Just Run",
10
+ description: "Runs a make or just target and returns structured output (stdout, stderr, exit code, duration). Auto-detects make vs just. Use instead of running `make` or `just` in the terminal.",
11
+ inputSchema: {
12
+ target: z.string().max(INPUT_LIMITS.SHORT_STRING_MAX).describe("Target to run"),
13
+ args: z
14
+ .array(z.string().max(INPUT_LIMITS.STRING_MAX))
15
+ .max(INPUT_LIMITS.ARRAY_MAX)
16
+ .optional()
17
+ .default([])
18
+ .describe("Additional arguments to pass to the target"),
19
+ path: z
20
+ .string()
21
+ .max(INPUT_LIMITS.PATH_MAX)
22
+ .optional()
23
+ .describe("Project root path (default: cwd)"),
24
+ tool: z
25
+ .enum(["auto", "make", "just"])
26
+ .optional()
27
+ .default("auto")
28
+ .describe('Task runner to use: "auto" detects from files, or force "make"/"just"'),
29
+ compact: z
30
+ .boolean()
31
+ .optional()
32
+ .default(true)
33
+ .describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
34
+ },
35
+ outputSchema: MakeRunResultSchema,
36
+ }, async ({ target, args, path, tool, compact }) => {
37
+ const cwd = path || process.cwd();
38
+ assertNoFlagInjection(target, "target");
39
+ for (const a of args ?? []) {
40
+ assertNoFlagInjection(a, "args");
41
+ }
42
+ const resolved = resolveTool(tool || "auto", cwd);
43
+ const cmdArgs = [target, ...(args || [])];
44
+ const start = Date.now();
45
+ const result = resolved === "just" ? await justCmd(cmdArgs, cwd) : await makeCmd(cmdArgs, cwd);
46
+ const duration = Date.now() - start;
47
+ const data = parseRunOutput(target, result.stdout, result.stderr, result.exitCode, duration, resolved);
48
+ const rawOutput = (result.stdout + "\n" + result.stderr).trim();
49
+ return compactDualOutput(data, rawOutput, formatRun, compactRunMap, formatRunCompact, compact === false);
50
+ });
51
+ }
52
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/tools/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,YAAY,CACjB,KAAK,EACL;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,qLAAqL;QACvL,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;YAC/E,IAAI,EAAE,CAAC;iBACJ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;iBAC9C,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC;iBAC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CAAC,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAClF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QAEpC,MAAM,IAAI,GAAG,cAAc,CACzB,MAAM,EACN,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,QAAQ,EACf,QAAQ,EACR,QAAQ,CACT,CAAC;QACF,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAChE,OAAO,iBAAiB,CACtB,IAAI,EACJ,SAAS,EACT,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@paretools/make",
3
+ "version": "0.7.0",
4
+ "mcpName": "io.github.Dave-London/make",
5
+ "description": "MCP server for Make/Just task runners with structured, token-efficient output",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "mcp",
9
+ "mcp-server",
10
+ "model-context-protocol",
11
+ "structured-output",
12
+ "ai",
13
+ "ai-agent",
14
+ "claude",
15
+ "cursor",
16
+ "copilot",
17
+ "token-efficient",
18
+ "devtools",
19
+ "cli",
20
+ "make",
21
+ "makefile",
22
+ "just",
23
+ "justfile",
24
+ "task-runner"
25
+ ],
26
+ "homepage": "https://github.com/Dave-London/Pare/tree/main/packages/server-make",
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
30
+ "type": "module",
31
+ "bin": {
32
+ "pare-make": "./dist/index.js"
33
+ },
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.js"
38
+ }
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/Dave-London/Pare.git",
46
+ "directory": "packages/server-make"
47
+ },
48
+ "files": [
49
+ "dist"
50
+ ],
51
+ "dependencies": {
52
+ "@modelcontextprotocol/sdk": "^1.26.0",
53
+ "zod": "^4.3.6",
54
+ "@paretools/shared": "0.6.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^25.2.3",
58
+ "typescript": "^5.7.0",
59
+ "vitest": "^4.0.18",
60
+ "@paretools/tsconfig": "0.0.0"
61
+ },
62
+ "scripts": {
63
+ "build": "tsc",
64
+ "test": "vitest run",
65
+ "test:watch": "vitest",
66
+ "lint": "eslint src/"
67
+ }
68
+ }