exif-mcp
exif-mcp
一个 MCP 服务器,允许 LLM(或人工)按需读取图像元数据,完全离线。它基于优秀的 exifr 库,速度极快,并且不依赖任何外部工具。
用例:
分析图像元数据并将其可视化
分析你的图片库:我最常用的相机有哪些?镜头分布如何?每周哪天我拍照最多?最喜欢的拍摄地点有哪些?
调试图像处理代码。
该工具被反向地理定位服务PlaceSpotter广泛用于开发和测试。
概述
exif-mcp是一个模型上下文协议 (MCP) 服务器,提供从图像中提取各种元数据片段的工具。它基于 TypeScript 构建,并利用优秀的exifr库来解析 JPEG、PNG、TIFF 和 HEIC 等常见格式的图像元数据。这使得该服务无需执行任何外部工具即可解析图像元数据,从而既高效又安全。
特征
本地操作:完全离线工作,无需远程网络
多个片段:提取 EXIF、GPS、XMP、ICC、IPTC、JFIF 和 IHDR 元数据
多种输入格式:支持 JPEG、TIFF、HEIC/AVIF 和 PNG
灵活的图像源:从文件系统、URL、base64 数据或缓冲区读取
专用工具:获取方向、旋转信息、GPS 坐标和缩略图
Related MCP server: mcp-video
安装
# 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用法
克劳德桌面
将其放入 Claude 配置文件(claude_desktop_config.json):
"mcpServers": {
"exif-mcp": {
"command": "node",
"args": [
"/path/to/exif-mcp/dist/server.js"
]
}
},重启 Claude。现在您可以让 Claude 帮您检查图片,例如查找特定相机拍摄的文件。此功能最好与文件系统 MCP 工具结合使用,这样 Claude 就可以查找文件并列出目录。
启动服务器
# Start the server
npm start
# For development with auto-reload
npm run dev该服务器使用 MCP SDK 中的StdioServerTransport ,使其与任何支持 STDIO 传输的 MCP 客户端兼容。
您可以使用 mcp-proxy 来启用远程访问。
可用工具
服务器提供以下工具:
工具名称 | 描述 |
| 读取所有或指定的元数据段 |
| 专门读取 EXIF 数据 |
| 读取 XMP 数据 |
| 读取 ICC 颜色配置文件数据 |
| 读取 IPTC 元数据 |
| 读取JFIF段数据 |
| 读取 IHDR 段数据 |
| 获取图像方向(1-8) |
| 获取旋转和翻转信息 |
| 提取 GPS 坐标 |
| 提取嵌入的缩略图 |
使用 MCP Inspector 进行调试
启动检查器:
npx @modelcontextprotocol/inspector node dist/server.js使用 STDIO 传输与 MCP Inspector 连接
调用一个工具,例如带有参数的
read-metadata:{ "image": { "kind": "path", "path": "/path/to/image.jpg" } }您还可以像这样使用 MCP 检查器命令行:
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="[]"
图像源类型
服务器支持多种方式提供图像数据:
// 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..."
}发展
运行测试
# Run tests
npm test
# Run tests with watch mode
npm run test:watch项目结构
exif-mcp/
├── src/
│ ├── server.ts # Main entry point
│ ├── tools/
│ │ ├── index.ts # Tool registration
│ │ ├── loaders.ts # Image loading utilities
│ │ └── segments.ts # exifr options builders
│ └── types/
│ └── image.ts # Type definitions
├── tests/ # Test files
└── README.md错误处理
服务器针对常见问题提供了标准化的错误处理:
不支持的格式或缺少元数据
网络获取失败
超大有效载荷
内部 exifr 错误
执照
BSD 2 条款
致谢
exifr - 极其快速且强大的 EXIF 解析库
Available Tools
11 toolsgps-coordinatesB
Extract GPS coordinates (latitude/longitude) from image metadata
Inputs: image (required).
orientationB
Get image orientation value (1-8)
Inputs: image (required).
read-exifB
Read EXIF data from an image with optional tag filtering
Inputs: image (required), pick.
read-iccC
Read ICC metadata from an image
Inputs: image (required).
read-ihdrB
Read IHDR metadata from an image
Inputs: image (required).
read-iptcB
Read IPTC metadata from an image
Inputs: image (required).
read-jfifC
Read JFIF metadata from an image
Inputs: image (required).
read-metadataC
Read all or specified metadata segments from an image
Inputs: image (required), segments.
read-xmpA
Read XMP metadata from an image with option for extended XMP segments
Inputs: image (required), extended.
rotation-infoB
Get detailed rotation and flip information from image orientation
Inputs: image (required).
thumbnailB
Extract embedded thumbnail from image as base64 data or URL
Inputs: image (required), url.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools have clearly distinct purposes focused on different metadata types (EXIF, ICC, IHDR, IPTC, JFIF, XMP, GPS, orientation, thumbnail), but there is some overlap between 'read-exif' and 'read-metadata' since EXIF is a type of metadata, which could cause mild confusion. The 'orientation' and 'rotation-info' tools also cover similar ground, though with different detail levels.
Tool names follow a highly consistent verb-noun pattern with 'read-' prefixes for metadata extraction tools (e.g., read-exif, read-icc, read-ihdr) and descriptive names for other functions (e.g., gps-coordinates, orientation, thumbnail). All names use kebab-case consistently, making them predictable and easy to parse.
With 11 tools, the server is well-scoped for extracting various types of image metadata, covering common formats like EXIF, ICC, and XMP, as well as specific functions like GPS and thumbnails. Each tool appears to serve a distinct purpose without unnecessary duplication, fitting the domain appropriately.
The tool set provides comprehensive coverage for reading and extracting image metadata, including all major standards (EXIF, ICC, IHDR, IPTC, JFIF, XMP) and practical utilities (GPS coordinates, orientation, thumbnails). There are no obvious gaps for the server's purpose, as it supports both broad and specific metadata access without dead ends.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- AlicenseAqualityAmaintenanceManage your self-hosted Immich photo library through conversation — natural language search via CLIP, geographic album curation, duplicate detection with perceptual hashing,94359 PyPI62MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to analyze video content by extracting frames as base64 images and retrieving video metadata using ffmpeg.5 npmMIT
- AlicenseAqualityDmaintenanceMCP server providing image analysis tools for AI agents, including metadata extraction, favicon discovery, and placeholder generation.557 npmMIT
- AlicenseNot gradedqualityDmaintenanceA local Ollama-backed MCP server that gives coding assistants a portable photo-understanding toolset including photo analysis, OCR, scene inspection, comparison, and metadata extraction.MIT