Skip to main content
Glama
AI Image Metadata Cleaner

AI Image Metadata Cleaner

Python MCP SDK Transport C2PA Purge Buy Me A Coffee License

πŸ›‘οΈ AI Image Metadata Cleaner (MCP Server)

High-performance Model Context Protocol (MCP 2.x) server designed to strip AI provenance tags (C2PA, EXIF, XMP, IPTC), disrupt invisible frequency watermarks, and simulate authentic camera sensor physics.


πŸ’‘ Purpose

Modern generative AI tools (Midjourney, DALL-E, Adobe Firefly, Canva, Stable Diffusion) embed cryptographic provenance manifests (C2PA / JUMBF), invisible spatial watermarks, and prompt parameters into every generated image.

Major platforms like LinkedIn, Twitter/X, and algorithmic newsfeeds automatically read these tags to label, flag, or suppress organic reach of content.

The purpose of AI Image Metadata Cleaner is to give creators and developers complete sovereign control over their media by:

  1. Scrubbing 100% of embedded tracking provenance and generator signatures.

  2. Disrupting invisible frequency-domain watermarks without visual quality loss.

  3. Restoring physical camera realism (CMOS sensor grain, optical PSF) so images blend seamlessly with authentic photography.


Related MCP server: Notarize

🎯 Real-World Use Cases

Use Case

Description

LinkedIn Posts & Profile Media

Prevent LinkedIn from automatically attaching "AI-generated" labels, reducing reach penalties or triggering account restriction reviews.

Social Media & Content Marketing

Publish AI-assisted blog banners, promotional graphics, and tech memes without algorithmic downranking across platforms.

Privacy & Anti-Fingerprinting

Strip embedded generation prompts, seed parameters, workflow graphs (ComfyUI), and system timestamps before sharing publicly.

Portfolio & Headshot Naturalization

Transform synthetic, plastic-looking portraits into authentic-looking shots by adding realistic CMOS photon grain and lens falloff.

Batch Asset Pipeline Automation

Automatically sanitize entire folders of marketing assets or user uploads via the batch_sanitize_directory tool.


⚑ How Platforms Detect AI Images

  1. C2PA / Content Credentials Metadata: Embedded in JPEG APP11 (JUMBF) segments, PNG c2pa/caPt chunks, and XMP packets declaring synthetic origin.

  2. Invisible / Frequency-Domain Watermarks: Encoded in latent frequency space (e.g. Google SynthID, latent diffusion watermarks).

  3. Statistical AI Footprints: Unnaturally smooth surfaces with 0 variance (absence of camera sensor photon noise) and transposed-convolution grid harmonics.

  4. Suspicious Zero Metadata: Heuristic checkers often flag files with 0 EXIF. Injected authentic camera EXIF (iPhone 15 Pro, Sony A7 IV) passes authenticity audits.


πŸ› οΈ MCP Tools

Tool

Type

Description

anti_ai_sanitize

Flagship

Full pipeline: strips C2PA/EXIF, executes 0.3% micro-resample, injects luminance-adaptive CMOS grain, and embeds realistic camera EXIF.

strip_metadata_only

Utility

Fast, lossless metadata stripping (EXIF, XMP, IPTC, C2PA) without altering pixel values.

inspect_image_metadata

Audit

Deep diagnostic inspection scanning for C2PA byte manifests, AI keywords, and risk assessment.

inject_camera_profile

Stealth

Injects authentic camera EXIF into clean JPEG images.

get_camera_profiles

Info

Returns list of supported camera profiles and optical specifications.

batch_sanitize_directory

Automation

Batch-sanitizes an entire directory of images with parallel processing.


πŸ“· Supported Realistic Camera Profiles

  • iphone_15_pro: Apple iPhone 15 Pro (iOS 17.5.1, 24mm f/1.78, ISO 80, 1/120s)

  • sony_a7iv: Sony Alpha A7 IV (FE 24-70mm F2.8 GM II, f/2.8, 50mm, ISO 160)

  • samsung_s24_ultra: Samsung Galaxy S24 Ultra (6.3mm f/1.7, ISO 100)

  • canon_r6: Canon EOS R6 Mark II (RF24-105mm F4 L IS USM, ISO 200)


πŸš€ Installation & Setup

Requirements

  • Python 3.10+

  • uv (recommended) or pip

# Clone the repository
git clone https://github.com/satyamkumar420/ai-image-meta-cleaner.git
cd ai-image-meta-cleaner

# Create and activate virtual environment
uv venv .venv
source .venv/bin/activate

# Install dependencies
uv pip install -r requirements.txt

