Apple Photos MCP Server & CLI

A free, open source Apple Photos MCP server and CLI that lets Claude Code, Codex, Cursor and other AI agents search, look at and organize your library, on your Mac.

Navid Moazzezby Navid Moazzez·Updated Oct 5, 2026·12 min read·
  1. 1

    Add it with a single command in a terminal.

    claude mcp add apple-photos \
    -- npx -y @thenavidm/apple-photos-mcp-cli@latest
  2. 2

    In Claude Code, type /mcp. Apple Photos should show as connected.

    /mcp

Mac only. Needs Node 22 or newer, uv, and Full Disk Access for the app that runs it. Turn it on.

It's free and open source. If it saves you time, star it on GitHub, so more people find it.

Rate this tool

This free Apple Photos MCP server and CLI gives your AI real access to your own Apple Photos library, on your Mac. It searches everything Apple already indexed, looks at the photos, organizes them into albums and exports originals.

It's one install with two ways in. Claude, Codex, Cursor or any other MCP app calls its 13 tools for you, and the same tools work as a CLI that agents like Claude Code, Codex and OpenCode run, or that you type yourself.

In this guide, I'll show you:

  • What the Apple Photos MCP server & CLI is, and what you can ask it
  • How to install it and check that it works
  • When to use the MCP server, and when the CLI
  • Every tool, and how to keep your account safe

Every tool on this page comes from the server itself, and every cost was measured in Claude Code.

key_takeaways.mdTL;DR

Key takeaways

It gives Claude, Codex, Cursor and any other MCP app 13 tools to search, look at and organize your own Apple Photos library, on your Mac.
It searches what Apple already indexed on your Mac, and nothing is uploaded anywhere.
Nothing here can delete a photo, and archiving, the one tool that asks first, waits for your approval.
The same tools run as a CLI, which costs your AI nothing until it runs.

What is the Apple Photos MCP server & CLI?

The Apple Photos MCP server & CLI is a free, open source program that lets AI agents search and organize your own Apple Photos library for you, in two ways. The MCP server is what an AI app like Claude, Codex or Cursor connects to, through MCP (Model Context Protocol), the open standard AI apps use to call outside tools.

You ask in plain language. Your AI picks the right tool, and the server makes the call to your library, right on your Mac.

The CLI is the same program as commands. apple-photos-cli library-stats runs the same code your AI runs when you ask how many photos you have, whether an agent like Claude Code runs it or you do.

In an AI OS, the layer that connects your AI to your context, your data and your tools, a server like this is how your AI reaches Apple Photos. I explain how the parts fit together in how to build an AI operating system, and here's how I use AI myself.

What can you ask it?

Once it's set up, you ask the way you'd ask an assistant. These are real prompts it handles:

Try asking
Find my photo of that whiteboard from the Bogota trip.
Which receipts do I have from Vietnam?
Show me videos from Dubai in 2024.
How many photos do I have, and how many are just screenshots?
Add these 5 to an album called Best of Bali.
Export the original of that one to my Desktop.

The first one shows why this is useful. Apple already ran machine learning over every photo on your Mac, and this gives your AI that whole index, so it can search, cross-check and then look before it answers.

It works well next to my Google Photos MCP server and iMessage MCP server, so your AI can build albums in Google Photos and send a photo to someone in Messages in the same chat. Every server I've made is on my MCP servers page.

For the photos themselves, my free HEIC to JPG converter and image resizer help too.

How to install the Apple Photos MCP server

Pick your app in the box at the top of this page. Each one is a single command or a pasted block, and there's no account or key to add.

Windsurf, Zed and Cline take the same server, though they don't have a tab in the box yet. Follow the box's Cursor tab, and put its block here instead:

AppWhere the block goes
WindsurfIn the Cascade panel, open the Actions menu (…) and choose Open MCP config file, then paste the block.
ClineClick the MCP Servers icon in the Cline panel, open the Configure tab, click Configure MCP Servers, and paste the block.
ZedGo to Settings, then AI, then MCP Servers, and choose Add Server, then Add Local Server. Enter the block's command, arguments and variables, and Zed saves them under context_servers.
Before you start0/4

Pro tip: If you don't have uv yet, curl -LsSf https://astral.sh/uv/install.sh | sh installs it. The engine is Python because the only libraries that can read a Photos library are Python.

Give it access to your library

There's no sign-in. Your Photos library is protected, so the only setup is one macOS permission, once.

Turn on Full Disk Access0/4

Skipping that last step is the most common reason it looks broken.

The first time a tool changes something, macOS asks if the app may control Photos. Click OK, or find it later under Privacy & Security, then Automation.

Check that it works

Run the doctor. It checks the permission, finds your library and counts what Apple indexed.

