Skip to content
Closed
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
20 changes: 2 additions & 18 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"name": "Asbjorn Rorvik",
"email": "rorvik.asbjorn@gmail.com"
},
"homepage": "https://github.com/asbis/ShapeItUp",
"homepage": "https://shapeitup.dev",
"repository": "https://github.com/asbis/ShapeItUp",
"license": "MIT",
"keywords": [
Expand All @@ -31,23 +31,7 @@
"mechanical-engineering"
],
"category": "productivity",
"source": {
"source": "github",
"repo": "asbis/ShapeItUp"
},
"strict": false,
"skills": [
"./skills"
],
"mcpServers": {
"shapeitup": {
"command": "npx",
"args": [
"-y",
"@shapeitup/mcp-server"
]
}
}
"source": "./"
}
]
}
36 changes: 36 additions & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "shapeitup",
"displayName": "ShapeItUp",
"version": "1.30.1",
"description": "Scripted CAD for AI agents: write parametric parts in TypeScript, check them with 4-view renders, collision and joint checks, and export STEP/STL/3MF. OpenCascade runs as WASM, so there is nothing to install beyond Node.",
"author": {
"name": "Asbjorn Rorvik",
"email": "rorvik.asbjorn@gmail.com",
"url": "https://github.com/asbis"
},
"homepage": "https://shapeitup.dev",
"repository": "https://github.com/asbis/ShapeItUp",
"license": "MIT",
"keywords": [
"cad",
"text-to-cad",
"3d",
"3d-printing",
"replicad",
"opencascade",
"step",
"stl",
"3mf",
"parametric",
"mechanical-engineering"
],
"icon": "./icon.png",
"documentationUrl": "https://github.com/asbis/ShapeItUp#readme",
"supportUrl": "https://github.com/asbis/ShapeItUp/issues",
"mcpServers": {
"shapeitup": {
"command": "npx",
"args": ["-y", "@shapeitup/mcp-server"]
}
}
}
29 changes: 29 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "shapeitup",
"version": "1.30.1",
"description": "Scripted CAD for AI agents: write parametric parts in TypeScript, check them with 4-view renders, collision and joint checks, and export STEP/STL/3MF.",
"author": {
"name": "Asbjorn Rorvik",
"email": "rorvik.asbjorn@gmail.com",
"url": "https://github.com/asbis"
},
"homepage": "https://shapeitup.dev",
"repository": "https://github.com/asbis/ShapeItUp",
"license": "MIT",
"keywords": ["cad", "text-to-cad", "3d-printing", "replicad", "opencascade", "step", "stl", "3mf"],
"skills": "./skills/",
"mcpServers": "./codex.mcp.json",
"interface": {
"displayName": "ShapeItUp",
"shortDescription": "Parametric CAD your agent can drive",
"longDescription": "The agent writes each part as a TypeScript .shape.ts file, renders it from four angles, reads the errors and fixes them. Check collisions and joints, tune parameters, and export STEP for Fusion or FreeCAD and 3MF for Bambu Studio or OrcaSlicer. OpenCascade runs as WebAssembly, so nothing needs installing beyond Node.",
"developerName": "Asbjorn Rorvik",
"category": "Creativity",
"capabilities": ["Write", "Interactive"],
"websiteURL": "https://shapeitup.dev",
"composerIcon": "./icon.png",
"logo": "./icon.png",
"defaultPrompt": ["Design a 3D-printable wall hook for a 20 mm rail and show me the renders."],
"brandColor": "#FF5A1F"
}
}
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,62 @@ jobs:
# --skip-duplicate for the same reason the npm step skips: a version
# that is already listed is the goal state, so a re-run must pass.
run: npx -y @vscode/vsce publish --packagePath shapeitup-vscode.vsix --azure-credential --skip-duplicate