Running Tests

pytest -v

βš™οΈ MCP Configuration

Add this server to your mcp_config.json (Antigravity, Claude Desktop, Cursor):

{
  "mcpServers": {
    "meta-cleaner": {
      "command": "/path/to/ai-image-meta-cleaner/.venv/bin/python",
      "args": [
        "-u",
        "/path/to/ai-image-meta-cleaner/server.py"
      ],
      "env": {
        "PYTHONPATH": "/path/to/ai-image-meta-cleaner"
      }
    }
  }
}

β˜• Support & Sponsor

If you find AI Image Metadata Cleaner helpful and want to support its maintenance:

Scan the QR code or click the button above to buy me a coffee! Thank you for your support! β˜•βœ¨


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

6 tools
anti_ai_sanitizeA

Full anti-AI pipeline: strips C2PA/EXIF, disrupts lattices/watermarks, and adds camera physics.

Args: image_path: Path to the target AI image. output_path: Optional path to save sanitized image. Defaults to '_sanitized.jpg'. camera_profile: Camera profile to inject ('none', 'iphone_15_pro', 'sony_a7iv', 'samsung_s24_ultra', 'canon_r6'). add_sensor_grain: If True, injects luminance-weighted CMOS sensor noise. grain_intensity: Noise intensity (1.0 to 2.5, default 1.4). micro_resample: If True, resamples by 0.3% with Lanczos to break frequency watermarks. simulate_lens: If True, applies optical point-spread function simulation. quality: JPEG compression quality (default 95).

Returns: Detailed status of all applied anti-detection layers and output path.

Inputs: image_path (required), quality, output_path, simulate_lens, +4 more. Returns: result

batch_sanitize_directoryB

Sanitizes all images in a target directory with anti-AI detection processing.

Args: directory_path: Directory containing images to process. output_directory: Optional folder to save sanitized images. camera_profile: Camera profile to inject ('iphone_15_pro', etc.). grain_intensity: Sensor noise level (default 1.4).

Returns: Summary of processed images and outcomes.

Inputs: directory_path (required), camera_profile, grain_intensity, output_directory. Returns: result

get_camera_profilesA

Returns available camera profiles and their specifications.

Inputs: no named parameters. Returns: result

inject_camera_profileB

Injects realistic camera EXIF (iPhone, Sony, Canon, Samsung) into a clean JPEG.

Args: image_path: Path to the JPEG image file. profile_name: Camera profile id ('iphone_15_pro', 'sony_a7iv', 'samsung_s24_ultra', 'canon_r6'). output_path: Optional destination file path.

Returns: Confirmation with injected hardware parameters.

Inputs: image_path (required), output_path, profile_name. Returns: result

inspect_image_metadataA

Inspects an image for AI detection risks, C2PA manifests, and EXIF footprints.

Args: image_path: Absolute or relative path to the image file.

Returns: Diagnostic audit detailing C2PA presence, keywords, and AI risk level.

Inputs: image_path (required). Returns: result

strip_metadata_onlyA

Strips all metadata, C2PA manifests, and EXIF tags without modifying pixels.

Args: image_path: Path to the input image file. output_path: Optional path for cleaned output image. quality: JPEG/WebP compression quality (1-100, default 95).

Returns: Summary of cleaned image and stripped markers.

Inputs: image_path (required), quality, output_path. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 6 tools

    Disambiguation4/5

    Most tools have distinct purposesβ€”strip, sanitize, inspect, batch, profile list/injectβ€”but strip_metadata_only and anti_ai_sanitize overlap in metadata removal, and inject_camera_profile vs anti_ai_sanitize could be confused for camera injection. Descriptions help clarify, so only minor ambiguity.

    Naming Consistency3/5

    Names are readable but inconsistent in structure: strip_metadata_only, get_camera_profiles, inspect_image_metadata, and inject_camera_profile follow verb_noun, while anti_ai_sanitize and batch_sanitize_directory deviate (adjective_noun_verb or adverb_verb_noun). This mixing makes the naming pattern less predictable.

    Tool Count5/5

    Six tools is well-scoped for an image metadata cleaner/anti-AI sanitizer. Each tool serves a clear need: single-file strip, full sanitize, batch processing, inspection, and camera profile retrieval/injection. No redundant or unnecessary tools.

    Completeness4/5

    The surface covers core workflows: inspect, strip, sanitize, inject, and batch sanitize. Minor gaps include no batch inspect or batch strip-only operation, and no way to selectively remove only C2PA while keeping EXIF, but these are workarounds via existing tools.

    Related MCP Connectors

    Related MCP Servers