npx -y @thenavidm/apple-photos-mcp-cli doctor

A healthy result shows how many photos it indexed. "permission denied" means Full Disk Access, and remember the Cmd+Q.

In Claude Code, /mcp also shows whether the Apple Photos server is connected. It's one of the Claude Code commands worth knowing.

Use the Apple Photos CLI

The CLI is the same 13 tools as commands. AI agents that run commands, like Claude Code, Codex and OpenCode, use it on their own, and you can type the same commands in a terminal or a script.

Every tool name becomes a command with dashes, so search_photos runs as apple-photos-cli search-photos.

npm install -g @thenavidm/apple-photos-mcp-cli
apple-photos-cli
apple-photos-cli library-stats
apple-photos-cli search-photos "sunset" --limit 5 --screenshots exclude

The bare apple-photos-cli lists every command, apple-photos-cli which <words> finds the command for a task, and apple-photos-cli <command> --help shows what a command takes. Archiving asks first, like it does for your AI.

apple-photos-cli install <app> adds the server to Claude Code, Codex, Claude Desktop, Cursor, VS Code or Gemini CLI, in each app's own format.

These are the flags you'll use most:

FlagWhat it does
--jsonPrints JSON
--compactPrints the JSON on one line
--select a,b.cKeeps only those fields

A script can branch on the exit code:

Exit codeWhat it means
0It worked
2The command was typed wrong, or a write needed --confirm
3A photo or album wasn't found
4macOS refused access, so turn on Full Disk Access or allow Automation for Photos
5The engine or Photos failed
10The engine couldn't start, so install uv

MCP server or CLI: which one?

Both are the same program with the same 13 tools. The difference is when your AI pays for them, in the tokens it reads.

Every message, in an app that loads every tool
MCP server
3,400 tokens
CLI
Nothing
Every message, in Claude Code
MCP server
650 tokens
CLI
Nothing
When Apple Photos comes up
MCP server
Nothing more, or in Claude Code the tools it picks
CLI
2,500 tokens, once
20 messages with Apple Photos in one, every tool loaded
MCP server
68,000 tokens
CLI
2,500 tokens
Works in Claude Desktop's chat
MCP server
Yes
CLI
No, there's no terminal there
Works in a script, a cron job or CI
MCP server
No
CLI
Yes

An app that loads every tool up front sends the full list with every message, whether you mention Apple Photos or not. Claude Code doesn't by default: its tool search sends only the tool names and the server's instructions, and loads a tool's full definition when your AI reaches for it.

The CLI costs nothing until Apple Photos comes up. Then your agent reads its skill file once and runs the commands it needs. With the skill added, Claude Code also lists its one-line description with every message, about 180 tokens.

When the whole conversation is about Apple Photos, the gap closes. Then the MCP server is the better experience, because you ask in plain language and your AI never has to look up a command.

How to spend less

In Claude Code, leave tool search on, which it is unless you've set ENABLE_TOOL_SEARCH=false.

Turn the server off when you aren't using your photos, with your AI app's own switch. APPLE_PHOTOS_READ_ONLY=1 cuts it to the seven reading tools.

Or install the CLI and connect the server later, on the days it earns its place. Every tool stays in reach, and the standing cost drops to nothing.

Every number here was measured on October 5, 2026 in Claude Code 2.1.286 with Claude Opus 5.5. It's the same one-line prompt with and without the server connected, once with tool search off so every tool loads, and once with Claude Code's default. The skill was measured the same way, and other apps and models count tokens a little differently.

What Apple Photos already knows

Apple indexed everything on your Mac: scene labels from a list of about 1,500 words, text it read inside each photo, the activity, the kind of place and the location. None of that needs the Photos app open to read.

Your own titles and keywords are almost certainly empty, so search for what a photo looks like, not what you called it. The word list is closed, so "golden hour" finds nothing while "Sunset" works, and list_vocabulary shows every word Apple knows.

Most of your photos live in iCloud, not on your Mac. Previews still work from Apple's cached thumbnails, and exporting an original downloads it first, which is why exporting is slow.

Faces only work for people you named in the People album.

Every Apple Photos tool

The tables below list all 13 tools, grouped the way the repo groups them. Of these, seven only read, and six change something in your library.

Search, look and organize

