Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

fix(mcp): ix_map maps the workspace instead of passing a file to ix map

KageBinary5ce416cdfc7d
diff --git a/ix-cli/src/cli/__tests__/mcp.test.ts b/ix-cli/src/cli/__tests__/mcp.test.ts
index d6e132e6..47c2591b 100644
--- a/ix-cli/src/cli/__tests__/mcp.test.ts
+++ b/ix-cli/src/cli/__tests__/mcp.test.ts
@@ -323,16 +323,17 @@ describe("ix mcp", () => {
}]);
});
- it("keeps the existing ix_map file argument contract", async () => {
+ it("maps the workspace, never a file, even when a caller still sends file", async () => {
const calls: string[][] = [];
const client = await connect(async (args) => {
calls.push(args);
return { ok: true, stdout: "{}", stderr: "" };
});
- await client.callTool({ name: "ix_map", arguments: { file: "src/service.ts" } });
+ const result = await client.callTool({ name: "ix_map", arguments: { file: "src/service.ts" } });
- expect(calls).toEqual([["map", "--format=json", "--", "src/service.ts"]]);
+ expect(result.isError).toBeFalsy();
+ expect(calls).toEqual([["map", "--format=json"]]);
});
it("applies ix_smells path and limit compatibility without unsupported CLI flags", async () => {
diff --git a/ix-cli/src/mcp/server.ts b/ix-cli/src/mcp/server.ts
index 87f0dad7..cb92baf9 100644
--- a/ix-cli/src/mcp/server.ts
+++ b/ix-cli/src/mcp/server.ts
@@ -460,12 +460,13 @@ export function createIxMcpServer(options: CreateServerOptions = {}): McpServer
registerTool(
ctx,
"ix_map",
- "Use after editing code, when later answers must see the change. Re-ingests one path, or the whole workspace. Slow; not needed before reading.",
- { file: z.string().min(1).optional() },
- async (input) => {
- const positionals = typeof input.file === "string" ? [input.file] : [];
- return runJson(runIx, "ix_map", ix("map", positionals), 120_000);
- },
+ "Use after editing code, when later answers must see the change. Re-maps the whole workspace; unchanged files are skipped. Slow; not needed before reading.",
+ {},
+ // No path argument. `ix map` takes a workspace root and rejects a file
+ // ("Map path is not a directory"), and a subdirectory would be mapped as a
+ // workspace of its own. The old optional `file` is dropped from the schema,
+ // so a caller that still sends it gets the workspace map.
+ async () => runJson(runIx, "ix_map", ix("map"), 120_000),
);
registerTool(
ctx,