[RFC] darktable MCP server exposing the raw engine to AI agents#21573
[RFC] darktable MCP server exposing the raw engine to AI agents#21573andriiryzhkov wants to merge 1 commit into
Conversation
|
Given the controversial nature of AI-in-darktable generally, I'll suggest starting out as an out-of-tree tool. It can be migrated in later if there isn't too much pushback. This is a huge diff.... The introspect portion might be useful to convert the parameter storage in sidecars from hex-encoded binary dumps to key:value pairs, which would allow more general manipulation of edits. That has come up before in the context of tools like a darktable variant of LRTimelapse (where IIRC it would allow smoothing exposure over a long series of timelapse frames covering changing lighting like dawn or dusk). I'll take a look when I get a chance, probably over the weekend. |
It would also be useful for Lua scripts. @houz suggested it long ago, probably in reference to timelapse processing. |
|
Correct me if I'm wrong, but here there is no controversial part. The MCP servers will act as an "input" device letting agent control AI using text prompt like: "increase brightness by 2%"... So all in all, this is not really AI but just a way to control Darktable. |
|
Yes, it's not quite an AI tool in an understanding of what we delivered in latest release. It is a way to control Darktable similar to current CLI. It is a separate executable, again very much similar to CLI. Just to be transparent, I developed it initially for own purposes, but thought it might be useful for others. My use case was the following: I started using Darktable CLI with Claude for some creative looks reverse engineering experiments. It works, but agents need to do extra steps. MCP shortens that interaction. Anyway, it is a side tool and just a proposal from my side. I can keep it for myself if there will be a strong pushback or adapt in a way we agree here if useful. |
|
I perfectly understand @ralfbrown's concern and caution about the suspicion some users have towards anything AI-related. But in my opinion, if users have already largely accepted the introduction of AI tools in darktable, there will be no pushback against just another binary in the darktable toolkit, even if it is AI-related. I vote for including this tool in the tree. |
|
To avoid any confusion or controversy, it's important to be clear about what this adds. This is not AI and it does not change how darktable works. It is simply a new interface to darktable, similar to the existing GUI and CLI interface. MCP is to AI applications/clients what REST APIs were to web applications: a common interface that allows tools and services to communicate in a consistent way. MCP allows (AI or not)clients to interact with darktable through a standardised protocol. I hope it helps, regards. |
Yes.
Too little :) I'm always asking for more. But I'm not sure from your description that you can fully control all iop. This would be nice to be able to add a new module, change the sliders, the settings... A way to fully control Darktable and so let IA agent later do this to demo things. Later we could have some interaction like:
The IA then control Darktable and do the above steps.
That's my dream :) But this PR is a good first step.
I don't think there is anything that would block this. That's already a nice first step, the introspection will be quite handy for devs I would say. |
This adds
darktable-mcp, a small headless binary (sibling todarktable-cli) that speaks the Model Context Protocol over stdio, so an AI agent can drive darktable's raw pipeline directly.What it does
13 tools:
op_paramsby field nameExample – measure what an agx param does to the shadows:
{"name":"image_stats","arguments":{"input":{"path":"x.RAF"}, "disable_tone_mappers":true, "stack":[{"operation":"agx","params":{"curve_target_display_black_ratio":0.0008}}]}}Params are addressed through introspection (never fixed offsets), so it stays correct across module versions. Tool descriptions/schemas live in
data/mcp-tools.json(likenoiseprofiles.json) – editable without a rebuild.Notes
src/mcp/, one CMake optionUSE_MCP(ON), depends onjson-glib(already a dep)Feedback I'm after