search_photos
What it does
Search the entire Photos library through Apple's own on-device index: what a picture looks like, text read inside it, the place, the activity, and any named faces.
Kind
Reads
look_at_photos
What it does
Return the images themselves so they can be looked at, rather than reasoned about from filenames and labels.
Kind
Reads
photo_info
What it does
Everything Photos knows about specific items: date, place, camera and lens, dimensions, albums, keywords, faces, and whether the original is on this Mac or still in iCloud.
Kind
Reads
library_stats
What it does
Real totals for the whole library in one call: items, photos against videos, favourites, screenshots, how many carry ML labels, text or a place, named people, and every album.
Kind
Reads
list_vocabulary
What it does
List the scene labels Apple's index understands.
Kind
Reads
doctor
What it does
Check that the Photos library is reachable, the engine starts, and this Mac has granted the permissions needed.
Kind
Reads
export_originals
What it does
Export the original files to a folder on this Mac.
Kind
Reads
favorite_photos
What it does
Mark items as favourites, or clear the mark.
Kind
Writes
set_photo_title
What it does
Set the title on one item, as shown in Photos.
Kind
Writes
set_photo_description
What it does
Set the description, the caption field Photos shows under an item.
Kind
Writes
add_keywords
What it does
Add keywords to items.
Kind
Writes
add_to_album
What it does
Add items to an album, creating it if it does not exist.
Kind
Writes
archive_photos
What it does
Move items into an album for the user to review and empty by hand.
Kind
Asks first

Is the Apple Photos MCP server safe?

Organizing works from the start, because that's the point of the tool. Nothing here can delete a photo, since macOS doesn't allow it for any app. Archiving moves photos into an album you empty yourself, and it's the only tool that asks first, marked "Asks first" in the tool tables above.

Everything else is one click to undo in Photos, so it doesn't ask.

When your AI calls one of them, the call needs a yes first. Where you use it decides who gives it:

  • Claude Code (2.1.246 and later) asks you before every call, in every one of its permission modes.
  • An app that can show forms asks you in a form.
  • Any other app takes your AI's confirm: true as the yes, so tell your AI to check with you first.
  • An agent with no person to ask needs APPLE_PHOTOS_CONFIRM=model, so its confirm: true counts in every app.
  • In a terminal, you add --confirm to the command.

If the answer is no, nothing reaches Apple Photos.

Make it read-only

Set APPLE_PHOTOS_READ_ONLY=1 and every write disappears from the tool list, leaving seven reading tools. That's the right setting for an agent working on its own.

Keep a log of every write

Set APPLE_PHOTOS_AUDIT_LOG to a file path. The server writes one line per attempted write, allowed or blocked, with what it was about to do and who approved it.

Watch out: Text read out of your photos is mostly things you photographed, so the risk is far smaller than a public feed. A screenshot of a web page can still carry instructions, so use APPLE_PHOTOS_READ_ONLY=1 for unattended work.

Your data

Nothing leaves your Mac. There's no server of ours, no account and no tracking of any kind.

The search index and the previews live in ~/.apple-photos-mcp/, and deleting that folder clears them. The previews your AI looks at are sent to the AI you're talking to, like attaching a photo to a chat yourself.

Apple Photos MCP server settings

Every setting is optional, as an environment variable in your app's config.

APPLE_PHOTOS_READ_ONLY
Default
off
What it does
1 hides every write
APPLE_PHOTOS_AUDIT_LOG
Default
off
What it does
Logs every attempted write to a file
APPLE_PHOTOS_LIBRARY
Default
the last one opened
What it does
Points at a specific Photos library
APPLE_PHOTOS_EXPORT_DIR
Default
~/Downloads/Photos Exports
What it does
Sets where exports go
APPLE_PHOTOS_PREVIEW_MAX
Default
8
What it does
Sets how many photos one look shows
APPLE_PHOTOS_WRITE_BATCH_MAX
Default
100
What it does
Sets the most photos one change can touch
APPLE_PHOTOS_ARCHIVE_ALBUM
Default
Archived by Claude
What it does
Names the album archived photos go into
APPLE_PHOTOS_PYTHON
Default
uv fetches them on demand
What it does
A Python that has osxphotos and photoscript
APPLE_PHOTOS_PYTHONPATH
Default
the copy shipped with this package
What it does
Where the engine's package lives
APPLE_PHOTOS_STARTUP_TIMEOUT_MS
Default
none
What it does
How long the engine may take to start; 300000, since a cold uv run builds pyobjc
APPLE_PHOTOS_REQUEST_TIMEOUT_MS
Default
none
What it does
How long one call may take; 300000
APPLE_PHOTOS_PREVIEW_DIR
Default
none
What it does
Where look_at_photos renders previews
APPLE_PHOTOS_PREVIEW_PX
Default
none
What it does
The default preview size in pixels
APPLE_PHOTOS_ALLOW_DESTRUCTIVE
Default
on
What it does
0 refuses the writes that can't be undone
APPLE_PHOTOS_SURFACE
Default
full
What it does
search lists three tools that find, describe and run the rest
APPLE_PHOTOS_TOOL_TIMEOUT_MS
Default
none
What it does
Gives up on any tool after this many milliseconds
APPLE_PHOTOS_CONFIRM
Default
human
What it does
model lets your AI's confirm: true approve on its own, for an agent with no person to ask
APPLE_PHOTOS_HTTP_PORT
Default
8787
What it does
Sets the port for --http
APPLE_PHOTOS_HTTP_HOST
Default
127.0.0.1
What it does
Sets the address for --http, and any other needs a token
APPLE_PHOTOS_HTTP_TOKEN
Default
none
What it does
Sets the bearer token every --http request needs
APPLE_PHOTOS_HTTP_ALLOWED_ORIGINS
Default
none
What it does
Lists other websites allowed to call --http, comma separated
APPLE_PHOTOS_DEBUG
Default
off
What it does
1 prints debug lines

