Darktable MCP server - headless implementation

Recently headless MCP server was added to the darktable master. It is implemented as a separate executable darktable-mcp and allows host LLM app to use most of the features of darktable.

The documentation is also already available here:

I am looking for any feedback. Is it useful, what works well, what needs improvement?

8 Likes

That’s… fascinating… I have no idea what to think of this.

We are stepping into a weird world my friends.

7 Likes

From the documentation description, it’s not clear to me why the described functionality needs AI clients. It looks like all functionality could be implemented without recourse to AI models…

It seems to me from the documention you link to that daktable-MCP (also) gives AIs like Claude access to my edits. Does that mean they can collect my history stacks, or even the source images? Notably this from the referred-to What is the Model Context Protocol (MCP)? - Model Context Protocol

1 Like

Don’t quite understand what you are saying here. The whole point of MCP server is to provide access to darktable as a tool to AI client – applications like Claude. So AI client is needed to make this connection. It is obviously not needed if you just want to continue using darktable for your image edits as you did it before.

If you will configure darktable MCP server with the path to your library – yes. But the default behavior is “in-memory”, which means no library on disk is accessible.

1 Like

So what would be an example (or even better: typical) use of darktable-mcp? I really don’t see any usecase for this. (for someone currently using darktable as a raw developer)

2 Likes

That was exactly my question. And I got your answer. Thank you for feedback.

1 Like

MCP enables the model to use darktable on your behalf. So, whatever you would do yourself, be it DAM tasks, culling in the lighttable or developing in the darkroom, you can ask the model to do it on your behalf.

Nowadays all models are multimodal, so the LLM can very well read the exported JPGs, see the photos and reason about their content. Together with MCP, this allows you to use the LLM as your photo lab assistant.

For example, you could take a RAW photo and a developed image and ask the LLM to find a set of parameters that would produce that look.

Or you can automate tasks like “create a composite of these three photos side by side”.

Or you can take a batch of frames from the same scene and ask the model to make them more similar to your hero shot.

Or ask the model to try out different B&W styles so that you can choose the one that you like most.

Or to automatically reject all the photos that are blurry or where the main subject has the eyes closed.

Sky (actually, token availability) is the limit.

Note that this has nothing to do with image generation. The model is just using a textual interface (MCP - Model Context Protocol) to operate on your behalf the same controls that you operate in the UI. The protocol is the agent’s UI, if you will.

7 Likes

OK, so in other words (and if my understanding is correct), any task I want to use darktable-mcp for, will need access to the images I want it to work on.
Those images will thus be uploaded to the AI server (with my implicit consent)?

@Anry: From what I see so far, I see no use for darktable-mcp for me. I will not even allow it to be present on my system.

1 Like

You could also use your local LLM, so your images will not be uploaded to different sites

2 Likes

@anry , I don’t think this would be something I would use and I wouldn’t want it to become enabled by default for sure. Thanks!

Nothing is doing anything without your consent. If you ask a hosted (i.e., non local) LLM to use darktable on your behalf AND if you ask it to produce output images AND to look at them, then yes. But there is nothing implicit here, nothing is doing anything that you don’t ask it to do.

That’s the point. If you need MCP it’s because you want to use an LLM to do something with your images. If you don’t want that, then you will certainly not use MCP (and you won’t even notice that it’s there).

1 Like

Not “implicit consent”. You need to make extra configuration actions to make it happen. Nothing can access you images unless you explicitly configure your system to allow this. Just having darktable-mcp executable on your system does not mean it is automatically discoverable or launch.

By the way, darktable-mcp is a sibling of older executable darktable-cli. They do pretty much the same thing just with different communication protocol. And AI host applications can already use darktable-cli now if you configure them to do so.

But in general, if you are concerned about the privacy of your data, please don’t worry, and just don’t use it.

2 Likes

The agent talks to darktable, sending it commands. If you use a cloud-based LLM with your agent (Claude desktop, ChatGPT Work, whatever), and ask it to look for blurry photos, it will upload them. If you use a local one, it will run locally. And if you don’t install an agent, or install it but don’t wire it up to darktable, it won’t do anything. Personally, I don’t see any value in this for me, but the use cases @Masterpiga mentioned could be great time savers for pros. Again, personally, I run coding agents in a container (lightweight virtual machine), as well isolated from my private stuff as I can manage.

2 Likes

This statement underlines some very basic misunderstanding.

MCP is not an LLM. It’s a set of instructions that allow a model that is already running on your system (if any) to interact with darktable.

For the record, if you run an LLM on your system it can already read all your data if you give it permission to do so. It does not need a special protocol to do that. MCP does not make “reading your photos” easier.

What MCP makes easier is for said model to control darktable modules. It should be underlined that a model can already do that independently of MCP, for example by syntesizing XMPs and applying them to your RAW files via darktable-cli.

In other words, darktable-cli is as much a liability for you as darktable-mcp is. The only reason why you never worried about darktable-cli is because it was never mentioned in the same sentence with LLM.

The presence of darktable-mcp does not increase your exposure to data violations by a jota.

9 Likes

I think photoprism uses darktable-cli for some basic processing of raw image (I think to just show a thumbnail). I could see them using mcp to provide more processing than a default xmp.

A great add to dt.

3 Likes

In fact, MCP is a protocol via which even scripts could control darktable, without any AI involved at all.

You can check the exposed features (‘tools’) using MCP Inspector - Model Context Protocol or other similar applications.

4 Likes

Maybe it would be helpful to explain the why:

If a bot can already do everything a person can, what problem was this PR a solution for? It sounds like things were already solved.

It seems to be a great idea, thanks. I can think of some things I might want to do with local agents.

I see this line in the documentation:
darktable-mcp is only built if darktable was compiled with the USE_MCP option, so the binary may not be present in all packages.

So I wonder if, for future releases, I would need to build darktable myself to obtain mcp server. I suppose it’s too early to say. :person_shrugging:

Currently, USE_MCP is ON by default. So the binary is there in official nightly builds. The same way as darktable-cli is there by default. Both of them are useless and harmless until user explicitly launches CLI or configures MCP connection.

4 Likes

It adds a way to do said things in a less hacky, more principled, streamlined, efficient and reliable way.

It’s the right tool for the job, which makes the job easier.

5 Likes