@incremental/mcp 0.0.0-stage → 0.1.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
@@ -1,3 +1,44 @@
1
- # Temporary Holding Version
1
+ # Incremental MCP
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The incremental Model Context Protocol (MCP) server (`@incremental/mcp`). It exposes incremental Protocol v1 to MCP clients (AI agents, IDEs, assistants) so they can observe tasks, compute affected plans, and inspect stores without speaking stdio JSON Lines directly.
4
+
5
+ ## Contents
6
+
7
+ | Path | Description |
8
+ | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | `mcp/src/index.ts` | MCP server entry point and binary (`incremental-mcp`). |
10
+ | `mcp/src/server.ts` | MCP server implementation: session handling, capability negotiation. |
11
+ | `mcp/src/tools.ts` | MCP tools wrapping incremental methods (`observe`, `observe_many`, `affected`, `explain`, `stats`, `baseline`, `advance`, `forget`, `ping`, `shutdown`). |
12
+ | `mcp/src/context.ts` | Context handling for MCP tool calls. |
13
+ | `mcp/src/git.ts` | Git integration for change-set computation. |
14
+ | `mcp/tests/` | MCP server tests (`node --test dist/tests/*.test.js`). |
15
+
16
+ ## Running
17
+
18
+ The MCP server depends on `@incremental/client` (`file:../bindings/node`), so build the Node client first:
19
+
20
+ ```sh
21
+ cd bindings/node && npm run build
22
+ cd mcp && npm run build # tsc -b
23
+ cd mcp && npm test # tsc -b && node --test dist/tests/*.test.js
24
+ ```
25
+
26
+ From the repo root:
27
+
28
+ ```sh
29
+ make test-mcp # MCP server tests
30
+ ```
31
+
32
+ ## Protocol
33
+
34
+ `@incremental/mcp` is a thin layer over `@incremental/client`, which speaks incremental Protocol v1 (`hello`, `observe`, `affected`, `explain`, `stats`, ...). See `docs/spec/PROTOCOL.md` and `bindings/README.md`.
35
+
36
+ ## Status
37
+
38
+ MCP verification status is tracked in `status/ADAPTERS.json` (E4 verify: test-vitest passes on macOS V01-V16 end to end; Linux container run failed only from the `.dockerignore` rule, now fixed; rerun pending).
39
+
40
+ ## Related
41
+
42
+ - `bindings/node/` — `@incremental/client`, the TypeScript protocol client this server builds on
43
+ - `docs/spec/PROTOCOL.md` — Protocol v1 methods and errors
44
+ - `docs/adapters/ADAPTERS.md` — MCP mentioned as an adapter surface
@@ -0,0 +1,9 @@
1
+ import type { Context } from "@incremental/client";
2
+ export declare const ABSENT = "absent";
3
+ export declare const RUNNER = "vitest@4.1.12";
4
+ export declare const LOCKFILES: readonly ["pnpm-lock.yaml", "package-lock.json", "yarn.lock"];
5
+ export declare function sha256(data: string | Uint8Array): string;
6
+ export declare function hashRepoFile(root: string, rel: string): string;
7
+ export declare function buildContext(root: string): Context;
8
+ export declare function envHashes(env: NodeJS.ProcessEnv): Record<string, string>;
9
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sources":["../../src/context.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGnD,eAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,eAAO,MAAM,SAAS,YAAI,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,CAAU,CAAC;AAEvF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAExD;AAGD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAI9D;AAID,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWlD;AAGD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxE"}
@@ -0,0 +1,46 @@
1
+ // Context and hashing for affected_tasks (plans/PLAN.md 6.2, 8.4, 11.8).
2
+ // The server sends the same context on every query, so context_missing never
3
+ // fires through MCP. Hashes use the adapter convention "sha256:" + hex.
4
+ import { createHash } from "node:crypto";
5
+ import fs from "node:fs";
6
+ import path from "node:path";
7
+ // Value used for a repo file that does not exist.
8
+ export const ABSENT = "absent";
9
+ // The runner the MCP path records and queries with (PLAN 11.8).
10
+ export const RUNNER = "vitest@4.1.12";
11
+ // Lockfiles in the order the server looks for them (PLAN 6.7 globalInputs).
12
+ export const LOCKFILES = ["pnpm-lock.yaml", "package-lock.json", "yarn.lock"];
13
+ export function sha256(data) {
14
+ return `sha256:${createHash("sha256").update(data).digest("hex")}`;
15
+ }
16
+ // Hash of a repo file, or ABSENT when it does not exist.
17
+ export function hashRepoFile(root, rel) {
18
+ const file = path.join(root, rel);
19
+ if (!fs.existsSync(file))
20
+ return ABSENT;
21
+ return sha256(fs.readFileSync(file));
22
+ }
23
+ // The context of a query at the repo root: lockfile, tsconfig.json and
24
+ // package.json hashes, the fixed runner, the node version, fmt 1 and caps.
25
+ export function buildContext(root) {
26
+ const lockfile = LOCKFILES.find((f) => fs.existsSync(path.join(root, f)));
27
+ return {
28
+ lockfile: lockfile === undefined ? ABSENT : hashRepoFile(root, lockfile),
29
+ tsconfig: hashRepoFile(root, "tsconfig.json"),
30
+ pkgjson: hashRepoFile(root, "package.json"),
31
+ runner: RUNNER,
32
+ node: process.version,
33
+ fmt: 1,
34
+ caps: { probes: true, dirs: true, env: true },
35
+ };
36
+ }
37
+ // The client's environment as a hash map {NAME: value_hash} (POLICY section 1).
38
+ export function envHashes(env) {
39
+ const out = {};
40
+ for (const [name, value] of Object.entries(env)) {
41
+ if (typeof value === "string")
42
+ out[name] = sha256(value);
43
+ }
44
+ return out;
45
+ }
46
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,6EAA6E;AAC7E,wEAAwE;AACxE,OAAO,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AC7C,OAAO,EAAE,YAAY,CAAC,IAAI,EAAE,cAAc,CAAC;QAC3C,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;KAC9C,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,SAAS,CAAC,GAAsB;IAC9C,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAChD,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ChangeSet } from "@incremental/client";
2
+ export declare function defaultGitBinary(env: NodeJS.ProcessEnv): string;
3
+ export declare function changeSet(gitBinary: string, root: string, baseline: string): Promise<ChangeSet>;
4
+ //# sourceMappingURL=git.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.d.ts","sources":["../../src/git.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAU,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAK7D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAE/D;AAID,wBAAsB,SAAS,CAC7B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,CAAC,CAwBpB"}
@@ -0,0 +1,34 @@
1
+ // The git change source (PLAN 11.7, 11.8): runs the incremental-git binary to
2
+ // build the ChangeSet from the stored baseline to the worktree.
3
+ import { execFile } from "node:child_process";
4
+ import path from "node:path";
5
+ import { promisify } from "node:util";
6
+ import { repoRoot } from "@incremental/client";
7
+ const execFileAsync = promisify(execFile);
8
+ // INCREMENTAL_GIT, else <repo>/adapters/git/dist/incremental-git.
9
+ export function defaultGitBinary(env) {
10
+ return env.INCREMENTAL_GIT || path.join(repoRoot(), "adapters", "git", "dist", "incremental-git");
11
+ }
12
+ // The ChangeSet from baseline to the worktree at root. The baseline is the
13
+ // stored one, so the query always matches the store (POLICY P0).
14
+ export async function changeSet(gitBinary, root, baseline) {
15
+ const { stdout } = await execFileAsync(gitBinary, ["changes", "--base", baseline, "--root", root], {
16
+ encoding: "utf8",
17
+ maxBuffer: 64 * 1024 * 1024,
18
+ });
19
+ const parsed = JSON.parse(stdout);
20
+ if (typeof parsed !== "object" ||
21
+ parsed === null ||
22
+ !Array.isArray(parsed.changes)) {
23
+ throw new Error("incremental-git did not print a ChangeSet");
24
+ }
25
+ const raw = parsed.changes;
26
+ const changes = raw.map((c) => {
27
+ const change = { path: String(c.path), status: c.status };
28
+ if (typeof c.old_path === "string")
29
+ change.old_path = c.old_path;
30
+ return change;
31
+ });
32
+ return { baseline, changes };
33
+ }
34
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sources":["../../src/git.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gEAAgE;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,kEAAkE;AAClE,MAAM,UAAU,gBAAgB,CAAC,GAAsB;IACrD,OAAO,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,UAA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MappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,27 @@
1
+ // @incremental/mcp: the MCP server over stdio (bin incremental-mcp).
2
+ import fs from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ import { startServer } from "./server.js";
5
+ export * from "./server.js";
6
+ export * from "./tools.js";
7
+ export * from "./context.js";
8
+ export * from "./git.js";
9
+ // Runs the server when this file is the program (also through the bin link).
10
+ function isEntry() {
11
+ const argv1 = process.argv[1];
12
+ if (argv1 === undefined)
13
+ return false;
14
+ try {
15
+ return fs.realpathSync(argv1) === fs.realpathSync(fileURLToPath(import.meta.url));
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ }
21
+ if (isEntry()) {
22
+ startServer().catch((e) => {
23
+ process.stderr.write(`incremental-mcp: ${e instanceof Error ? e.message : String(e)}\n`);
24
+ process.exit(1);
25
+ });
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAEzB,6EAA6E;AAC7E,SAAS,OAAO;IACd,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,IAAI,OAAO,EAAE,EAAE,CAAC;IACd,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACjC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare const SERVER_NAME = "incremental-mcp";
3
+ export declare const SERVER_VERSION = "0.1.0";
4
+ export interface ServerSettings {
5
+ root: string;
6
+ store: string;
7
+ gitBinary: string;
8
+ env: NodeJS.ProcessEnv;
9
+ }
10
+ export declare function findRoot(start: string): string;
11
+ export declare function resolveSettings(env?: NodeJS.ProcessEnv, cwd?: string): ServerSettings;
12
+ export interface RunningServer {
13
+ server: McpServer;
14
+ shutdown(): Promise<void>;
15
+ }
16
+ export declare function createServer(settings?: ServerSettings): RunningServer;
17
+ export declare function startServer(settings?: ServerSettings): Promise<void>;
18
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sources":["../../src/server.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACxB;AAID,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ9C;AAED,wBAAgB,eAAe,CAC7B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,cAAc,CAQhB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;IAElB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAID,wBAAgB,YAAY,CAAC,QAAQ,GAAE,cAAkC,GAAG,aAAa,CAyBxF;AAGD,wBAAsB,WAAW,CAAC,QAAQ,GAAE,cAAkC,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7F"}
@@ -0,0 +1,81 @@
1
+ // The MCP server (PLAN 11.8): McpServer from the pinned SDK (1.32.0) over the
2
+ // stdio transport. The store and root default as the client does: the store
3
+ // is INCREMENTAL_STORE, else <root>/.incremental; the root is the nearest ancestor
4
+ // of the working directory that holds tsconfig.base.json.
5
+ import fs from "node:fs";
6
+ import path from "node:path";
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
+ import { connect } from "@incremental/client";
10
+ import { defaultGitBinary } from "./git.js";
11
+ import { registerTools } from "./tools.js";
12
+ export const SERVER_NAME = "incremental-mcp";
13
+ export const SERVER_VERSION = "0.1.0";
14
+ // The nearest ancestor of start (or start) that holds tsconfig.base.json.
15
+ // Falls back to start outside a repository.
16
+ export function findRoot(start) {
17
+ let dir = path.resolve(start);
18
+ for (;;) {
19
+ if (fs.existsSync(path.join(dir, "tsconfig.base.json")))
20
+ return dir;
21
+ const up = path.dirname(dir);
22
+ if (up === dir)
23
+ return path.resolve(start);
24
+ dir = up;
25
+ }
26
+ }
27
+ export function resolveSettings(env = process.env, cwd = process.cwd()) {
28
+ const root = findRoot(cwd);
29
+ return {
30
+ root,
31
+ store: path.resolve(env.INCREMENTAL_STORE || path.join(root, ".incremental")),
32
+ gitBinary: defaultGitBinary(env),
33
+ env,
34
+ };
35
+ }
36
+ // Builds the server without connecting a transport. The engine is started on
37
+ // the first tool call, so a missing store is reported by the tool, not at start.
38
+ export function createServer(settings = resolveSettings()) {
39
+ const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION });
40
+ let started = null;
41
+ const client = () => {
42
+ started ??= connect({ store: settings.store, root: settings.root }).catch((e) => {
43
+ started = null;
44
+ throw e;
45
+ });
46
+ return started;
47
+ };
48
+ registerTools(server, {
49
+ client,
50
+ root: settings.root,
51
+ gitBinary: settings.gitBinary,
52
+ env: settings.env,
53
+ });
54
+ return {
55
+ server,
56
+ async shutdown() {
57
+ if (started === null)
58
+ return;
59
+ const c = await started.catch(() => null);
60
+ started = null;
61
+ await c?.close().catch(() => undefined);
62
+ },
63
+ };
64
+ }
65
+ // Serves MCP over stdio until stdin closes.
66
+ export async function startServer(settings = resolveSettings()) {
67
+ const running = createServer(settings);
68
+ let stopping = false;
69
+ const stop = async () => {
70
+ if (stopping)
71
+ return;
72
+ stopping = true;
73
+ await running.shutdown();
74
+ await running.server.close();
75
+ };
76
+ process.stdin.once("end", () => {
77
+ void stop().then(() => process.exit(0));
78
+ });
79
+ await running.server.connect(new StdioServerTransport());
80
+ }
81
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,mFAAmF;AACnF,0DAA0D;AAC1D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2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;QAChB,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC,CAAC;IACF,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;QAC7B,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,65 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
3
+ import { type incremental } from "@incremental/client";
4
+ export declare const TOOL_DESCRIPTIONS: {
5
+ readonly affected_tasks: "Returns the tasks to re-run for the changes in the worktree since the stored baseline, with their reasons and any fallback.";
6
+ readonly record_observation: "Records one observation of a task run with its inputs, context and outcome, and reports whether it was accepted.";
7
+ readonly engine_status: "Returns the task count, observation count, baseline and graph version of the engine store.";
8
+ };
9
+ export interface Runtime {
10
+ client(): Promise<incremental>;
11
+ root: string;
12
+ gitBinary: string;
13
+ env: NodeJS.ProcessEnv;
14
+ }
15
+ export declare const observationShape: {
16
+ task: z.ZodString;
17
+ baseline: z.ZodString;
18
+ dirty: z.ZodBoolean;
19
+ context: z.ZodObject<{
20
+ lockfile: z.ZodString;
21
+ tsconfig: z.ZodString;
22
+ pkgjson: z.ZodString;
23
+ runner: z.ZodString;
24
+ node: z.ZodString;
25
+ fmt: z.ZodNumber;
26
+ caps: z.ZodObject<{
27
+ probes: z.ZodBoolean;
28
+ dirs: z.ZodBoolean;
29
+ env: z.ZodBoolean;
30
+ verify: z.ZodOptional<z.ZodBoolean>;
31
+ }, z.core.$strip>;
32
+ }, z.core.$loose>;
33
+ inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ kind: z.ZodLiteral<"file">;
35
+ path: z.ZodString;
36
+ hash: z.ZodString;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"dir">;
39
+ path: z.ZodString;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ kind: z.ZodLiteral<"probe">;
42
+ path: z.ZodString;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ kind: z.ZodLiteral<"declared">;
45
+ path: z.ZodString;
46
+ hash: z.ZodString;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ kind: z.ZodLiteral<"env">;
49
+ name: z.ZodString;
50
+ value_hash: z.ZodString;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ kind: z.ZodLiteral<"env_all">;
53
+ snapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
54
+ }, z.core.$strip>], "kind">>;
55
+ outputs: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
56
+ outcome: z.ZodEnum<{
57
+ error: "error";
58
+ fail: "fail";
59
+ none: "none";
60
+ pass: "pass";
61
+ }>;
62
+ duration_ms: z.ZodOptional<z.ZodNumber>;
63
+ };
64
+ export declare function registerTools(server: McpServer, rt: Runtime): void;
65
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sources":["../../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,KAAK,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AAK7F,eAAO,MAAM,iBAAiB;aAC5B,cAAc,EACZ,6HAA6H;aAC/H,kBAAkB,EAChB,kHAAkH;aACpH,aAAa,EACX,4FAA4F;CACtF,CAAC;AAIX,MAAM,WAAW,OAAO;IACtB,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACxB;AA2BD,eAAO,MAAM,gBAAgB;IAC3B,IAAI;IACJ,QAAQ;IACR,KAAK;IACL,OAAO;;;;;;;;;;;;;;IACP,MAAM;;;;;;;;;;;;;;;;;;;;;;IACN,OAAO;IACP,OAAO;;;;;;IACP,WAAW;CACZ,CAAC;AAgBF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CA2DlE"}
@@ -0,0 +1,105 @@
1
+ import { z } from "zod";
2
+ import { isIncrementalError } from "@incremental/client";
3
+ import { buildContext, envHashes } from "./context.js";
4
+ import { changeSet } from "./git.js";
5
+ // One sentence each (PLAN 11.8). Checked by the tests.
6
+ export const TOOL_DESCRIPTIONS = {
7
+ affected_tasks: "Returns the tasks to re-run for the changes in the worktree since the stored baseline, with their reasons and any fallback.",
8
+ record_observation: "Records one observation of a task run with its inputs, context and outcome, and reports whether it was accepted.",
9
+ engine_status: "Returns the task count, observation count, baseline and graph version of the engine store.",
10
+ };
11
+ const ContextShape = z.looseObject({
12
+ lockfile: z.string(),
13
+ tsconfig: z.string(),
14
+ pkgjson: z.string(),
15
+ runner: z.string(),
16
+ node: z.string(),
17
+ fmt: z.number().int(),
18
+ caps: z.object({
19
+ probes: z.boolean(),
20
+ dirs: z.boolean(),
21
+ env: z.boolean(),
22
+ verify: z.boolean().optional(),
23
+ }),
24
+ });
25
+ const InputSchema = z.discriminatedUnion("kind", [
26
+ z.object({ kind: z.literal("file"), path: z.string(), hash: z.string() }),
27
+ z.object({ kind: z.literal("dir"), path: z.string() }),
28
+ z.object({ kind: z.literal("probe"), path: z.string() }),
29
+ z.object({ kind: z.literal("declared"), path: z.string(), hash: z.string() }),
30
+ z.object({ kind: z.literal("env"), name: z.string(), value_hash: z.string() }),
31
+ z.object({ kind: z.literal("env_all"), snapshot: z.record(z.string(), z.string()).optional() }),
32
+ ]);
33
+ // The Observation of the client (bindings/node/src/types.ts), as tool input.
34
+ export const observationShape = {
35
+ task: z.string().min(1),
36
+ baseline: z.string().min(1),
37
+ dirty: z.boolean(),
38
+ context: ContextShape,
39
+ inputs: z.array(InputSchema),
40
+ outputs: z.array(z.record(z.string(), z.unknown())),
41
+ outcome: z.enum(["pass", "fail", "error", "none"]),
42
+ duration_ms: z.number().nonnegative().optional(),
43
+ };
44
+ function text(value) {
45
+ return { content: [{ type: "text", text: JSON.stringify(value, null, 2) }] };
46
+ }
47
+ // A tool failure is an MCP tool error result, never a crash of the server.
48
+ function failure(e) {
49
+ const message = isIncrementalError(e)
50
+ ? `${e.code}: ${e.message}`
51
+ : e instanceof Error
52
+ ? e.message
53
+ : String(e);
54
+ return { isError: true, content: [{ type: "text", text: message }] };
55
+ }
56
+ export function registerTools(server, rt) {
57
+ server.registerTool("affected_tasks", {
58
+ description: TOOL_DESCRIPTIONS.affected_tasks,
59
+ inputSchema: { verify: z.boolean().optional() },
60
+ }, async ({ verify }) => {
61
+ try {
62
+ const client = await rt.client();
63
+ const { baseline } = await client.baseline();
64
+ if (baseline === null) {
65
+ return failure(new Error("no baseline is stored; advance the store to a baseline first"));
66
+ }
67
+ const changes = await changeSet(rt.gitBinary, rt.root, baseline);
68
+ const plan = await client.affected(changes, {
69
+ baseline,
70
+ context: buildContext(rt.root),
71
+ verify: verify ?? false,
72
+ env: envHashes(rt.env),
73
+ });
74
+ return text(plan);
75
+ }
76
+ catch (e) {
77
+ return failure(e);
78
+ }
79
+ });
80
+ server.registerTool("record_observation", {
81
+ description: TOOL_DESCRIPTIONS.record_observation,
82
+ inputSchema: observationShape,
83
+ }, async (args) => {
84
+ try {
85
+ const client = await rt.client();
86
+ const obs = args;
87
+ return text(await client.observe(obs));
88
+ }
89
+ catch (e) {
90
+ return failure(e);
91
+ }
92
+ });
93
+ server.registerTool("engine_status", {
94
+ description: TOOL_DESCRIPTIONS.engine_status,
95
+ }, async () => {
96
+ try {
97
+ const client = await rt.client();
98
+ return text(await client.stats());
99
+ }
100
+ catch (e) {
101
+ return failure(e);
102
+ }
103
+ });
104
+ }
105
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sources":["../../src/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAsC,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,cAAc,EACZ,6HAA6H;IAC/H,kBAAkB,EAChB,kHAAkH;IACpH,aAAa,EACX,4FAA4F;CACtF,CAAC;AAWX,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;QACjB,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE;QAChB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/C,CAAC,C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AAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,WAAW,EAAE,iBAAiB,CAAC,aAAa;KAC7C,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@incremental/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "bin": {
8
+ "incremental-mcp": "dist/src/index.js"
9
+ },
10
+ "files": [
11
+ "dist/src",
12
+ "README.md"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/frontal-labs/incremental.git",
17
+ "directory": "mcp"
18
+ },
19
+ "scripts": {
20
+ "build": "tsc-rs -b",
21
+ "test": "tsc-rs -b && node --test dist/tests/*.test.js"
22
+ },
23
+ "license": "Apache-2.0",
24
+ "engines": {
25
+ "node": ">=22.0.0"
26
+ },
27
+ "dependencies": {
28
+ "@incremental/client": "file:../bindings/node",
29
+ "@modelcontextprotocol/sdk": "1.32.2",
30
+ "zod": "4.6.7"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "22.20.5",
34
+ "tsc-rs": "0.8.0"
35
+ }
36
+ }