mcp-registry:
# The official MCP Registry (registry.modelcontextprotocol.io). The
# VS Code MCP gallery and most MCP directories mirror it, so a listing
# there is how people find the server without knowing its npm name.
#
# Its own job, like `marketplace`, so the two can fail independently: a
# registry outage must not strand the VSIX, and a Marketplace problem must
# not keep the listing stale.
#
# Auth is GitHub OIDC, no secret. The registry trusts the `io.github.asbis/`
# namespace in server.json because this workflow runs in a repo `asbis`
# owns. It then checks that the npm package's `mcpName` names the same
# server, which is why this waits for `publish` to put the package on npm.
needs: publish
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6

- name: Publish server.json to the MCP Registry
shell: bash
env:
# Pinned so a publisher release can't change behaviour under a
# release. Bump when the registry asks for it ("invalid audience"
# means this binary is too old).
MCP_PUBLISHER_VERSION: v1.8.1
run: |
set -euo pipefail
NAME="$(jq -r .name server.json)"
VERSION="$(jq -r .version server.json)"
PKG_VERSION="$(jq -r .version packages/mcp-server/package.json)"
if [ "$VERSION" != "$PKG_VERSION" ] || [ "$(jq -r '.packages[0].version' server.json)" != "$PKG_VERSION" ]; then
echo "::error::server.json is not at $PKG_VERSION, the version npm just got. Bump both version fields in server.json." >&2
exit 1
fi

# Idempotent like the npm step: a version already listed is the goal
# state, and a re-run of a half-failed release has to pass.
if curl -fsS "https://registry.modelcontextprotocol.io/v0/servers?search=$NAME&version=$VERSION" \
| jq -e --arg n "$NAME" --arg v "$VERSION" '.servers[] | select(.server.name == $n and .server.version == $v)' >/dev/null; then
echo "$NAME@$VERSION is already in the registry — skipping."
exit 0
fi

curl -fsSL "https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
./mcp-publisher login github-oidc

# The registry validates against npm, which can take a moment to
# serve a version published seconds ago.
for attempt in 1 2 3 4 5; do
if ./mcp-publisher publish; then exit 0; fi
echo "Publish attempt $attempt failed; retrying in 30 s."
sleep 30
done
echo "::error::mcp-publisher publish failed 5 times." >&2
exit 1
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ Extension `1.30.1` / mcp-server `1.30.1` — Codex setup docs and three fixes.
10 s to start and 60 s per tool; a first `npx` run from an empty cache took
34 s, so a fresh install timed out before it answered. The skill goes in
`~/.agents/skills/shapeitup/`, where Codex looks for skills.
- **An install manifest for every client.** `.claude-plugin/plugin.json` makes
`claude plugin install shapeitup@shapeitup` bring the MCP server and the
skill together, and is what Anthropic's plugin directory reads.
`.codex-plugin/plugin.json` (with `codex.mcp.json`, which carries the
timeouts) does the same for Codex, and `gemini-extension.json` lets
`gemini extensions install https://github.com/asbis/ShapeItUp` work.
- **Official MCP Registry listing.** `server.json` plus `mcpName` in the npm
package, published as `io.github.asbis/shapeitup` by a new `mcp-registry`
job in the release workflow (GitHub OIDC, no token; skips a version already
listed). The VS Code MCP gallery and most directories mirror the registry.
- **README leads with installing.** "Ask your agent" (it follows
`INSTALL.md`), Add to Cursor and Install in VS Code buttons, the Claude Code
plugin, Gemini, `npx skills add`, renders, and links to shapeitup.dev and
the browser playground.
- `pnpm release:check` fails unless every manifest's version matches the
release and `mcpName` matches `server.json`.

