Metadata-Version: 2.4
Name: mcpcn-image-info-mcp
Version: 0.1.0
Summary: 查看图片信息的 MCP 服务器，支持各种图片格式的元数据查询
Author-email: Your Name <your.email@example.com>
License: MIT
Keywords: exif,gif,image,mcp,metadata
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: mcp>=1.0.0
Requires-Dist: pillow>=10.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# 图片信息查看 MCP

查看图片详细信息的 MCP 服务器，支持多种图片格式的元数据查询。

## 功能特性

- **基本信息**：文件路径、大小、尺寸、格式、颜色模式
- **EXIF 数据**：拍摄设备、日期、曝光参数、GPS 坐标等（JPEG/TIFF）
- **动画信息**：帧数、时长、循环次数等（GIF/WebP 动画）
- **格式特有信息**：PNG 文本块等

## 支持的格式

- JPEG / JPG
- PNG
- GIF（包含动画信息）
- WebP（包含动画信息）
- TIFF
- BMP
- ICO

## 安装

```bash
cd /path/to/图片-查看图片信息
uv sync
```

## 使用方法

### 作为 MCP 服务器运行

```bash
uv run image-info-mcp
```

### Claude Desktop 配置

```json
{
  "mcpServers": {
    "image-info": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/图片-查看图片信息",
        "run",
        "image-info-mcp"
      ]
    }
  }
}
```

## 工具

### get_image_info

获取图片的详细信息。

**参数：**
- `file_path`: 图片文件路径

**返回示例（JPEG）：**
```json
{
  "file_path": "/path/to/photo.jpg",
  "file_name": "photo.jpg",
  "file_size_bytes": 2048576,
  "format": "JPEG",
  "size": {
    "width": 4000,
    "height": 3000
  },
  "color_mode": "RGB",
  "has_transparency": false,
  "dpi": [300, 300],
  "exif": {
    "camera_make": "Canon",
    "camera_model": "EOS R5",
    "date_time_original": "2024:01:15 14:30:00",
    "exposure_time": 0.004,
    "f_number": 2.8,
    "iso": 100,
    "focal_length": 50.0,
    "gps": {
      "latitude": 31.230416,
      "longitude": 121.473701
    }
  }
}
```

**返回示例（GIF）：**
```json
{
  "file_path": "/path/to/animation.gif",
  "file_name": "animation.gif",
  "file_size_bytes": 512000,
  "format": "GIF",
  "size": {
    "width": 800,
    "height": 600
  },
  "color_mode": "P",
  "has_transparency": true,
  "animation": {
    "is_animated": true,
    "frame_count": 24,
    "frame_durations_ms": [100, 100, ...],
    "total_duration_ms": 2400,
    "total_duration_seconds": 2.4,
    "loop_count_raw": 0,
    "playback_mode": "infinite_loop"
  }
}
```

## 许可证

MIT