Troubleshooting

Run the doctor first. It names the step that failed and the fix.

What you seeWhat to do
Permission denied reading the libraryTurn on Full Disk Access, then quit the app with Cmd+Q
The server doesn't show up in your appThe config has a bad comma. Paste it into a JSON checker
npx: command not foundThe app can't see your PATH. Use the full path from which npx
Reading works, changes failApprove the Photos control popup, or allow it under Privacy & Security, then Automation
The first search takes half a minuteIt's building the index once, about 25 seconds for 37,000 photos
An obvious word finds nothingApple has no such label. Check unmatched_terms, or run list_vocabulary

If the server doesn't show up in your app at all, run the command your app runs, in a terminal, and read the error.

More free tools for your photos

Turn photos into a carousel for Instagram, or into images to share.

FAQs about the Apple Photos MCP server & CLI

Here are the questions people ask most about the Apple Photos MCP server and CLI.

The Apple Photos MCP server & CLI is a free, open source program that lets an AI app like Claude, Codex or Cursor search and organize your own Apple Photos library.

It has 13 tools to search, look at, organize and export your own library, entirely on your Mac, and the same tools run as a CLI that agents like Claude Code and Codex use, or that you type yourself.

An MCP server is a standard way to give an AI app real access to a tool, so it can act instead of guessing.

MCP stands for Model Context Protocol, and Claude, Codex, Cursor and many other AI apps speak it.

Every server I've made is on my MCP servers page.

The Apple Photos CLI is the same program as the Apple Photos MCP server, run as commands.

AI agents like Claude Code, Codex and OpenCode run them for you, and you can type them in a terminal or a script.

One npm package installs both.

Use the Apple Photos MCP server in an AI app with no terminal, like Claude Desktop's chat, and the CLI in a terminal, a script or a cron job.

In an AI app that can run commands, like Claude Code, Codex or Cursor, the CLI is the lighter choice, because it costs nothing until it runs.

Yes, the Apple Photos MCP server is free and open source under the MIT license.

It needs no account and no key, just your Mac.

No, the Apple Photos MCP server works entirely on your Mac, with no account and no tracking.

Only the previews your AI looks at go to that AI, like attaching a photo to a chat.

No, the Apple Photos MCP server can't delete a photo, because macOS doesn't allow it for any app.

Archiving moves photos into an album you empty yourself, and it asks first.

No, the Apple Photos MCP server only runs on a Mac, because it reads the Photos library macOS keeps.

It needs Full Disk Access for the app that runs it.

The Apple Photos MCP server searches Apple's own labels, a closed list of about 1,500 words.

When a word isn't on it, the result says so, and list_vocabulary shows every word Apple knows.

The Apple Photos MCP server works with any app that speaks MCP.

That includes Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf, Zed, Cline, GitHub Copilot CLI, Gemini CLI, OpenCode, OpenClaw, Antigravity and Hermes, on your Mac.

I did.

I'm Navid Moazzez, and I made the Apple Photos MCP server & CLI as one of my free tools on navid.me.

You can read more about me.

The code is on GitHub under the MIT license, and the package is on npm.

More MCP servers & CLIs

Related free tools

Navid Moazzez

AI business strategist & AI OS builder

Navid Moazzez helps creators and founders master AI and build their own AI Operating System (AI OS) to automate their business and life.

Navid.me is reader-supported. When you buy through links on this site, I may earn an affiliate commission. Read the affiliate disclaimer.

Free AI newsletter

The most actionable AI newsletter for founders

Every week, get proven AI strategies, curated tools, and step-by-step systems to grow your audience, create better content, and build a profitable creator business.

No fluff, no filler, no BS. Just five minutes each week that might level up your online business and life.

P.S. Sign up now to get free access to my ultimate AI tools guide for creators.

Loved by 10,000+ readers
Loved by 10,000+ readers