### Fixed
- **On macOS the MCP server and the VS Code extension never found each
Expand Down
20 changes: 18 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,23 @@ Registered globally in `~/.claude/settings.json`. Viewer-related tools:
- **To release**: bump versions (see below), commit, push, then either `gh release create v0.x.x` OR `gh workflow run publish.yml --ref master` (dispatch skips the tag-verify step and publishes whatever version is in `package.json`).
- **Marketplace auth = Microsoft Entra ID (no token).** The `marketplace` job runs in the GitHub environment `marketplace`, signs in with `azure/login` (OIDC, `allow-no-subscriptions`) and runs `vsce publish --azure-credential`. The identity is the app registration "ShapeItUp Marketplace publisher (GitHub Actions)" in the `Standardmappe` tenant; its federated credential trusts exactly `repo:asbis/ShapeItUp:environment:marketplace`, and its client/tenant IDs are the environment variables `AZURE_CLIENT_ID` / `AZURE_TENANT_ID`. It sits on the `shapeitup` publisher as a Contributor — the ID the Members list takes is printed by the job's "Show the identity the Marketplace sees" step. The job is separate from `publish` on purpose: an environment changes the job's OIDC claims, and the npm trusted publisher must keep seeing the ones it was configured with.
- **Why not a PAT.** `VSCE_PAT` expired silently: it was the LAST step, so npm had already published and every release read as half-done rather than broken. The listing sat at 1.23.0 (8 Jul 2026) through six releases, 1.24.0 → 1.29.5. Azure DevOps also retires global PATs on 2026-12-01. Do not go back.
- **Re-runs are safe on both channels.** The npm step skips a version already on the registry and the Marketplace step passes `--skip-duplicate`, so re-running a half-failed release only redoes what's missing. Still check `npx @vscode/vsce show shapeitup.shapeitup-vscode` after any release; npm and the Marketplace can drift apart without anything saying so.
- **Re-runs are safe on every channel.** The npm step skips a version already on the registry, the Marketplace step passes `--skip-duplicate`, and the MCP Registry step skips a version already listed, so re-running a half-failed release only redoes what's missing. Still check `npx @vscode/vsce show shapeitup.shapeitup-vscode` after any release; npm and the Marketplace can drift apart without anything saying so.
- **MCP Registry = GitHub OIDC (no token).** Job `mcp-registry` (after `publish`, beside `marketplace`) publishes `server.json` as `io.github.asbis/shapeitup` with a pinned `mcp-publisher`. The registry checks that the npm package's `mcpName` (in `packages/mcp-server/package.json`) names the same server, so the two must stay equal.

### Install manifests

One file per client, all at the repo root, because the repo itself is the plugin:

| File | Client |
|---|---|
| `.claude-plugin/plugin.json` + `marketplace.json` | Claude Code plugin (MCP server + skill); Anthropic's directory reads `plugin.json` |
| `.codex-plugin/plugin.json` + `codex.mcp.json` | Codex plugin; `codex.mcp.json` carries the startup/tool timeouts Codex needs |
| `gemini-extension.json` | `gemini extensions install https://github.com/asbis/ShapeItUp` |
| `server.json` | Official MCP Registry |

Every one carries a version, and `pnpm release:check` fails until all of them match the release.

The root `.mcp.json` is the dev config for this repo (it runs the local `dist/` under `mcpmon`). Because the repo root is also the plugin root, Claude Code loads it for plugin users too, before the plugin's own servers. It is harmless only because both name the server `shapeitup`, so the plugin's entry replaces the dev one. Keep the names identical.

### Any change under `packages/mcp-server/` MUST bump its own version

Expand All @@ -227,7 +243,7 @@ The release workflow publishes `@shapeitup/mcp-server` on every GitHub release.
Checklist when touching anything under `packages/mcp-server/src/` or its deps (`packages/core/`, etc. that get bundled in):

1. Bump `packages/extension/package.json` version (drives the release tag).
2. Bump `packages/mcp-server/package.json` version in the same commit.
2. Bump `packages/mcp-server/package.json` version in the same commit, along with every install manifest above.
3. Both versions should usually move in lockstep to keep diagnostics sane.
4. After the release lands, verify `npm view @shapeitup/mcp-server version` matches.

Expand Down
36 changes: 30 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,27 @@ For each client the user wants to register (ask them), do the following:

