image-forensics-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@image-forensics-mcp Analyze this image for AI generation: /path/to/image.jpg"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Image Forensics MCP Server
An MCP (Model Context Protocol) server that gives AI assistants forensic analysis capabilities to help detect AI-generated images. Uses noise maps, Error Level Analysis, FFT frequency analysis, spectral decay analysis, color channel analysis, and metadata inspection.
Install
One command — requires uv:
claude mcp add -s user image-forensics -- uvx --from git+https://github.com/surewht/image-forensics-mcp image-forensics-mcpThat's it. Restart Claude Code and the tools are available.
Alternative: install from local clone
git clone https://github.com/surewht/image-forensics-mcp.git
cd image-forensics-mcp
claude mcp add -s user image-forensics -- uvx --from . image-forensics-mcpManual config
Add to ~/.claude.json:
{
"mcpServers": {
"image-forensics": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "git+https://github.com/surewht/image-forensics-mcp", "image-forensics-mcp"]
}
}
}Related MCP server: Image MCP Server
Tools
Tool | What it does |
| Extracts the noise pattern by subtracting a blurred version. AI images have unnaturally uniform noise. Returns visualization + statistics. |
| Multi-scale ELA — resaves at multiple JPEG qualities and analyzes error patterns. Detects splicing and compression inconsistencies. |
| 2D FFT spectrum analysis. Detects GAN grid artifacts and unusual frequency distributions. |
| Power spectral density curve fitting (1/f^β). Based on CVPR 2025 research. Natural images follow characteristic decay; AI images may deviate. |
| RGB channel correlation, gradient correlation, entropy, and saturation analysis. Based on CVPR 2025 "Secret Lies in Color" research. |
| EXIF/metadata inspection for AI tool signatures (Stable Diffusion, DALL-E, Midjourney, etc.) + AI resolution fingerprinting. |
| Runs all 6 analyses, saves visualizations to |
Usage
In Claude Code, just ask:
Analyze this image for AI generation: /path/to/image.jpgOr use individual tools:
Run a noise map analysis on /path/to/image.png
Check the metadata of /path/to/image.webpHow the verdict works
The full_forensic_report categorizes findings into three tiers:
Tier | What triggers it | Example |
Definitive | AI tool signatures in metadata (SD parameters, generation prompts) | Stable Diffusion PNG with |
Strong | Forensic anomalies rarely seen in real photos (uniform noise, GAN artifacts, spectral anomalies, extreme saturation) | GAN periodic patterns in FFT spectrum |
Weak/Ambiguous | Indicators also caused by social media processing (no EXIF, AI-typical resolution, uniform ELA) | Facebook-resized 768x768 JPEG with stripped metadata |
Verdict scale
AI-GENERATED — Definitive metadata proof found
LIKELY AI-GENERATED — 3+ strong forensic anomalies
POSSIBLY AI-GENERATED — 1-2 strong anomalies
INCONCLUSIVE — Only weak/ambiguous indicators
LIKELY AUTHENTIC — Minimal indicators, consistent with normal processing
NO INDICATORS — Clean across all analyses
Limitations
Modern AI generators (Flux, DALL-E 3, Midjourney v6+) produce images that are nearly indistinguishable from real photos at the pixel level. This tool works best when:
Metadata is intact — SD parameters, generation prompts = definitive proof
Images show GAN artifacts — periodic patterns in FFT = strong signal
Images haven't been re-compressed — social media platforms strip metadata and resize to AI-typical dimensions, creating ambiguity
For ambiguous cases, visual inspection (teeth, hands, text, reflections, lighting inconsistencies) combined with these forensic tools gives the best results.
Requirements
Python >= 3.10
uv (for
uvxinstall method)
Dependencies (installed automatically): mcp[cli], Pillow, numpy, scipy
License
MIT
Available Tools
7 toolscolor_analysisA
Analyze color channel correlations, saturation, and entropy for AI detection.
Based on CVPR 2025 "Secret Lies in Color" — AI-generated images show unusual RGB channel correlations, gradient patterns, and saturation distributions compared to natural photographs.
Args: image_path: Absolute path to the image file.
Inputs: image_path (required). Returns: result
error_level_analysisB
Perform multi-scale Error Level Analysis (ELA) on an image.
Resaves at multiple JPEG quality levels and analyzes the error patterns. Includes consistency analysis across scales for better AI detection.
Args: image_path: Absolute path to the image file. quality: Primary JPEG quality for visualization (1-100). Default 90.
Inputs: image_path (required), quality. Returns: result
frequency_analysisA
Perform FFT frequency analysis on an image.
Analyzes the frequency spectrum for artifacts common in AI-generated images, including grid patterns, spectral peaks, and unusual energy distribution.
Args: image_path: Absolute path to the image file.
Inputs: image_path (required). Returns: result
full_forensic_reportA
Run all forensic analyses and produce a comprehensive report with overall verdict.
Combines noise map, ELA, frequency analysis, spectral decay, color analysis, and metadata check. Saves visualization images to /tmp/image-forensics/ and returns text-only results to avoid output overflow.
Args: image_path: Absolute path to the image file.
Inputs: image_path (required). Returns: result
metadata_checkA
Check image metadata/EXIF for AI generation signatures and resolution fingerprints.
Looks for known AI tool signatures, unusual metadata patterns, missing camera information, and AI-typical output resolutions.
Args: image_path: Absolute path to the image file.
Inputs: image_path (required). Returns: result
noise_mapA
Extract the noise pattern from an image to help detect AI generation.
Subtracts a Gaussian-blurred version from the original to isolate noise. AI-generated images tend to have unnaturally uniform or structured noise.
Args: image_path: Absolute path to the image file. blur_sigma: Gaussian blur sigma (higher = more smoothing). Default 3.0.
Inputs: image_path (required), blur_sigma. Returns: result
spectral_decay_analysisA
Analyze the power spectral density decay curve of an image.
Natural images follow a characteristic 1/f^beta power law. AI-generated images (especially from diffusion models) often show different decay slopes and anomalies in specific frequency bands. Based on CVPR 2025 research.
Args: image_path: Absolute path to the image file.
Inputs: image_path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct forensic method (noise, ELA, FFT, spectral decay, color, metadata). However, frequency_analysis and spectral_decay_analysis both operate in the frequency domain and could be confused by an agent unfamiliar with the specific techniques. The descriptions clarify the differences, so overlap is limited.
Six of seven tools follow a consistent noun_analysis or noun_check pattern (e.g., noise_map, frequency_analysis, metadata_check). The outlier is full_forensic_report, which is a different type (aggregate report) but its name is still descriptive. Minor deviation from a strict pattern.
Seven tools is well-scoped for an image forensics server. Each tool provides a distinct analysis technique, and the inclusion of a full report tool adds convenience without redundancy. No tool feels unnecessary or missing.
The surface covers multiple orthogonal forensic techniques: noise, compression artifacts, frequency domain, spectral decay, color, metadata, and a comprehensive aggregator. This is complete for the stated purpose of AI image detection; no obvious gaps exist.
Maintenance
Related MCP Connectors
MCP server for Flux AI image generation
MCP server for Qwen Image 3 AI image generation
MCP server for Midjourney AI image generation and editing
An MCP server that integrates with Discord to provide AI-powered features.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI image generation, editing, and analysis using Google's Gemini 3.0 models. It supports high-resolution outputs up to 4K, style transfers, and multi-image mixing through specialized tools.3MIT
- AlicenseCqualityNot gradedmaintenanceAn MCP server that provides AI image generation capabilities using OpenAI and Replicate APIs with support for customizable prompts and dimensions. It features specialized tools for generating square, landscape, and portrait images through simple natural language commands.544 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. It allows users to create new images from text, modify existing files, and perform iterative edits through natural language prompts.61,708 npmMIT
- AlicenseBqualityBmaintenanceAn MCP server for AI-powered image generation, editing, analysis, and transformation using Google's Gemini and Imagen 4 models.19144 PyPI2AGPL 3.0