MCP server for session-based photo editing with pluggable RAW backends
Project description
mcp-photo-edit
An MCP server for agent-driven photo editing with RawTherapee.
The server exposes a session-based editing workflow instead of raw sidecar manipulation. Agents create an edit session, apply structured adjustments, regenerate previews when needed, and export a final image. Internally the server writes session-owned RawTherapee PP3 files and renders them through rawtherapee-cli.
Each session now also maintains an explicit undo / redo timeline in session.json. Semantic edit history is tracked separately from preview-render history.
Examples
The demo photographs are original work and are not covered by the GPL license. Commercial use is prohibited.
Example: Fujifilm Style (v0.2.0)
Compare the baseline image with the two Fujifilm-style outputs below. Each thumbnail links to the full-size file. One with advanced image info and the other off.
Prompt:
Apply a Fujifilm camera like profile to
demo/cosplay.NEF. Apply a crop to focus on the center but keep the aspect ratio, export the result asdemo/fujifilm_style.jpg
| Before | Preview only | With diagnostics |
|---|---|---|
Model: gemini-3.1-pro-preview
Example: CCD Style (v0.2.0)
This example compares advanced image info-assisted runs using the same source image, prompt but different models.
Prompt:
Apply a 2000s CCD camera like profile to
demo/cosplay.NEF. Apply a crop to focus on the center but keep the aspect ratio, export the result as demo/ccd_style_gpt54_mini_medium.jpg
Main comparison:
| Baseline | Gemini 3 Flash | Gemini 3.1 Pro | GPT-5.4 (Medium) | GPT-5.4 Mini (Medium) |
|---|---|---|---|---|
Models: gemini-3-flash-preview, gemini-3.1-pro-preview, gpt-5.4 (medium), gpt-5.4-mini (medium)
Status
This is an MVP implementation.
Current focus:
- session-based editing flow
- structured adjustment schema
rawtherapee-clipreview and export- RAW and common raster inputs when supported by the local RawTherapee build
Not in scope:
- local masks
- healing / AI retouch
- full photo-editor feature coverage
- large preset libraries
- batch editing UX
Requirements
- Python 3.12+
uvfor the easiest local install and run workflowrawtherapee-clionPATH
Tested Environment
- OS: Ubuntu 24.04 LTS
- RawTherapee: v5.10 (CLI)
Install the project with uv:
uv sync
For development, include the optional test dependency:
uv sync --extra dev
Verify rawtherapee-cli:
rawtherapee-cli -v
Quickstart
Example stdio configurations
Codex CLI
Add this block:
[mcp_servers.photo_edit]
command = "uv"
args = ["run", "mcp-photo-edit"]
[mcp_servers.photo_edit.env]
MCP_PHOTO_EDIT_WORKDIR = "/absolute/path/to/.mcp-photo-edit"
MCP_PHOTO_EDIT_BACKEND = "rawtherapee-cli"
If you prefer to add it from the CLI instead of editing TOML manually:
codex mcp add photo-edit --env MCP_PHOTO_EDIT_WORKDIR=/absolute/path/to/.mcp-photo-edit --env MCP_PHOTO_EDIT_BACKEND=rawtherapee-cli -- uv run mcp-photo-edit
Verify the server is registered:
codex mcp list
Project guidance for Codex:
- This repo includes project-scoped guidance in
AGENTS.md. - This repo also ships an installable reusable skill at
skills/mcp-photo-edit.
Install the reusable skill manually by linking or copying it into Codex's skill directory.
$CODEX_HOME typically defaults to ~/.codex.
Link it:
mkdir -p ~/.codex/skills
ln -s <repo-path>/skills/mcp-photo-edit ~/.codex/skills/mcp-photo-edit
Or copy it:
mkdir -p ~/.codex/skills
cp -R <repo-path>/skills/mcp-photo-edit ~/.codex/skills/mcp-photo-edit
Codex CLI does not currently expose a dedicated skills install subcommand, so the skill-directory install is the supported path.
Recommended AGENTS.md snippet for better tool selection:
Use the `photo-edit` MCP server for photo-editing tasks. Create an edit session first, iterate with previews, and export only when the preview looks correct.
Gemini CLI
Add this block:
{
"mcpServers": {
"photo-edit": {
"command": "uv",
"args": ["run", "mcp-photo-edit"],
"env": {
"MCP_PHOTO_EDIT_WORKDIR": "/absolute/path/to/.mcp-photo-edit",
"MCP_PHOTO_EDIT_BACKEND": "rawtherapee-cli"
},
"timeout": 30000,
"trust": true
}
}
}
Or add it from the CLI. This example writes to user config instead of project-local config:
gemini mcp add --scope user --transport stdio --env MCP_PHOTO_EDIT_WORKDIR=/absolute/path/to/.mcp-photo-edit --env MCP_PHOTO_EDIT_BACKEND=rawtherapee-cli --timeout 30000 --trust photo-edit uv run mcp-photo-edit
If you omit --scope user, Gemini CLI writes the MCP entry to project-local config by default.
Verify the configuration:
gemini mcp list
If Gemini shows the stdio server as disconnected, trust the current folder first:
gemini trust
Gemini CLI also supports installing the reusable skill bundled with this repo.
Install from a local path:
gemini skills install <repo-path>/skills/mcp-photo-edit --scope user
For active local development, link it instead so updates in the repo are reflected immediately:
gemini skills link <repo-path>/skills/mcp-photo-edit --scope user
Verify the skill is available:
gemini skills list
Compatibility Note
RAW support depends on the local RawTherapee build and its bundled RAW decoders. A file extension being supported in principle does not guarantee that every camera or compression variant will decode on every machine. When diagnosing unsupported RAW files, check the installed RawTherapee version and the camera / compression mode used by the source file. For reference, this project is primarily developed and tested on the environment described in the Tested Environment section.
Note on Nikon RAW: Some compressed Nikon RAW formats (e.g., High Efficiency / HE* compression) may not be supported by the underlying libraries in current RawTherapee builds. If you encounter issues with Nikon files, try using uncompressed RAW or Lossless Compressed modes if available in-camera.
Advanced Image Info
This project can attach extra diagnostic output to each preview render:
preview_pathremains the primary image for aesthetic judgment.diagnostic_dashboard_pathadds a separate technical dashboard image.diagnostic_summaryadds machine-readable stats for exposure, balance, and saturation.- Set
DISABLE_ADVANCED_IMAGE_INFO=trueto turn the diagnostics off and keep the original preview-first workflow.
When enabled, the dashboard is meant to complement the clean preview rather than replace it.
Available Tools
create_edit_sessionget_edit_sessionrender_previewapply_adjustmentsreset_adjustmentsundo_adjustmentredo_adjustmentexport_imagelist_supported_adjustments
render_preview regenerates the current session preview, appends a new preview artifact, and returns the latest preview_count.
undo_adjustment and redo_adjustment move the session cursor across committed edit states without creating new edit-history entries.
Typical Agent Workflow
- Create a session from an input image.
- Inspect the returned session state, including
preview_path,preview_history, current adjustment state, and history cursor fields such ashistory_index,history_length,can_undo, andcan_redo. - Apply one or more adjustments.
- Use
undo_adjustmentorredo_adjustmentwhen you need to move across committed edit steps. - Re-check the preview by calling
render_previewwhenever you want a fresh preview artifact and an explicitpreview_countfor the current step. - Export a final image explicitly.
See SKILL.md for an agent-facing usage guide.
Adjustment Model
The public API exposes a stable edit schema. It does not ask clients to hand-author backend profile files.
Current default-backend MVP adjustments:
exposurecontrastsaturationrgb_mixerdenoise_lumadenoise_detaildenoise_chromacolor_temperaturegreen_balancehighlightsshadowssharpen_amountsharpen_radiussharpen_contrastorientationcrop
Use list_supported_adjustments to discover exact ranges, defaults, and example payloads at runtime.
Backend note:
- the current implementation targets RawTherapee
PP3 list_supported_adjustmentsis the source of truth for runtime support
Session History
session.jsonis the authoritative session timeline.historystores committed semantic edit steps.history_indexpoints to the current step.session.pp3is the current materialized backend state.render_previewappends preview artifacts but does not append semantic edit history.- Applying a new edit after undo truncates the redo tail.
Project Layout
src/mcp_photo_edit/
models.py Pydantic schemas and validation
session.py Session lifecycle and persistence
pp3.py Adjustment to RawTherapee PP3 translation
render.py Backend integrations
server.py MCP tool registration
tests/
skills/
Development
Install dev dependencies:
uv sync --extra dev
Run tests:
uv run pytest
Start the server over stdio:
uv run mcp-photo-edit
Disclaimers
- This project invokes
rawtherapee-cli; it does not embed or redistribute RawTherapee internals. - Exact visual behavior depends on the local RawTherapee version, decoder support, ICC setup, and the input file.
- The server never modifies the original source image. It writes session artifacts and backend state files in a managed workspace.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_photo_edit-0.2.2.tar.gz.
File metadata
- Download URL: mcp_photo_edit-0.2.2.tar.gz
- Upload date:
- Size: 14.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76aa44e98866eb1448867dae31fe28bfdb11f8a420b1de48683acee21ef61d30
|
|
| MD5 |
a3ac38b9ee70ec0ea1c9f78afe719e51
|
|
| BLAKE2b-256 |
51b88e16eb2fee5fbd019ae6157f1c7e40d51a2edeb2a166a27b9e261193bfe3
|
Provenance
The following attestation bundles were made for mcp_photo_edit-0.2.2.tar.gz:
Publisher:
publish.yml on joshua5201/mcp-photo-edit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_photo_edit-0.2.2.tar.gz -
Subject digest:
76aa44e98866eb1448867dae31fe28bfdb11f8a420b1de48683acee21ef61d30 - Sigstore transparency entry: 1363295070
- Sigstore integration time:
-
Permalink:
joshua5201/mcp-photo-edit@af1736c560cb17d529c3abc53dc98c901f79b49d -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/joshua5201
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@af1736c560cb17d529c3abc53dc98c901f79b49d -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_photo_edit-0.2.2-py3-none-any.whl.
File metadata
- Download URL: mcp_photo_edit-0.2.2-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4d61a108153692b4b18ec0e29d3ff85c071eb76b87b78914a1b31d575bce805
|
|
| MD5 |
d60fcf156b7fb4d0be103adee3941ccf
|
|
| BLAKE2b-256 |
f09cf23675a5198c64cbccf47f4173e8c9564b42c481a10aa3f3fbb7173441a3
|
Provenance
The following attestation bundles were made for mcp_photo_edit-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on joshua5201/mcp-photo-edit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_photo_edit-0.2.2-py3-none-any.whl -
Subject digest:
e4d61a108153692b4b18ec0e29d3ff85c071eb76b87b78914a1b31d575bce805 - Sigstore transparency entry: 1363295164
- Sigstore integration time:
-
Permalink:
joshua5201/mcp-photo-edit@af1736c560cb17d529c3abc53dc98c901f79b49d -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/joshua5201
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@af1736c560cb17d529c3abc53dc98c901f79b49d -
Trigger Event:
release
-
Statement type: