exif-mcp

exif-mcp

An MCP server that lets LLMs read and edit image metadata (EXIF, GPS, XMP, ICC, IPTC, and more) entirely offline. Supports files, URLs, base64, and includes a browser-based UI for analysis, GPS extraction, and metadata stripping.

Category
访问服务器

README

exif-mcp

An MCP server that allows LLMs (or humans) to read image metadata on-demand, entirely offline. Based on the excellent exifr library it's exremely fast and does not rely on any external tools.

Usecases:

  • Analyze image metadata and visualize it
  • Perform analysis of your image library: what are my most used cameras? Lens distribution? Which dates of the week I take most pictures on? Most favorite locations?
  • Debugging image manipulation code.

Ths tool is used extensively by the reverse geolocation service PlaceSpotter for development and testing.

Overview

exif-mcp is a Model Context Protocol (MCP) server that provides tools for extracting various metadata segments from images. Built with TypeScript, it leverages the excellent exifr library to parse metadata from images in common formats like JPEG, PNG, TIFF, and HEIC. This allows this service to parse image metadata without executing any external tools which allows it to be both highly efficient and secure.

Features

  • Local operation: Works completely offline with no remote network required
  • Multiple segments: Extracts EXIF, GPS, XMP, ICC, IPTC, JFIF, and IHDR metadata
  • Various input formats: Supports JPEG, TIFF, HEIC/AVIF, and PNG
  • Flexible image sources: Read from file system, URLs, base64 data, or buffers
  • Specialized tools: Get orientation, rotation info, GPS coordinates, and thumbnails

Installation

# 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

Usage

Claude Desktop

Put this into Claude config file (claude_desktop_config.json):

"mcpServers": {
    "exif-mcp": {
      "command": "node",
      "args": [
        "/path/to/exif-mcp/dist/server.js"
      ]
    }
  },

Restart Claude. Now you can ask Claude to inspect images for you or e.g. find files taken with specific camera. This works best in combination with filesystem MCP tools so Claude can find files and list directories.

Starting the server

# 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.

Available Tools

The following tools are provided by the server:

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
strip-metadata Removes all metadata (EXIF/GPS/XMP/ICC/IPTC) losslessly. JPEG & PNG
edit-exif Edits EXIF and GPS fields in a JPEG, returns the modified image
thumbnail Extracts embedded thumbnail

Web UI (browser)

A built-in web interface — the Metadata Lab — lets you use every feature from any browser without an MCP client:

npm run build
npm run web
# open http://localhost:3000

Add WEB_OPEN=1 to auto-open the browser, or change the port with WEB_PORT.

Analyze — drag & drop one or many images (or paste a URL) for instant metadata:

  • Summary cards (camera, lens, exposure, orientation), a full tag table, and raw JSON export
  • GPS coordinates with OpenStreetMap / Google Maps links and a one-click copy
  • Batch mode: every dropped image gets a thumbnail in a filmstrip you can switch between

Edit EXIF — edit camera fields (Make, Model, Software, dates, copyright…), set GPS coordinates, or clear GPS, then download a modified copy. The original file is never touched.

Clean — remove all metadata (EXIF, GPS, XMP, ICC, IPTC) from JPEG/PNG with one click. Lossless: only metadata segments are stripped, pixels are untouched.

The web server exposes a JSON API as well:

curl -X POST http://localhost:3000/api/analyze \
  -H 'Content-Type: application/json' \
  -d '{"image":{"kind":"path","path":"/path/to/photo.jpg"}}'

curl -X POST http://localhost:3000/api/strip \
  -H 'Content-Type: application/json' \
  -d '{"image":{"kind":"path","path":"/path/to/photo.jpg"}}'

curl -X POST http://localhost:3000/api/edit \
  -H 'Content-Type: application/json' \
  -d '{"image":{"kind":"base64","data":"..."},"fields":{"Make":"My Camera"},"gps":{"latitude":40.71,"longitude":-74.0}}'

Image sources match the MCP tool format (path, url, base64, buffer).

Debugging with MCP Inspector

  1. Start the inspector: npx @modelcontextprotocol/inspector node dist/server.js
  2. Connect to it with MCP Inspector using the STDIO transport
  3. Call a tool, e.g., read-metadata with parameter:
    {
      "image": {
        "kind": "path",
        "path": "/path/to/image.jpg"
      }
    }
    
  4. You cal also use MCP inspector command line like this: 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="[]"

Image Source Types

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..."
}

Development

Running Tests

# Run tests
npm test

# Run tests with watch mode
npm run test:watch

Project Structure

exif-mcp/
├── src/
│   ├── server.ts         # Main MCP entry point
│   ├── tools/
│   │   ├── index.ts      # Tool registration
│   │   ├── loaders.ts    # Image loading utilities
│   │   └── segments.ts   # exifr options builders
│   ├── web/
│   │   ├── server.ts     # Browser web server (API + static UI)
│   │   ├── image.ts      # Format detection, JPEG/PNG metadata stripping
│   │   └── edit.ts       # EXIF/GPS editing (piexifjs)
│   └── types/
│       └── image.ts      # Type definitions
├── web/
│   └── index.html        # Metadata Lab browser UI
├── tests/                # Test files
└── README.md

Error Handling

The server provides standardized error handling for common issues:

  • Unsupported formats or missing metadata
  • Network fetch failures
  • Oversized payloads
  • Internal exifr errors

License

BSD 2-clause

Acknowledgements

  • exifr - Extremely fast and robust EXIF parsing library

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选