MCP Image Metadata Server

MCP Image Metadata Server

Extracts rich metadata from images including EXIF, GPS, IPTC, and XMP, with x402 payment support for monetized usage.

Category
访问服务器

README

MCP Image Metadata Server

MCP server for extracting rich metadata from images, monetized via x402 payments.

Live Demo

Server: https://mcp-image-metadata.onrender.com


Quick Start

1. Upload Image

curl -X POST https://mcp-image-metadata.onrender.com/upload \
  -F "image=@your-image.jpg"

Response:

{
  "success": true,
  "filePath": "/tmp/uploads/abc123.jpg",
  "fileName": "abc123.jpg",
  "originalName": "your-image.jpg",
  "size": 12345
}

2. Extract Metadata

curl -X POST https://mcp-image-metadata.onrender.com/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "extract_image_metadata",
      "arguments": {
        "imageUrl": "/tmp/uploads/abc123.jpg",
        "payer": "0xYourWalletAddress"
      }
    }
  }'

Response:

{
  "success": true,
  "data": {
    "file": {
      "width": 1920,
      "height": 1080,
      "format": "jpeg",
      "colorDepth": 3,
      "dpi": 72,
      "fileSize": 456789,
      "mimeType": "image/jpeg"
    },
    "exif": {
      "cameraMake": "Apple",
      "cameraModel": "iPhone 14 Pro",
      "dateTime": "2024:01:15 12:30:00"
    },
    "gps": {
      "latitude": 37.7749,
      "longitude": -122.4194
    }
  },
  "price": 0.002,
  "paymentStatus": "free",
  "freemiumRemaining": 49
}

API Endpoints

Endpoint Method Description
/mcp POST MCP JSON-RPC interface
/upload POST Upload image file
/health GET Health check

MCP Tools

1. extract_image_metadata

Extract EXIF, GPS, IPTC, XMP metadata from an image.

Arguments:

{
  "imageUrl": "/tmp/uploads/abc123.jpg",
  "includeOptions": {
    "includeGps": true,
    "includeColor": true,
    "includeThumbnail": false,
    "includeOcr": false,
    "includeDeepHash": false
  },
  "paymentHeader": "...",
  "payer": "0xYourWallet"
}

Response:

{
  "success": true,
  "data": { "file": {...}, "exif": {...}, "gps": {...} },
  "price": 0.002,
  "paymentStatus": "free",
  "freemiumRemaining": 50
}

2. extract_batch_metadata

Extract metadata from multiple images (max 50).

Arguments:

{
  "imageUrls": ["/tmp/uploads/1.jpg", "/tmp/uploads/2.jpg"],
  "options": { "includeGps": true },
  "paymentHeader": "...",
  "payer": "0xYourWallet"
}

3. detect_image_manipulation

Analyze image for signs of manipulation/editing.

Arguments:

{
  "imageUrl": "/tmp/uploads/abc123.jpg",
  "analysisLevel": "standard",
  "paymentHeader": "...",
  "payer": "0xYourWallet"
}

analysisLevel:

  • basic - Basic checks ($0.002)
  • standard - Standard analysis ($0.002)
  • forensic - Deep forensic analysis ($0.015)

4. get_pricing

Get current pricing tiers and freemium status.

Arguments:

{
  "payer": "0xYourWallet"
}

Response:

{
  "pricing": {
    "basic": { "tier": "basic", "price": 0.001 },
    "standard": { "tier": "standard", "price": 0.002 },
    "premium": { "tier": "premium", "price": 0.005 },
    "forensic": { "tier": "forensic", "price": 0.015 }
  },
  "freemium": { "limit": 50, "remaining": 49 }
}

Complete Usage Flow

Step 1: Upload Image

# Upload image
curl -X POST https://mcp-image-metadata.onrender.com/upload \
  -F "image=@photo.jpg"

Response:

{
  "success": true,
  "filePath": "/tmp/uploads/abc123.jpg"
}

Step 2: Extract Metadata

curl -X POST https://mcp-image-metadata.onrender.com/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "extract_image_metadata",
      "arguments": {
        "imageUrl": "/tmp/uploads/abc123.jpg",
        "payer": "0xYourWallet123"
      }
    }
  }'

Step 3: Get Updated Freemium Status

curl -X POST https://mcp-image-metadata.onrender.com/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "get_pricing",
      "arguments": {
        "payer": "0xYourWallet123"
      }
    }
  }'

Pricing

Tier Price Description
Basic $0.001 USDC File info, dimensions, color profile
Standard $0.002 USDC Basic + GPS, IPTC, XMP
Premium $0.005 USDC Standard + thumbnail, deep hash
Forensic $0.015 USDC Premium + manipulation analysis

Freemium

  • 50 free requests per wallet address
  • After 50, requires x402 payment
  • Usage tracked in memory (resets on server restart)

x402 Payment Integration

For Agents/Apps

To make paid requests, include the paymentHeader:

{
  "name": "extract_image_metadata",
  "arguments": {
    "imageUrl": "/tmp/uploads/abc123.jpg",
    "payer": "0xYourWallet",
    "paymentHeader": "payment=v1_USDC_..."
  }
}

Payment Flow

  1. Agent calls tool with x402 payment header
  2. Server verifies payment via xpay facilitator
  3. If valid → returns metadata
  4. If invalid → returns error
  5. USDC transfers to your wallet on Base


Deployment

Render (Recommended)

  1. Push to GitHub
  2. Go to render.com → New → Web Service
  3. Connect your repo
  4. Configure:
Setting Value
Name mcp-image-metadata
Region Oregon
Build Command npm install && npm run build
Start Command node dist/index.js
  1. Add Environment Variables (see above)
  2. Deploy

Local Development

# Install dependencies
npm install

# Build
npm run build

# Run (stdio mode)
npm run dev

# Run with HTTP server
PORT=3000 node dist/index.js

Supported Image Formats

  • JPEG/JPG
  • PNG
  • GIF
  • WebP
  • TIFF
  • HEIC
  • BMP
  • SVG

Tech Stack

  • Node.js 20+
  • TypeScript
  • @modelcontextprotocol/sdk ^1.29.0
  • Sharp (image processing)
  • ExifReader (metadata parsing)
  • Express (HTTP server)
  • Multer (file uploads)

Security

This server implements multiple security measures:

  • Path Traversal Protection: File paths are validated to prevent directory traversal attacks
  • MIME Type Validation: Uploaded files are validated against allowed image types
  • Input Validation: Zod schemas reject path traversal patterns in user input
  • Error Sanitization: Error messages are sanitized to prevent information leakage
  • Rate Limiting: HTTP endpoints are protected with rate limiting (100 req/min per IP)
  • CORS Configuration: Optional origin validation for cross-origin requests
  • Security Logging: Security-relevant events are logged for monitoring

Security Configuration

# Optional: comma-separated list of allowed origins
ALLOWED_ORIGINS=https://example.com,https://app.example.com

# Optional: rate limit window in milliseconds (default: 60000)
RATE_LIMIT_WINDOW=60000

# Optional: max requests per window per IP (default: 100)
RATE_LIMIT_MAX=100

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选