DEV Community

Cover image for Drowning in Photos? Let a VS Code AI Agent Organize Them for You (No Coding Needed)

Drowning in Photos? Let a VS Code AI Agent Organize Them for You (No Coding Needed)

I have always enjoyed taking photos but like most people today, I am drowning in them. Unlike the good ol’ days where you had a roll of 24 or 36 shots and had to make each one count, nowadays a single trip leaves me with hundreds of images across my phone, camera, and cloud shares from friends. The real challenge isn’t taking photos anymore, but curating and organizing them.

Sure, you could upload everything into your favorite cloud storage provider and ask their built-in AI service to organize them for you. But why send terabytes over the wire (and hope some cloud AI doesn’t mislabel your dog as a toaster) when you can run the whole workflow locally? If you’re in the same boat as me, follow along and I’ll show you how I built a local-only Photo Organizer Agent using an LLM, custom MCP servers, and a bit of VS Code magic.

Before we begin, let’s clearly define our goal. We want the agent to:

  • Run locally on your machine
  • Recursively read files from a folder
  • Read image metadata (EXIF)
  • Organize these images based on your instructions

Pre-reqs

You’ll need:

  1. VS Code (latest) with GitHub Copilot – supports custom agents + MCP
  2. Node.js + npx – download from https://nodejs.org
  3. A folder of photos – I’ve downloaded all my photos from different sources into a single folder, e.g. C:/Images

1. Think like a human first: what tools do we need?

Before we talk about agents, let’s pretend we’re doing this manually. If I had to organize a huge folder of photos by hand, I’d need:

  1. A way to browse and manipulate files
  2. A way to inspect what’s inside each photo

Our AI agent needs those exact same capabilities:

  • One tool for working with the filesystem
  • One tool for reading EXIF metadata

In the MCP world, these tools are implemented as MCP servers that expose capabilities to the agent.

So our plan is to:

  1. Set up a Filesystem MCP server
  2. Set up an EXIF MCP server
  3. Create the agent that orchestrates both

2. Set up the MCP tools (Filesystem + EXIF)

2.1 Add MCP configuration

Create:

.vscode/mcp.json

{
  "servers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:/Images"
      ]
    },
    "exif": {
      "command": "node",
      "args": [
        "C:/path/to/exif-mcp/dist/server.js"
      ]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Filesystem MCP allows:

  • Listing directories
  • Listing files
  • stat operations
  • Move/copy/delete

EXIF MCP allows reading EXIF metadata:

  • Date taken
  • GPS
  • Camera
  • Other metadata

2.2 Install and build the EXIF MCP server

git clone https://github.com/stass/exif-mcp
cd exif-mcp
npm install
npm run build
Enter fullscreen mode Exit fullscreen mode

This creates:

dist/server.js
Enter fullscreen mode Exit fullscreen mode

Use its full path in your mcp.json.

You might be wondering: Why are we manually building the EXIF MCP server but not the filesystem server?
That’s because the Filesystem MCP is officially published and already available on npm. So VS Code can run it directly using npx, no setup required. It’s a general purpose server that works out-of-box for most common file operations.

The EXIF MCP server, however, is community developed and not published as a ready-made package. It needs to be cloned and built locally so that its logic for parsing EXIF metadata is available on your machine. Once built, VS Code treats both tools the same way but only the EXIF server requires a one-time local build step.

3. Create the Photo Organizer agent

Create:

.github/
  copilot/
    photo_organizer.agent.md
Enter fullscreen mode Exit fullscreen mode

Paste:

---
description: Local agent to organize photos on filesystem using EXIF metadata.
tools: ["filesystem/*", "exif/*"]
---
You are an expert photo organizing agent who can read and interpret EXIF metadata from image files. Your task is to help organize a large collection of photos stored on the local filesystem into a structured folder hierarchy based on the criteria provided by the user.

Rules:
- Never send raw image bytes anywhere; only work with file paths and text metadata.
- Always do a DRY RUN first:
  * Propose a folder structure and show which files you plan to move.
  * Wait for my confirmation before calling any move/delete operations but proceed with other read operations without my confirmation
- Prefer non-destructive actions unless I explicitly say "you can move files".
- When grouping:
  * Use EXIF date/time for year/month.
  * Use EXIF GPS to infer location
  * Keep logs of decisions in a summary at the end.
Enter fullscreen mode Exit fullscreen mode

4. Start the MCP servers

In VS Code, opening mcp.json shows Start buttons for each server. Click on start for both these servers and you should see them in Running state.

You can also start them via the MCP Servers extension view.

5. Start organizing!

Open GitHub Copilot Chat → select photo_organizer.

Say:

Organize all my photos based on the date taken
Enter fullscreen mode Exit fullscreen mode

The agent will:

  1. Scan all photos
  2. Extract EXIF metadata
  3. Propose folder structure
  4. Plan file moves
  5. Wait for confirmation

I wanted my agent to organize my photos not just by date taken, but also by whether the image had been edited or not and here is the response

Approve with:

This looks good, you can now move the files.
Enter fullscreen mode Exit fullscreen mode

Voila! Your gallery reorganizes itself (all locally).

A great foundation for future enhancements like:

  • Local vision models (Ollama + LLaVA)
  • Organizing photos by visual content
  • Auto-tagging and smart albums

Happy organizing!

Top comments (0)