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 解析库
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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,5036MIT
- Alicense-qualityDmaintenanceAn MCP server that enables LLMs to analyze video content by extracting frames as base64 images and retrieving video metadata using ffmpeg.12MIT
- AlicenseAqualityDmaintenanceMCP server providing image analysis tools for AI agents, including metadata extraction, favicon discovery, and placeholder generation.544MIT
- Alicense-qualityBmaintenanceA 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
Related MCP Connectors
MCP server for Flux AI image generation
MCP server for NanoBanana AI image generation and editing
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/stass/exif-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server