darktable-mcp
Enables Claude and other AI assistants to control darktable for photo management and editing through its Lua API.
README
Darktable MCP Server
A Model Context Protocol (MCP) server that exposes a small set of darktable operations to MCP clients (e.g. Claude Desktop, Claude Code). The AI lives in the client; this server drives darktable.
Status
Production ready for headless operations! All core library tools are now implemented using darktable's headless Lua API.
Implemented tools:
view_photos- Browse your darktable library with filtering and rating options (headless)rate_photos- Apply star ratings to photos in your library (headless)import_batch- Import photos from directories (headless)adjust_exposure- Adjust exposure with live preview (opens darktable GUI)export_images- Export photos to JPEG/PNG/TIFF via darktable-cli
Not yet implemented:
apply_preset- Apply editing presets to photos (planned for next release)
The headless integration uses darktable's native Lua API via require("darktable") to provide fast, invisible library operations while respecting all design principles.
Design rules (no compromise)
- Use the provided darktable APIs only.
darktable-clifor export; the official Lua API for everything else. Do not read or writelibrary.dbdirectly under any circumstances. - Tools that return data to the AI must be headless. Spawning the darktable GUI to answer a query is unacceptable.
- GUI is only acceptable when the tool's purpose is to show the human user something in the darktable editor. No such tool exists yet. When one is added, it is the only thing that may launch the GUI.
Why some tools are parked
darktable-cli deliberately does not load the user's library, so it
cannot browse it. darktable --lua brings up the full GUI. That means
there is no headless, official-API path today for library reads or
writes. The honest answer is to not ship those tools yet.
The planned unblocker is a long-running darktable instance running a Lua plugin that exposes a small RPC (e.g. unix socket); the MCP server talks to that plugin. That keeps every rule above intact — official API, headless after the user already has darktable open, no DB poking.
Installation
pip install darktable-mcp
You also need darktable (with darktable-cli) installed and available
on your PATH.
Quick test: After installation, try:
# In Claude Desktop, you can now ask:
# "Show me my recent photos" (uses view_photos)
# "Rate these photos 4 stars" (uses rate_photos)
# "Import photos from ~/Pictures/vacation" (uses import_batch)
Note: First run will auto-detect your darktable library location. Make sure you've opened darktable and imported some photos before using the MCP server.
Configuration
Add to your Claude Desktop config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"darktable": {
"command": "darktable-mcp"
}
}
}
Implemented tools
view_photos(filter?, rating_min?, limit?)— Browse photos in your darktable library. Filter by filename, minimum rating, or limit results.rate_photos(photo_ids, rating)— Apply 1-5 star ratings to specific photos by ID.import_batch(source_path, recursive?)— Import photos from directories into your darktable library.adjust_exposure(photo_ids, exposure_ev)— Adjust exposure settings for photos. Opens darktable GUI to show preview.export_images(photo_ids, output_path, format, quality?)— Export photos to JPEG/PNG/TIFF via darktable-cli.
Stubbed tools (registered, not implemented)
apply_preset(photo_ids, preset_name)— Apply editing presets to photos. Planned for next release.
Requirements
- Python 3.8+
- darktable 4.0+ (with
darktable-clionPATH) - An MCP-compatible client (Claude Desktop, Claude Code, etc.)
Troubleshooting
"darktable setup error" — Ensure darktable is installed and you've opened it at least once to create the library database.
"Failed to parse photo data" — Your darktable library may be corrupted or in an unexpected format. Try opening darktable directly to verify it works.
"Library not found" — The auto-detector couldn't find your darktable library. Common locations:
- Linux:
~/.config/darktable/library.db - macOS:
~/Library/Application Support/darktable/library.db - Windows:
%APPDATA%\Local\darktable\library.db
If your library is in a custom location, please open an issue.
Tool timeouts — Some operations may take longer on large libraries. This is normal for the first run or after major library changes.
Contributing
Contributions welcome. The most useful starting point is the long-running
Lua-plugin + IPC integration that unblocks every parked tool. Any change
that reads or writes library.db directly will be rejected.
License
MIT — see LICENSE.
Keywords
darktable, MCP, model context protocol, photo editing, RAW processing, batch processing, photography workflow, Claude
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。