#### Claude Code CLI

Preferred: use the CLI.
Preferred: install the plugin. It brings the MCP server and the skill
together, and `claude plugin marketplace update` keeps both current, so you
can skip this client in Step 3.

```bash
claude plugin marketplace add asbis/ShapeItUp
claude plugin install shapeitup@shapeitup
```

If `claude mcp list` already shows a `shapeitup` server, the user added it by
hand earlier. Ask whether to keep that one or switch to the plugin; with both,
every tool is listed twice. `claude mcp remove shapeitup` removes the old one.

If `claude plugin` isn't available (older Claude Code), register the server
alone:

```bash
claude mcp add shapeitup -s user -- npx -y @shapeitup/mcp-server
```

Fallback if `claude mcp add` isn't available: merge this into `~/.claude.json`:
Fallback if `claude mcp add` isn't available either: merge this into `~/.claude.json`:

```json
{
Expand Down Expand Up @@ -134,7 +148,14 @@ the Cursor snippet. Then tell the user to restart Claude Desktop.

#### Gemini CLI

Create `~/.gemini/extensions/shapeitup/gemini-extension.json`:
Preferred: install the extension from GitHub, which `gemini extensions update`
can then keep current.

```bash
gemini extensions install https://github.com/asbis/ShapeItUp
```

Fallback if that fails: create `~/.gemini/extensions/shapeitup/gemini-extension.json`:

```json
{
Expand Down Expand Up @@ -172,7 +193,8 @@ is shorter than the first `npx` download. Tell the user to run `/reload` in Vibe

### Step 3 — Install the Claude Code skill (optional but recommended)

If Claude Code is present, fetch `SKILL.md` from the URL in the table above
If Claude Code is present and you registered the server with `claude mcp add`
rather than the plugin, fetch `SKILL.md` from the URL in the table above
and write it to `~/.claude/skills/shapeitup/SKILL.md`. This gives Claude a
full Replicad API reference when working on `.shape.ts` files. Ask first.

Expand Down Expand Up @@ -211,8 +233,10 @@ so the user can troubleshoot.

To remove ShapeItUp from an MCP client, delete the `shapeitup` entry from the
relevant config file (for Codex, the `[mcp_servers.shapeitup]` table in
`~/.codex/config.toml`), or run `claude mcp remove shapeitup` for Claude Code
and `vibe mcp remove shapeitup` for Mistral Vibe. No global state is left
`~/.codex/config.toml`), or run `claude plugin uninstall shapeitup@shapeitup`
(or `claude mcp remove shapeitup`) for Claude Code,
`gemini extensions uninstall shapeitup` for Gemini CLI and
`vibe mcp remove shapeitup` for Mistral Vibe. No global state is left
behind beyond those config entries and the optional skill files at
`~/.claude/skills/shapeitup/`, `~/.vibe/skills/shapeitup/` and
`~/.agents/skills/shapeitup/`.
65 changes: 60 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,52 @@
<a href="https://www.npmjs.com/package/@shapeitup/mcp-server"><img src="https://img.shields.io/npm/v/@shapeitup/mcp-server.svg" alt="npm: @shapeitup/mcp-server"></a>
</p>

<p align="center">
<a href="https://shapeitup.dev"><strong>shapeitup.dev</strong></a> · <a href="https://shapeitup.dev/app/">Try it in your browser</a> · <a href="#install">Install</a>
</p>

<p align="center">
<img src="website/public/img/bracket-hero.webp" alt="An L-bracket with gussets and mounting holes in the ShapeItUp viewer" width="720">
</p>

---

