Skip to main content
Glama
README.md
# Estampes

**Point at the same image, together with AI, without leaving the conversation.**

[![M8ven Score](https://m8ven.ai/badge/mcp/curium-3391-estampes-gzwn2t?v=555a26cb79941f5f59b88979b3085efa)](https://m8ven.ai/mcp/curium-3391-estampes-gzwn2t?s=readme)

[繁體中文說明](docs/zh-TW/README.md) · [Quick start](docs/QUICKSTART.md) · [Deployment](docs/DEPLOYMENT.md) · [Changelog](CHANGELOG.md)

Estampes is an open-source plugin for ChatGPT and Claude: an MCP server with MCP Apps widgets that shows your picture as a shared canvas inside the chat. The AI draws on the original image, you draw back on the same canvas, and both sides refer to the same marks across turns. It works with any image (photos, scans, handwriting, book pages, diagrams, maps, drawings), and **each person runs their own server**.

Named after Claude Debussy's *Estampes* (1903).

## What it does

Talking about a specific spot in a picture usually means screenshots, circling things in another editor, re-uploading and several rounds of "which one?". Estampes keeps that in the conversation:

- **AI points for you:** boxes, arrows, polylines, freehand lines and labels over the original image, each with an optional note and status.
- **You point back:** pen, highlighter, boxes, arrows, tilted or perspective quadrilaterals and text on the same canvas, plus one sentence, then send.
- **Edit together:** select any unlocked mark, including the AI's, and drag, resize, reshape or rotate it; the AI is told exactly what you changed. Undo and redo also cover edits you already sent, and an open canvas picks up changes the AI makes in the meantime.
- **The source stays untouched:** marks live in layers you can show, hide, rename, reorder, fade and lock.
- **See the details:** zoom and pan inside the canvas with native-resolution tiles; AI can enhance contrast, sharpen, denoise, threshold, find edges or overlay a coordinate grid on a region before reading it.
- **Two images side by side:** compare two different pictures (a drawing and the real object, before and after); AI records which marks correspond and how sure it is, and you confirm or reject each link.
- **Evidence, not guesses:** every note and link AI adds is a claim with its confidence, the evidence behind it (which image, where) and a verification state that only you or a tool can change. Claims you reject are remembered.
- **Many images, one place:** a workspace holds up to 24 images side by side, each with its own marks and coordinates; merge, split, copy and link them without flattening anything, and carry a whole workspace to another server as one `.estampes` file.
- **Measure and align:** register two images (with honest quality reporting), overlay or difference them, assess sharpness and noise, calibrate a scale and measure distance, area or angle with uncertainty, render PDF pages, and detect candidate shapes, lines, circles or text.
- **Modules on the same canvas:** an optional Store adds capabilities that put *objects* on the canvas instead of pixels: plot a function (Graph), compute exactly with SymPy in a separate sandboxed container (calculator, with results you can plot), or plate-solve a photo of the sky. Each module asks for explicit permissions, and you approve every change.
- **English and Traditional Chinese:** every widget follows the chat app's language, and a **Language** menu in the canvas and Store headers lets each person choose; the choice stays in their own browser. Set `ESTAMPES_DEFAULT_LOCALE` for the language used when neither says ([Deployment](docs/DEPLOYMENT.md)).
- **Across turns and chats:** marks, layers and change history are stored on your own server and export as an image, a layered SVG (opens in Inkscape) or an `estampes.visual/2` JSON document you can load again.

Images come in through the chat (uploaded or photographed in ChatGPT), a public URL the AI supplies, or the canvas's own **Choose image / take photo** button (for Claude, which does not pass attachments to tools). Estampes handles pixels and coordinates; **recognition is still the AI's job**, and uncertain locations are shown as such.

## Quick start

Docker on amd64 or arm64 (Raspberry Pi, NAS, mini PC):

```sh
git clone https://github.com/Curium-3391/Estampes.git
cd Estampes
cp .env.example .env
docker compose --profile tunnel up -d
docker compose logs estampes | grep tunnel
```

The last command prints the connector URL, `https://….trycloudflare.com/mcp?key=…`. In ChatGPT web open Plugins → **Add custom MCP server**, paste it and choose **No authentication**. The URL contains your key, so keep it to yourself.

In Claude, open **Customize → Connectors → Add custom connector**, paste the URL without `?key=…`, press Connect and type the key on your server's sign-in page; see [Connecting Claude](docs/DEPLOYMENT.md#connecting-claude).

The temporary tunnel gets a new address on every restart. For lasting use, put a reverse proxy or a named tunnel in front of `docker compose up -d`; see [Deployment](docs/DEPLOYMENT.md), which also covers Heroku, Render and every setting.

Local development (Node 22):

```sh
npm ci
npm test
npm start          # http://localhost:8787/mcp
```

## Documentation

| Document | Contents |
| --- | --- |
| [Quick start](docs/QUICKSTART.md) | First deployment to first mark, with what to expect at each step and what to do when it fails |
| [Tutorials](docs/tutorials/README.md) | Annotate a photo, analyse a PDF page, plate-solve a sky photo; sample material you can generate |
| [Compatibility](docs/COMPATIBILITY.md) | Which clients, platforms and optional features have been tested, and how |
| [Deployment](docs/DEPLOYMENT.md) | Docker, tunnel, Heroku, Render, connecting ChatGPT and Claude, environment variables, what is stored |
| [Backup and restore](docs/BACKUP-RESTORE.md) | What is stored, back up, restore, upgrade and roll back, rotate keys after a leak (round trip verified by a script) |
| [Troubleshooting](docs/TROUBLESHOOTING.md) | Server unreachable, image will not load, broken widget, calculator down, module permission errors |
| [Security policy](SECURITY.md) | Single-owner security model and how to report a vulnerability privately |
| [Development guide](docs/DEVELOPMENT.md) | Set up, run every kind of test, code tour, public interfaces versus internals, first tasks |
| [Module quick start](docs/modules/QUICKSTART.md) · [Testing modules](docs/modules/TESTING.md) | Build, test, sign and install a module; declarative, WebAssembly and http paths |
| [Module distribution](docs/modules/DISTRIBUTION.md) · [Module acceptance](docs/modules/ACCEPTANCE.md) | Publish a signed package index, add it as a source on a server; the external-developer acceptance run |
| [Releasing](docs/RELEASE.md) | For maintainers: version order, Docker image tags, pre-release check, rollback |
| [Documentation maintenance](docs/DOCUMENTATION-MAINTENANCE.md) | For contributors: `npm run docs:check`, what it checks, which document to update with which change |
| [Usage](docs/USAGE.md) | Using the canvas in ChatGPT or Claude: drawing and editing marks, layers, zoom, paired view, export |
| [Tools](docs/TOOLS.md) | The MCP tools and HTTP endpoints |
| [Image pipeline](docs/IMAGE-PIPELINE.md) | Source files, derived views, exact coordinate transforms, PDF pages, analysis engines |
| [Image capabilities](docs/IMAGE-CAPABILITIES.md) | What the image tools do and do not cover, and what needs a plugin or an external service |
| [Canvas reads](docs/CANVAS-READS.md) | `render_canvas`: reading the saved canvas as pixels |
| [UVA store](docs/UVA-BETA.md) | The default storage engine: setup, limits, export and rollback to legacy files |
| [UVA power-loss simulation](docs/UVA-POWERLOSS.md) | How the store is tested against power cuts, and what is still unqualified |
| [Workspaces](docs/WORKSPACES.md) | Several images in one place; merge, split, copy, link; `.estampes` bundles |
| [Modules](docs/MODULES.md) | The module system, the Store, packages, WebAssembly and http modules, background jobs, plate solving |
| [Interface languages](docs/I18N.md) | How the language is chosen, what is translated, how to add a language |
| [Scientific calculator](docs/CAS.md) | The SymPy calculator module and its isolated container |
| [Surfaces](docs/SURFACES.md) | Panels and per-device layouts (`estampes.surface/1`) |
| [Workbench](docs/WORKBENCH.md) | The canvas and the calculator as windows inside one widget |
| [Visual protocol 2](docs/PROTOCOL-V2.md) | `estampes.visual/2`, the host-neutral JSON document for a whole canvas, with evidence and verification for every claim |
| [Visual protocol 1](docs/PROTOCOL-V1.md) | The earlier version, still read |
| [Vision](docs/VISION.md) | The problem, user journeys and non-goals |
| [Architecture](docs/ARCHITECTURE.md) | How the server, canvas widget and AI fit together |
| [Changelog](CHANGELOG.md) | Changes per version |
| [History](docs/history/README.md) | Early milestone notes and old protocol drafts |
| [繁體中文說明](docs/zh-TW/README.md) | Overview and quick start in Traditional Chinese |
| [Contributing](CONTRIBUTING.md) · [Code of conduct](CODE_OF_CONDUCT.md) · [Support](SUPPORT.md) | Contributions that help most, how we behave, where to ask |
| [Agent instructions](AGENTS.md) | Rules for AI coding assistants working in this repository |
| [Pre-public checklist](docs/PRE-PUBLIC-CHECKLIST.md) | For maintainers: what to check before the repository goes public |

## Status and limits

The current version is in [`package.json`](package.json) and at `/version` on your server.

- Upload, canvas, marks, layers, zoom and the paired view have been tested live in ChatGPT on web and mobile. Newer parts (workbench, calculator, plate solving, workspaces, editing the AI's marks, quadrilaterals and text, live updates of an open canvas) are covered by automated and fake-host browser tests; each page says whether it has been tried in a live ChatGPT host.
- Storage: with a storage folder (Docker sets one), images, canvases, workspaces, panel layouts and calculator notebooks are kept in the UVA store, in their own folder next to the storage folder (Docker: the `uva-beta` volume). Existing data move in on first open, and `scripts/uva-to-legacy.mjs` writes them back out before `ESTAMPES_CANVAS_STORE=legacy` switches back. The default profile survives a killed process but is not qualified for power loss; back up both folders ([Backup and restore](docs/BACKUP-RESTORE.md), [UVA store](docs/UVA-BETA.md)).
- How well AI recognises what is in an image is not guaranteed; Estampes does not decide what something is.
- Plugins cannot draw over images ChatGPT itself shows (such as image search results), so images are shown in the Estampes canvas instead.
- The access key is one shared secret, not per-user accounts. ChatGPT carries it in the connector URL (do not share that URL); Claude signs in with it once on your server's own page and keeps a token.
- Claude support (sign-in, canvas upload, result-size limits) is covered by automated tests; it has not yet been tried in a live Claude chat.
- Language: English and Traditional Chinese. Following the chat app's language is tested with fake hosts; whether ChatGPT and Claude report a language to widgets has not been checked live, so set `ESTAMPES_DEFAULT_LOCALE` to the language you want when they do not. Text sent to the AI as your words (mark intents, verdicts) is still Traditional Chinese until a later phase.
- Self-hosting only; there is no hosted service.

## License

[Mozilla Public License 2.0](LICENSE). You may use, modify and redistribute Estampes, including inside closed-source or commercial products; changes to Estampes's own files must be released under MPL 2.0 when you distribute them.

Third-party components keep their own licenses. The Docker image includes Node.js dependencies from `package-lock.json` (MIT, Apache-2.0, ISC, 0BSD) and the prebuilt libvips binaries that `sharp` loads dynamically (libvips and several bundled libraries are LGPL-3.0-or-later, others BSD/MIT-style; the per-library list is in `node_modules/@img/sharp-libvips-*/README.md` inside the image, and sources are at [lovell/sharp-libvips](https://github.com/lovell/sharp-libvips)). The calculator image includes SymPy and mpmath (BSD-3-Clause).