exif-mcp is a Model Context Protocol (MCP) server that allows you to extract and analyze image metadata offline. Built on the exifr library, it enables reading EXIF data, GPS coordinates, color profiles and other metadata from images without relying on external tools or network connections.
To install and set up the exif-mcp server:
# Clone the repository
git clone https://github.com/stass/exif-mcp.git
cd exif-mcp
# Install dependencies
npm install
# Build the project
npm run build
To integrate with Claude Desktop, add the following to your Claude configuration file (claude_desktop_config.json):
"mcpServers": {
"exif-mcp": {
"command": "node",
"args": [
"/path/to/exif-mcp/dist/server.js"
]
}
}
Restart Claude after making these changes. You can then ask Claude to inspect images or find files taken with specific cameras.
# Start the server
npm start
# For development with auto-reload
npm run dev
The server uses the StdioServerTransport from the MCP SDK, making it compatible with any MCP client that supports STDIO transport. You can use mcp-proxy to enable remote access.
The server provides several specialized tools for metadata extraction:
Tool name | Description |
---|---|
read-metadata | Reads all or specified metadata segments |
read-exif | Reads EXIF data specifically |
read-xmp | Reads XMP data |
read-icc | Reads ICC color profile data |
read-iptc | Reads IPTC metadata |
read-jfif | Reads JFIF segment data |
read-ihdr | Reads IHDR segment data |
orientation | Gets image orientation (1-8) |
rotation-info | Gets rotation and flip information |
gps-coordinates | Extracts GPS coordinates |
thumbnail | Extracts embedded thumbnail |
You can use the MCP Inspector tool for debugging:
# Start the inspector
npx @modelcontextprotocol/inspector node dist/server.js
Connect to it with MCP Inspector using the STDIO transport, then call a tool, such as read-metadata:
{
"image": {
"kind": "path",
"path": "/path/to/image.jpg"
}
}
Alternatively, use the MCP inspector command line:
npx @modelcontextprotocol/inspector --cli node dist/server.js --method tools/call --tool-name read-exif --tool-arg image='{"kind": "path", "path": "/path/to/image.jpeg"}' --tool-arg pick="[]"
The server supports multiple ways to provide image data:
// From local file system
{
"kind": "path",
"path": "/path/to/image.jpg"
}
// From URL (http, https, or file://)
{
"kind": "url",
"url": "https://example.com/image.jpg"
}
// From base64 data (raw or data URI)
{
"kind": "base64",
"data": "data:image/jpeg;base64,/9j/4AAQSkZ..."
}
// From base64 buffer
{
"kind": "buffer",
"buffer": "/9j/4AAQSkZ..."
}
The server provides standardized error handling for common issues:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "exif-mcp" '{"command":"node","args":["/path/to/exif-mcp/dist/server.js"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"exif-mcp": {
"command": "node",
"args": [
"/path/to/exif-mcp/dist/server.js"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"exif-mcp": {
"command": "node",
"args": [
"/path/to/exif-mcp/dist/server.js"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect