Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Releases 1.17.0–1.24.0 are described only in their
Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); the
project follows semantic versioning at the extension level.

## [1.30.1] - 2026-10-12
## [1.30.1] - 2026-10-13

Extension `1.30.1` / mcp-server `1.30.1` — Codex setup docs and three fixes.

Expand Down Expand Up @@ -38,6 +38,11 @@ Extension `1.30.1` / mcp-server `1.30.1` — Codex setup docs and three fixes.
release and `mcpName` matches `server.json`.

### Fixed
- **`validate_syntax` warned "unknown method" on valid code**
([#17](https://github.com/asbis/ShapeItUp/pull/17)): `Math.cos(…)`, finder
filters in callbacks such as `(e) => e.inDirection("Y")`, and array/string
methods like `pts.map(…)`. Typos such as `.extrdue(` and `Math.cso(` are
still flagged.
- **Three of the skill's seven worked examples were wrong**, so every agent
that loaded the skill was taught from them. The L-bracket's holes missed the
part, the flanged bottle failed to render (an all-edges fillet straight
Expand Down Expand Up @@ -86,6 +91,24 @@ Extension `1.30.1` / mcp-server `1.30.1` — Codex setup docs and three fixes.
- Source maps are no longer published (1.3 MB gzipped).
- CI now runs the `@shapeitup/shared` tests, and checks that the npm tarball
carries `manifold.wasm` and no source maps.
- **The tool list costs ~45% fewer tokens: 49 KB → 27 KB, about 12k → 7k.**
Codex, Cursor and Mistral Vibe put it in context at the start of every
session, whether or not it does any CAD. Each tool and parameter
description now says what it does, when to use it, and its defaults;
history, internals and the same path-resolution paragraph repeated twelve
times are gone. A test keeps `tools/list` under 30,000 characters.
- **Descriptions that were wrong:** `render_preview`'s `cameraAngle` and
`grid` promised a multi-angle collage, but every render is the 4-pane view;
`export_shape`'s `openIn` said it needed VS Code (it doesn't);
`preview_shape` claimed its `inline` default matched `render_preview`'s (it's
the opposite); `check_collisions` pointed at an API reference category that
doesn't exist.
- **No description is clipped any more.** Three were longer than the
sanitizer's 1,000-character limit and lost their endings for every client,
`run_simulation`'s MuJoCo paragraph among them. A test now fails if one is.
- **README: "Fewer tools, fewer tokens".** How to switch off the 14 tools
most sessions never call (~2.8k tokens) with `disabled_tools` in Mistral
Vibe and Codex, and in Cursor's settings.
- **The skill costs ~2,000 fewer tokens each time it loads** (16.2k → 14.2k),
per [#13](https://github.com/asbis/ShapeItUp/issues/13), thanks
@martinrieder. `SKILL.md` no longer carries:
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,38 @@ The one-click buttons and the plain MCP configs above don't include the skill th
npx skills add asbis/ShapeItUp
```

### Fewer tools, fewer tokens

Codex, Cursor and Mistral Vibe put every tool's description in context at the start of each session, whether or not it does any CAD: about 7k tokens for all 29. (Claude Code loads MCP tools on demand.) If you don't use some tools, switch them off. These 14 are the ones most sessions never call, and dropping them saves about 2.8k tokens:

**Mistral Vibe:** at the top of `~/.vibe/config.toml`, above any `[[mcp_servers]]` table, since TOML would otherwise read the key as part of that table. Vibe names MCP tools `<server>_<tool>`.

```toml
disabled_tools = [
"shapeitup_run_simulation", "shapeitup_sweep_check", "shapeitup_check_stack",
"shapeitup_validate_joints", "shapeitup_preview_finder", "shapeitup_describe_geometry",
"shapeitup_open_shape", "shapeitup_get_render_status", "shapeitup_clear_params",
"shapeitup_delete_shape", "shapeitup_setup_shape_project", "shapeitup_list_installed_apps",
"shapeitup_set_render_mode", "shapeitup_toggle_dimensions",
]
```

Use `disabled_tools`, not `enabled_tools`: Vibe's list applies to all of its tools, so an allow-list of ShapeItUp tools would switch off everything else.

**Codex:** in the server's own table, with the plain tool names:

```toml
[mcp_servers.shapeitup]
# command, args and timeouts as above
disabled_tools = [
"run_simulation", "sweep_check", "check_stack", "validate_joints", "preview_finder",
"describe_geometry", "open_shape", "get_render_status", "clear_params", "delete_shape",
"setup_shape_project", "list_installed_apps", "set_render_mode", "toggle_dimensions",
]
```

**Cursor:** click a tool's name under Settings → MCP to switch it off. There's no config-file setting for it yet, and the toggles have been reported to reset after a restart.

Node 20+ required. No native build step; everything ships as WASM.

## What you get
Expand Down
2 changes: 2 additions & 0 deletions packages/mcp-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Keep `startup_timeout_sec`. Vibe's default is 10 s, and the first run of `npx` d

For the Replicad API reference, save [`SKILL.md`](https://github.com/asbis/ShapeItUp/blob/master/skills/shapeitup/SKILL.md) as `~/.vibe/skills/shapeitup/SKILL.md`. Vibe loads it as-is, and it also becomes the `/shapeitup` command. With the VS Code extension installed, **ShapeItUp: Install MCP Server… → Add to Mistral Vibe** does both steps after you confirm.

Codex, Cursor and Vibe load every tool description at the start of each session (~7k tokens for all 29). To switch off the ones you don't use, see [Fewer tools, fewer tokens](https://github.com/asbis/ShapeItUp#fewer-tools-fewer-tokens).

Node 20+ required. Works in Docker / CI (WASM, no native deps).

## What's in the box
Expand Down
45 changes: 45 additions & 0 deletions packages/mcp-server/src/schema-sanitizer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,48 @@ describe("tools/list emission is Gemini-safe", () => {
}
});
});

// ---------------------------------------------------------------------------
// Context budget. Claude Code loads MCP tools on demand, but Codex, Cursor
// and Mistral Vibe put the whole tools/list in context at the start of every
// session, whether or not it does any CAD. It was ~49 KB (~12k tokens) before
// the descriptions were cut to what an agent needs to pick a tool and fill
// its arguments; detail lives in get_api_reference and the skill instead.
// ---------------------------------------------------------------------------
describe("tools/list context budget", () => {
async function listTools(): Promise<any[]> {
const { McpServer } = await import("@modelcontextprotocol/sdk/server/mcp.js");
const { registerTools } = await import("./tools.js");
const server = new McpServer({ name: "test", version: "0.0.0" });
registerTools(server);
const handler = (server as any).server._requestHandlers.get("tools/list");
const response = await handler(
{ method: "tools/list", params: {} },
{ signal: new AbortController().signal, sendRequest: async () => ({}), sendNotification: async () => {}, requestId: 1 },
);
return response.tools;
}

it("stays under 30,000 characters (~7.5k tokens) in total", async () => {
const size = JSON.stringify(await listTools()).length;
expect(size).toBeLessThan(30_000);
});

it("never needs the sanitizer to clip a description", async () => {
// The sanitizer cuts anything over 1000 chars to 999 + "…". That cut is
// silent, and it once dropped run_simulation's MuJoCo paragraph for every
// client, so a description that long is a bug in the description.
const clipped: string[] = [];
const walk = (node: unknown, path: string): void => {
if (Array.isArray(node)) return node.forEach((n, i) => walk(n, `${path}[${i}]`));
if (typeof node !== "object" || node === null) return;
const { description } = node as { description?: unknown };
if (typeof description === "string" && description.length >= 1000 && description.endsWith("\u2026")) {
clipped.push(path);
}
for (const [k, v] of Object.entries(node)) walk(v, `${path}.${k}`);
};
for (const tool of await listTools()) walk(tool, tool.name);
expect(clipped).toEqual([]);
});
});
Loading
Loading