photocop
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., "@photocopmask the background, add a curves adjustment layer, and export as PNG"
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.
🎨 PhotoCop
The AI-Native Professional Image Editor & Programmable Graphics Engine
Built for precision human creativity and autonomous AI agent workflows via Model Context Protocol (MCP).
📑 Table of Contents
Related MCP server: Photopea MCP Server
💡 Vision & Philosophy
Traditional creative suites (like Adobe Photoshop and GIMP) were architected for manual human cursor interaction. Meanwhile, modern generative AI tools operate as opaque, single-prompt black boxes lacking fine-grained spatial and non-destructive layer control.
PhotoCop bridges this divide. It is a full-fledged, GPU-accelerated graphic manipulation suite where:
Humans get a professional, tactile UI with layers, masks, curves, clone stamps, and familiar shortcuts.
AI Agents get a programmatic, deterministic API via the Model Context Protocol (MCP) and structured command streams.
Every action—whether initiated by a mouse drag, a hotkey, an in-app LLM, or an external agent over MCP—passes through the exact same typed command pipeline with complete undo/redo provenance.
🏗 System Architecture
┌───────────────────────────────────────────────┐
│ INPUT SOURCES │
│ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ Human UI │ │ AI Panel │ │ MCP Server │ │
│ └────┬─────┘ └────┬─────┘ └──────┬───────┘ │
└───────┼─────────────┼───────────────┼─────────┘
│ │ │
▼ ▼ ▼
═════════════════════════════════════════════════
Unified Command Dispatcher: dispatch(cmd)
═════════════════════════════════════════════════
│
┌─────────────────┴─────────────────┐
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ Document Store │ │ History Stack │
│ • Layer Hierarchy │ │ • 100-step Undo/Redo │
│ • Blend Modes & Masks │ │ • Source Attribution │
│ • Viewport & Selection │ │ (User / AI / MCP) │
└────────────┬────────────┘ └─────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ High-Performance Canvas Compositor │
│ • Offscreen Canvas Buffers │
│ • 24 Blend Modes (per-pixel math + CSS compositing) │
│ • Transform matrices (Scale, Rotate, Translate) │
│ • Dirty-rect invalidation via RAF renderVersion │
└─────────────────────────────┬───────────────────────────────┘
│
▼
[ Interactive Canvas View ]✨ Key Features
1. Command-Driven State Pipeline
Every mutation in PhotoCop is expressed as an explicit, serializable EditorCommand:
pixel.paint_stroke,pixel.flood_fill,pixel.clone_stamplayer.create,layer.delete,layer.reorder,layer.set_opacity,layer.set_blend_modelayer.add_mask,layer.invert_mask,layer.set_transformadjustment.create,adjustment.update_curves,adjustment.update_levelsselection.set_rect,selection.clear,selection.invertview.set_zoom,view.set_pan,history.undo,history.redo
Because every command is structured JSON, autonomous agents can dry-run, batch, replay, and verify edits seamlessly.
2. Non-Destructive Layer System
Layer Types: Pixel, Adjustment, Fill (Solid), Text, and Group layers.
Layer Masks: 8-bit alpha masks per layer, with support for live inversion, feathering, and toggleable state.
Transformations: Non-destructive 2D affine transforms (rotation, position offset, non-uniform scaling).
Adjustment Layers: Full live adjustment stack including RGB Curves (with cubic spline / bezier points), Levels, Brightness/Contrast, Hue/Saturation, and Invert.
3. All 24 Photoshop Blend Modes
Full mathematical parity with industry-standard digital compositing:
Group | Blend Modes Supported |
Standard | Normal, Dissolve |
Darken | Darken, Multiply, Color Burn, Linear Burn, Darker Color |
Lighten | Lighten, Screen, Color Dodge, Linear Dodge (Add), Lighter Color |
Contrast | Overlay, Soft Light, Hard Light, Vivid Light, Linear Light, Pin Light, Hard Mix |
Comparative | Difference, Exclusion, Subtract, Divide |
Component | Hue, Saturation, Color, Luminosity |
4. Dual AI Operation (In-App + MCP)
Built-in AI Assistant Panel: Connect directly to OpenAI (GPT-4o), Anthropic (Claude 3.5 Sonnet), local Ollama (Llama 3 / Mistral), or any OpenAI-compatible API. The panel feeds current document metadata, visual downsampled previews, and tool catalogs to the model, which outputs executable command blocks.
Native MCP Server: PhotoCop exposes its internals over the Model Context Protocol, turning the editor into an accessible toolset for external agentic environments.
5. Precision Brush & Canvas Engine
Customizable Brush Dynamics: Hardness, spacing, flow, opacity, and brush radius.
Tooling: Paintbrush, Pencil, Eraser, Clone Stamp, Paint Bucket (Flood Fill), Marquee Selection, Crop Overlay, Pan/Hand, and Zoom.
Infinite Canvas Navigation: Smooth panning, zooming centered on the mouse cursor, and marching-ants selection marquee.
🔌 Model Context Protocol (MCP) Server
PhotoCop includes an embedded Model Context Protocol (MCP) server (src/mcp/server.ts) exposing over 30 programmatic tools and live document resources.
Connecting External Agents
Add PhotoCop to your agent client configuration (e.g. Claude Desktop, Cursor, Antigravity):
{
"mcpServers": {
"photocop": {
"command": "node",
"args": ["path/to/PhotoCop/photocop/dist/mcp-server.js"]
}
}
}MCP Tool Catalog
Tool Name | Parameters | Description |
| None | Returns document dimensions, DPI, active layer, and layer stack tree. |
| None | Retrieves the active bounding box, pixel selection mask, and feather radius. |
|
| Creates a new pixel, adjustment, fill, or group layer. |
|
| Removes a layer by ID. |
|
| Repositions a layer within the layer hierarchy. |
|
| Sets the layer's alpha transparency. |
|
| Sets any of the 24 supported blend modes. |
|
| Attaches a mask buffer to the specified layer. |
|
| Modifies spline control points for RGB/composite curves. |
|
| Creates an adjustment layer with targeted color parameters. |
|
| Executes a programmatic vector or freehand brush stroke. |
|
| Performs a flood fill from target coordinates. |
|
| Composites the document and returns a base64-encoded image. |
| None | Navigates the 100-step state history stack. |
⌨️ Keyboard Shortcuts
PhotoCop adopts standard industry keybindings for zero learning curve:
Shortcut | Action | Tool / Scope |
V | Move Tool | Global |
B | Paintbrush Tool | Global |
E | Eraser Tool | Global |
M | Rectangular Marquee Tool | Selection |
C | Crop Tool | Document |
G | Paint Bucket (Fill) Tool | Drawing |
S | Clone Stamp Tool | Retouching |
I | Eyedropper (Pipette) | Color |
H / Space + Drag | Hand / Pan Canvas | Viewport |
Z | Zoom Tool | Viewport |
Ctrl + Z | Undo | History |
Ctrl + Shift + Z | Redo | History |
Ctrl + A | Select All | Selection |
Ctrl + D | Deselect | Selection |
Ctrl + Shift + I | Invert Selection | Selection |
Ctrl + J | Duplicate Active Layer | Layers |
Ctrl + Shift + N | New Layer | Layers |
Delete / Backspace | Clear Selected Area / Layer | Edit |
[ / ] | Decrease / Increase Brush Size | Brush |
🚀 Quick Start
Prerequisites
Installation
Clone the repository:
git clone https://github.com/HunainxAhmed/PhotoCop.git
cd PhotoCopInstall dependencies:
cd photocop
npm installStarting the Editor
Run the local Vite development server:
npm run devOpen your browser and navigate to:
http://localhost:5173You can also run commands directly from the workspace root:
npm run dev # Starts Vite dev server
npm run build # Compiles TypeScript and runs production bundle
npm run lint # Runs oxlint analysisBuilding for Production
Compile optimized production assets:
npm run buildProduction assets are generated in photocop/dist/. To preview the production bundle locally:
npm run preview🤖 AI Panel Configuration
In the PhotoCop interface, open the AI Assistant panel on the right sidebar.
Click the ⚙️ Settings button in the AI panel header.
Select your desired provider:
OpenAI: Set your API key (
sk-...) and model (e.g.,gpt-4o,gpt-4o-mini).Anthropic: Set your Claude API key (
sk-ant-...) and model (claude-3-5-sonnet-20241022).Ollama (Local): Set the endpoint (default:
http://localhost:11434) and model name (e.g.,llama3).Custom: Any OpenAI-compatible inference proxy or gateway.
Issue natural language requests such as:
"Boost the contrast of this portrait using a gentle S-curve adjustment."
"Create a solid dark vignette overlay with Multiply blend mode at 45% opacity."
"Isolate the bright highlights and invert the mask on layer 2."
The assistant analyzes the live layer graph and executes exact commands onto your canvas in real-time.
📁 Project Structure
PhotoCop/
├── assets/
│ └── hero.png # Application teaser and documentation assets
├── photocop/
│ ├── public/ # Static assets and favicons
│ ├── src/
│ │ ├── assets/ # UI artwork and icons
│ │ ├── components/ # Modular React UI components
│ │ │ ├── AIPanel.tsx # Multi-provider AI assistant panel
│ │ │ ├── Canvas.tsx # 2D Canvas renderer & event coordinator
│ │ │ ├── HistoryPanel.tsx # Provenance-tracking undo/redo panel
│ │ │ ├── LayersPanel.tsx # Layer stack, opacity, masks, thumbnails
│ │ │ ├── MenuBar.tsx # Comprehensive application menus
│ │ │ ├── PerformanceMonitor.tsx # Real-time latency and FPS monitor
│ │ │ ├── PropertiesPanel.tsx # Context-sensitive curve and brush sliders
│ │ │ ├── StatusBar.tsx # Coordinates, tool state, zoom info
│ │ │ └── Toolbox.tsx # Tool buttons and color swatches
│ │ ├── core/ # Pure engine and graphics core
│ │ │ ├── blendModes.ts # Blend mode definitions and constants
│ │ │ ├── brushEngine.ts # Pixel stamping, spacing, flow math
│ │ │ ├── commandDispatcher.ts # Deterministic command execution engine
│ │ │ ├── commands.ts # 40+ strongly-typed command interfaces
│ │ │ ├── compositor.ts # Offscreen canvas compositor & math
│ │ │ ├── document.ts # Layer/document constructors & mutators
│ │ │ └── types.ts # Global type definitions
│ │ ├── mcp/ # Model Context Protocol integration
│ │ │ └── server.ts # 30+ MCP tools and live resources
│ │ ├── store/ # Reactive state management
│ │ │ └── editorStore.ts # Zustand store with command middleware
│ │ ├── App.tsx # Main workspace layout & shortcuts
│ │ ├── index.css # Tailwind CSS stylesheets
│ │ └── main.tsx # React entry point
│ ├── index.html # HTML template
│ ├── package.json # Dependencies and build scripts
│ ├── tsconfig.json # TypeScript compiler configuration
│ └── vite.config.ts # Vite bundler configuration
├── .gitignore # Git ignore patterns
├── LICENSE # MIT License
├── package.json # Workspace root script runner
└── README.md # Documentation🗺 Roadmap
Phase 1: Core Foundation ✅
Full layer model (pixel, adjustment, text, group, fill)
All 24 Photoshop blend modes with per-pixel math
40+ typed command definitions & single dispatcher
High-performance brush engine (hardness, flow, spacing, eraser, clone stamp)
100-step undo/redo history with source attribution (Human / AI / MCP)
GPU-accelerated canvas with smooth zoom-to-cursor and pan
In-app AI Assistant panel (OpenAI, Anthropic, Ollama)
Complete Model Context Protocol (MCP) server with 30+ tools
Photoshop-standard keyboard shortcuts
Phase 2: Advanced Editing Tools 🚧
Pressure-sensitive brush curves (Stylus & Apple Pencil / Wacom API)
Magic Wand / Color Range selection engine
Healing Brush & Patch tools
Multi-stop Linear & Radial gradient fill tools
Dodge, Burn, Sponge, Blur, and Sharpen brush tools
Free Transform with bounding box handles and perspective warp
Rich typography and path-following text engine
Convolution filter pipeline (Gaussian Blur, Unsharp Mask, High Pass)
WebSocket relay for bidirectional remote MCP clients
Phase 3: Enterprise & Pro Pipeline 🔮
Vector Pen tool with cubic Bézier path math
Smart Object non-destructive raster/vector containers
Liquify and mesh warp engine
PSD / TIFF import and export parser
Vision-AI segmentation (one-click subject isolation, generative fill)
Batch automation and script macro recorder
🤝 Contributing
Contributions are what make the open-source community an incredible place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Fork the Project
Create your Feature Branch (
git checkout -b feature/AmazingFeature)Commit your Changes (
git commit -m 'feat: Add AmazingFeature')Push to the Branch (
git push origin feature/AmazingFeature)Open a Pull Request
📄 License
Distributed under the MIT License. See LICENSE for more information.
Crafted with care by Hunain Ahmed.
⭐ If you find PhotoCop inspiring or useful, please consider starring this repository!
This server cannot be deployed
Maintenance
Related MCP Connectors
Build and run visual creative-production workflows from your AI agent.
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Generate and edit images, video, voice, lip-sync and 3D models from your AI agent.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to programmatically control Adobe Photoshop on Windows to create documents, manipulate layers, and manage image adjustments. It provides a bridge between the Model Context Protocol and the Photoshop Python API for automated graphic design workflows.690 PyPI306MIT
- AlicenseAqualityDmaintenanceEnables AI agents to perform advanced image editing and graphic design through Photopea, a browser-based Photoshop alternative. Provides 34 tools for document management, layer operations, filters, adjustments, and exports via a WebSocket bridge to the browser.34110 npm40MIT
- AlicenseAqualityAmaintenanceEnables AI assistants to control Adobe Photoshop programmatically, supporting recipe workflows, state awareness, and generative AI features through natural language commands.2412711,711 npm549MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to generate and compose thumbnails using tools like get_capabilities, measure, render_thumbnail, render_variants, and get_canvas, with a document model that supports layers, effects, and masking.MIT