gthumb-mcp
Uses the freedesktop.org thumbnail cache and thumbnailer specification to read and generate shared thumbnails, so gThumb and other compliant applications reuse cached thumbnail images.
Integrates with gThumb, GNOME's image library application, exposing catalogs, tags, star ratings, comments, thumbnails, and search to AI agents by reading and writing gThumb's native catalog/tag files and embedded XMP metadata.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gthumb-mcpfind my images tagged Beach and rate them 5 stars"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gthumb-mcp
An MCP (Model Context Protocol) server that exposes a gThumb image library to AI agents: catalogs, tags, star ratings, comments, thumbnails and search.
It works directly with gThumb's own data — no database, no duplication:
Data | Location | Access |
Catalogs & saved searches |
| read + write |
Tag definitions |
| read + write |
Per-tag search snapshots |
| read |
Ratings, tags, title, comment | embedded XMP inside the image files | read + write via |
Thumbnails |
| read + write |
gThumb picks up everything this server writes on its next refresh — and vice versa.
Requirements
Linux with gThumb 3.12 (other 3.x versions likely work)
Python 3.12+ and uv
exiftool —
sudo apt install libimage-exiftool-perl(everything except the metadata tools works without it)
Related MCP server: Apple Photos MCP
Install
uv syncRun
uv run gthumb-mcp # MCP stdio serverRegister with an MCP client
opencode (~/.config/opencode/opencode.json):
{
"mcp": {
"gthumb": {
"type": "local",
"command": [
"uv", "--directory", "/absolute/path/to/gthumb-mcp", "run", "gthumb-mcp"
],
"enabled": true
}
}
}Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"gthumb": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/gthumb-mcp", "run", "gthumb-mcp"]
}
}
}Tools
Catalogs
Tool | Description |
| All catalogs and saved searches with item counts |
| The files stored in a catalog |
| New, empty catalog (supports subfolders, e.g. |
| Delete a catalog or saved-search file |
| Add images (duplicates skipped) |
| Remove images |
Tags
Tool | Description |
| All tags known to gThumb |
| Manage tag definitions |
| From the cached snapshot, or a live XMP scan of a directory |
Image metadata (embedded XMP, same fields gThumb writes)
Tool | Description |
| Dimensions, format, camera, date, GPS, title, description, tags, rating |
| Star rating |
| Set ( |
| Only non- |
Search & view
Tool | Description |
| Filter by filename glob, tag, rating and modification date |
| From the shared thumbnail cache ( |
| Image content, downscaled, for model viewing |
Convenience
Tool | Description |
| Open a file or directory in the gThumb desktop app |
Example session
User: Show me my catalogs, then the images tagged Beach.
{"tool": "list_catalogs"} → [{"name": "Favorites", "type": "catalog", "file_count": 42}, …] {"tool": "find_images_by_tag", "arguments": {"tag": "Beach"}} → {"source": "snapshot", "count": 118, "files": ["/home/user/Pictures/2024-07/beach_001.jpg", …]}User: Rate the first one 5 stars.
{"tool": "set_rating", "arguments": {"path": "/home/user/Pictures/2024-07/beach_001.jpg", "rating": 5}} → {"path": "/home/user/Pictures/2024-07/beach_001.jpg", "rating": 5}
How it works
Catalogs are parsed and rewritten as XML in exactly gThumb's format. All writes are atomic (temp file +
os.replace), so a crash can't corrupt gThumb's files.Tags on images are read/written as embedded XMP via exiftool, matching what gThumb 3.12 stores in its default store metadata in files mode:
gThumb field
XMP field
Title
XMP-dc:TitleDescription / comment
XMP-dc:DescriptionTags
XMP-dc:Subject(list)Rating
XMP-xmp:Rating(integer 0–5)Location
XMP-iptcCore:LocationNote the exiftool list semantics used here: plain
=assignments replace the whole tag list,+=appends, and an empty list withreplace=trueclears it.Thumbnails follow the freedesktop thumbnailer spec: the cache key is the MD5 of the image's
file://URI, and generated thumbnails carry the spec'sThumb::URI/Thumb::MTimeannotations. gThumb shares this cache, so thumbnails are generated at most once, no matter who requests them.find_images_by_tagreads gThumb's cached per-tag snapshot by default (fast, updated whenever gThumb runs a tag search). Pass adirectoryto instead scan the embedded XMP of files live — slower, but reflects the current file contents.If gThumb is running while catalogs change externally, refresh/reopen its library view to see the updates.
Configuration
Environment variable | Default | Purpose |
|
| tags.xml location |
|
| catalogs location |
|
| thumbnail cache root |
These redirects are mainly useful for testing; no gThumb installation is touched by the test suite.
Development
uv sync
uv run pytest # 13 tests; exiftool-dependent tests skip if exiftool is missingProject layout:
src/gthumb_mcp/
├── server.py # FastMCP-style server: 19 tools, stdio transport
├── paths.py # gThumb data locations (env-overridable)
├── catalogs.py # .catalog / .search XML parsing and atomic writing
├── tags.py # tags.xml and per-tag search snapshots
├── metadata.py # exiftool wrapper for embedded XMP
├── thumbnails.py # freedesktop thumbnail cache
└── util.py # file:// URI conversion, atomic writesLicense
This server cannot be deployed
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
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
The media memory layer for AI agents and their humans. Your AI client gets 29 tools to search your collection, add items, update ratings, preview music, and find patterns across everything you've read, watched, and listened to.
Independent directory of agentic AI tools — search, compare & recommend via MCP. Read-only.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceExposes a visual library with semantic search, tagging, editing, and management of photos as tools for AI agents like Claude Code.13 npm49MIT- AlicenseAqualityAmaintenanceEnables AI agents to search, inspect, organize, and export photos from a local Apple Photos library using natural language, including scene labels, text, faces, places, and albums.1328 npmMIT
- AlicenseBqualityAmaintenanceEnables AI agents to operate GIMP 3 end-to-end: open and inspect images, call every PDB procedure, apply GEGL filters destructively or as layer effects, measure pixels, render before/after/diff comparisons, cut out subjects with AI segmentation, and run multi-step recipes across folders.32120 PyPI5Apache 2.0
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to search, list, preview, and export photos from Apple Photos, Google Photos Picker sessions, and local Google Takeout archives using native search and metadata inspection.4 npmMIT