ShapeItUp is an MCP server that turns [Replicad](https://replicad.xyz) / OpenCascade into AI-agent-grade CAD tooling. It writes, renders, verifies, and exports parametric 3D models from TypeScript `.shape.ts` files, headlessly — from the terminal, from Claude Code / Codex / Cursor / Claude Desktop / Mistral Vibe, or from CI. A [VSCode extension](#vscode-extension-optional) is available as an optional interactive viewer for humans who want to watch the renders happen live.

## Install for Claude Code
## Install

**Fastest: ask your agent.** Paste this into Claude Code, Codex, Cursor or any other coding agent:

```text
Install the ShapeItUp MCP server by following https://raw.githubusercontent.com/asbis/ShapeItUp/master/INSTALL.md
```

It finds the MCP clients on your machine and asks before it writes to any of their configs.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=shapeitup&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzaGFwZWl0dXAvbWNwLXNlcnZlciJdfQ%3D%3D)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=shapeitup&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40shapeitup%2Fmcp-server%22%5D%7D)

### Claude Code

As a plugin, which brings the MCP server together with the skill that teaches Claude the API, and updates with this repo:

```bash
claude plugin marketplace add asbis/ShapeItUp
```

```bash
claude plugin install shapeitup@shapeitup
```

Or the MCP server on its own:

```bash
claude mcp add shapeitup -- npx -y @shapeitup/mcp-server
```

That's it. `claude mcp add` registers the server in your Claude Code config so agent sessions pick it up automatically. See the [Claude Code MCP docs](https://docs.claude.com/en/docs/claude-code/mcp) for scoping options (`-s user` for all projects, `-s project` for just this repo).
Pick one. With both, Claude sees every tool twice; `claude mcp remove shapeitup` drops the second. See the [Claude Code MCP docs](https://docs.claude.com/en/docs/claude-code/mcp) for scoping options (`-s user` for all projects, `-s project` for just this repo).

## Install for Codex
### Codex

```bash
codex mcp add shapeitup -- npx -y @shapeitup/mcp-server
Expand All @@ -47,7 +80,15 @@ For the Replicad API reference, save [`SKILL.md`](skills/shapeitup/SKILL.md) whe
mkdir -p ~/.agents/skills/shapeitup && curl -fsSL https://raw.githubusercontent.com/asbis/ShapeItUp/master/skills/shapeitup/SKILL.md -o ~/.agents/skills/shapeitup/SKILL.md
```

## Install for Cursor / Claude Desktop / other MCP clients
### Gemini CLI

```bash
gemini extensions install https://github.com/asbis/ShapeItUp
```

`gemini extensions update shapeitup` picks up new releases.

### Cursor / Claude Desktop / other MCP clients

The generic MCP-config snippet:

Expand Down Expand Up @@ -84,6 +125,14 @@ startup_timeout_sec = 60

Keep `startup_timeout_sec`: Vibe's default of 10 s is shorter than the first `npx` download. For the Replicad API reference, save [`skills/shapeitup/SKILL.md`](skills/shapeitup/SKILL.md) as `~/.vibe/skills/shapeitup/SKILL.md`. More options, including `vibe mcp add`, are in the [MCP server README](packages/mcp-server/README.md#mistral-vibe).

### The skill on its own

The one-click buttons and the plain MCP configs above don't include the skill that teaches the agent the API. To add it to any agent that reads `SKILL.md` files (Cursor, Codex, Claude Code, Gemini and others):

```bash
npx skills add asbis/ShapeItUp
```

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

## What you get
Expand Down Expand Up @@ -125,7 +174,13 @@ export default function main({ width, depth, thickness, holeInset }: typeof para
}
```

Then it calls `render_preview` and gets back a PNG it can inspect, plus bounding-box + volume metadata to sanity-check against the spec. If the user wants the holes bigger, the agent calls `tune_params` — no file rewrite needed.
Then it calls `render_preview` and gets back a PNG it can inspect, plus bounding-box + volume metadata to sanity-check against the spec.

<p align="center">
<img src="website/public/img/four-views.webp" alt="The four-view render render_preview returns: top, front, right and isometric" width="480">
</p>

If the user wants the holes bigger, the agent calls `tune_params` — no file rewrite needed.

## Running in CI / containers

Expand Down
Loading
Loading