darktable-mcp
MCP-сервер для Darktable
Сервер протокола контекста модели (MCP), который позволяет Claude и другим ИИ-ассистентам управлять darktable для организации и редактирования фотографий.
Функции
Управление библиотекой фотографий: просмотр, оценка, импорт и организация фотографий
Базовое редактирование фотографий: настройка экспозиции, применение пресетов, кадрирование изображений
Пакетные операции: эффективная обработка нескольких фотографий
Безопасная интеграция: использует официальный Lua API darktable
Простая настройка: установка одной командой
Related MCP server: darktable-mcp
Установка
pip install darktable-mcpКонфигурация
Добавьте в конфигурацию Claude Desktop (~/.claude_desktop_config.json):
{
"mcpServers": {
"darktable": {
"command": "python",
"args": ["-m", "darktable_mcp"]
}
}
}Примеры использования
Оцените свои лучшие фотографии:
"Claude, поставь 4 звезды моим пейзажным фотографиям за прошлую неделю"
Пакетное редактирование фотографий:
"Claude, увеличь экспозицию на +0.5 для всех недоэкспонированных фотографий заката"
Умная организация:
"Claude, импортируй фотографии с моей камеры и рассортируй их по дате"
Требования
Python 3.8+
darktable 4.0+
Claude Desktop или совместимый MCP-клиент
Доступные инструменты
view_photos()- просмотр библиотеки фотографий с фильтрамиrate_photos()- установка звездного рейтинга (1-5)import_batch()- импорт из директорийadjust_exposure()- изменение настроек экспозицииapply_preset()- применение пресетов редактированияexport_images()- экспорт в различные форматы
Участие в разработке
Приветствуем любой вклад! Пожалуйста, ознакомьтесь с нашими рекомендациями по участию.
Лицензия
Лицензия MIT — подробности см. в файле LICENSE.
Ключевые слова
darktable, MCP, протокол контекста модели, редактирование фотографий, обработка RAW, пакетная обработка, ИИ-управление фотографиями, Claude, рабочий процесс фотографа
Available Tools
10 toolsapply_presetA
Apply a darktable style (preset) to one or more photos. The preset_name must exactly match a style name from list_styles. Returns counts of applied and missed photos. Requires darktable to be running with the darktable-mcp Lua plugin installed.
Inputs: photo_ids (required), preset_name (required).
apply_ratings_batchA
Write XMP sidecars (xmp:Rating) for a batch of {stem: rating} pairs. Each sidecar sits next to its raw file at .xmp and is picked up automatically by darktable on import. Rating range: -1 (reject), 0 (unrated), 1-5 (stars). Each rating is also appended to <source_dir>/ratings.jsonl for replay/audit. An existing sidecar is never replaced: only its rating value is rewritten, so darktable edit history survives. A sidecar with no recognisable rating is skipped with an error rather than overwritten.
Inputs: ratings (required), source_dir (required), log, force.
export_imagesA
Export photos to JPEG/PNG/TIFF via darktable-cli. Pass absolute file paths in photo_ids — the path field from view_photos drops in directly. Output names are de-collided: two sources sharing a stem (e.g. DSC_0001.NEF from two folders) get suffixed names rather than overwriting each other, so do not assume the written file is .. Read the real path from the output field of the .export_images.jsonl side file.
Inputs: format (required), photo_ids (required), output_path (required), quality, +2 more.
extract_previewsA
Extract auto-rotated JPEG previews from a directory of raw files (NEF/CR2/ARW/DNG/etc) for vision-based rating. Each preview is rotated upright via EXIF orientation and resized to max_dim (default 1024). A smaller thumb_dim (default 384) is also written for token-efficient first-pass culling. Returns a list of items with preview paths plus an EXIF summary (ISO, shutter, focal, aperture, datetime) per file. The scan is recursive, and the output tree mirrors the source tree, so raws with the same filename in different subdirectories get distinct previews. Read the preview path from each item rather than assuming <output_dir>/.jpg.
Inputs: source_dir (required), max_dim, overwrite, thumb_dim, +2 more.
import_batchA
Register a folder as a film roll in the user's darktable library. Useful when you've copied photos from a card or external drive and want darktable to know about them. Returns the count of newly-imported photos. Requires darktable to be running with the darktable-mcp Lua plugin installed.
Inputs: source_path (required), recursive.
import_from_cameraA
Use when a camera or memory card is physically connected. Detects the camera via libgphoto2 and copies all photos to a local directory, then returns the destination path. Copying alone does not put the photos in the library: follow up with import_batch on that destination path to register them as a film roll. Files are written one subdirectory per camera folder or card, prefixed with the camera's identity (e.g. /Nikon_D850_sn_30014567_store_00010001_DCIM_100NCD80/DSC_0001.NEF), because camera filenames repeat across folders, across the two cards of a dual-slot body, and across bodies importing into the same destination. Import the destination recursively. A file that would collide with a different photo already on disk is kept alongside it as -2., never overwritten. This holds for two bodies of the same model that report no serial number and therefore share a subdirectory: before skipping files a destination appears to already hold, such a camera is asked for a small sample of them and the bytes are compared, so a second body's photos are kept rather than dropped. Re-running is cheap: a body with a serial number transfers nothing it already delivered. Any file the card lists that does not reach the destination is reported by name. Cost: this tool runs to completion synchronously and does not return early. A full card can take many minutes, up to the 1 hour default timeout, which is longer than most MCP clients wait for a single request. Progress is observable while it runs by tailing the .import.log file in the destination directory.
Inputs: camera_port, destination, timeout_seconds.
list_stylesA
List all darktable styles (presets) installed on the user's system. Returns name and description for each. Required discovery step before calling apply_preset, since style names must match exactly. Requires darktable to be running with the darktable-mcp Lua plugin installed.
Inputs: no named parameters.
open_in_darktableA
Launch the darktable GUI on a folder. The folder is registered as a film roll on first launch and XMP sidecars are picked up automatically. The lighttable opens already filtered via the official darktable.gui.libs.collect.filter Lua API for any rating spec: exact rating=N, rating_min=N (>=), rating_max=N (<=), arbitrary rating_min..rating_max inner ranges, or no filter at all.
Inputs: source_dir (required), rating, rating_max, rating_min, +1 more.
rate_photosB
Apply a star rating to one or more photos in the user's darktable library. Requires darktable to be running with the darktable-mcp Lua plugin installed.
Inputs: rating (required), photo_ids (required).
view_photosA
Browse photos in the user's darktable library. Filter by filename substring, minimum star rating, or both. Returns id, filename, absolute file path, and rating per match — the path can be passed straight into export_images. Requires darktable to be running with the darktable-mcp Lua plugin installed (see darktable-mcp install-plugin).
Inputs: limit, filter, rating_min.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools map cleanly to a distinct resource+action (import, browse, rate, style, export, preview, GUI launch). The one genuine overlap is rate_photos vs apply_ratings_batch — both write star ratings, one via the running darktable library and one via XMP sidecars for pre-import files — and view_photos vs extract_previews both surface photos, though the rich descriptions clarify the library-browsing vs file-preview distinction.
All tools are snake_case and verb-first, following a readable verb_noun convention (view_photos, list_styles, export_images, extract_previews). Minor deviations: import_from_camera and open_in_darktable use prepositional phrases, and the 'batch' suffix appears in both import_batch and apply_ratings_batch with slightly different grammatical roles, but the overall pattern stays predictable.
Ten tools is well-scoped for the domain: two import paths, library browsing, two rating mechanisms, style discovery/application, preview extraction, export, and GUI launch. Each tool occupies a distinct step in the photo-management workflow and none feels like filler.
The end-to-end pipeline is covered: copy from camera → register film roll → browse → rate → apply style → export, plus an alternative XMP-sidecar rating path that darktable picks up on launch. Missing operations like metadata editing, style creation, photo deletion, and richer library search (tags, dates) are workable gaps rather than dead ends.
Maintenance
Related MCP Connectors
Search photos and video moments by visual meaning, people, dates, and folders across local libraries, Apple Photos, and OneDrive. Manage collections, groups, favorites, people, and duplicate review. Synced metadata remains searchable while the desktop is offline; local and Apple Photos media access needs the owning device online with remote access enabled. OneDrive media can be accessed directly from the cloud. OAuth or Bearer API keys. Paid Cloud Access required; hosted visual search uses prepaid credits. Text-in-image search is semantic matching, not guaranteed exact OCR. Setup: https://organizewith.ai/en/guides/connect-ai-assistants
Read your tracked time and projects, pause tracking or add a note, from Claude or ChatGPT.
Create projects, nodes, and tasks in UluP Spaces by conversation with Claude.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to control Adobe Lightroom Classic on macOS for professional photo editing and catalog management. It allows users to inspect photos, apply develop settings, and automate workflows through a secure local bridge without direct catalog database manipulation.595MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to edit photos in darktable via natural language, adjusting sliders, applying styles, and organizing the library in real time through the MCP protocol.1MIT
- AlicenseCqualityCmaintenanceEnables AI agents to control Adobe Lightroom Classic develop settings, manage presets and catalogs, and perform round-trip handoffs with Adobe Photoshop for advanced retouching. Provides native socket bridging for exposure, color grading, search, ratings, keywords, collections, and export workflows.40MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to drive Adobe Lightroom Classic directly — searching and organizing catalogs, reading and writing the full set of develop parameters, building geometric and AI-generated masks (sky, subject, mountains, water, people), applying presets, and rendering previews, histograms, and exports. All capabilities are exposed as 167 MCP tools over a Lua plugin bridge, with write-confirmation sentinels so silently dropped edits surface as explicit errors.Apache 2.0