Give AI agents visual superpowers to see, analyze, and document your applications like never before.
This isn't just another screenshot tool—it's the bridge that gives AI agents visual awareness of your development environment, enabling them to become intelligent documentation partners, UI analyzers, and visual debugging assistants.
This package is now maintained in its own repository: https://github.com/Digital-Defiance/vscode-mcp-screenshot
This repository is part of the AI Capabilitites Suite on GitHub.
AI agents today are powerful but blind. They can read your code and suggest improvements, but they can't see what your application actually looks like or how users interact with it. This creates a massive gap in their ability to help you.
You: "Document the new dashboard layout"
AI: *Captures screenshots, analyzes UI components*
AI: "Created comprehensive guide with 8 annotated screenshots showing navigation flow, key features, and user interactions..."
You: "The button alignment looks wrong"
AI: *Captures current state, analyzes layout*
AI: "Button is 3px off-center. Here's the CSS fix and a before/after comparison..."
You: "Show how the authentication flow works"
AI: *Captures key screens, creates step-by-step guide*
AI: "Generated 6-step visual walkthrough with annotations and user journey map..."
You: "Check if this form is accessible"
AI: *Captures form, analyzes contrast and layout*
AI: "Found 3 accessibility issues: low contrast on labels, missing focus indicators, inadequate spacing..."
You: "Which design works better?"
AI: *Captures both versions, analyzes differences*
AI: "Version B has 23% better visual hierarchy and clearer call-to-action placement..."
You: "How does this look on different screen sizes?"
AI: *Captures multiple viewport sizes*
AI: "Mobile layout breaks at 768px - navigation overlaps content. Here's the media query fix..."
Before: AI could only work with code and text descriptions
- ❌ "The button looks weird" → AI guesses what you mean
- ❌ "Create documentation" → AI writes generic text
- ❌ "Check the layout" → AI can't see the actual result
After: AI can see and analyze your actual application
- ✅ Visual debugging - AI sees exactly what's wrong
- ✅ Intelligent documentation - AI creates guides with real screenshots
- ✅ Design analysis - AI evaluates actual user interfaces
- ✅ Accessibility audits - AI checks real visual contrast and layout
- ✅ Responsive testing - AI captures and compares different screen sizes
- Full Screen Capture: Capture entire displays or specific monitors
- Window Capture: Target specific application windows
- Region Capture: Capture rectangular screen regions
- Multi-Format Support: PNG, JPEG, WebP, BMP with quality control
- PII Masking: Automatic detection and redaction of sensitive information
- Multi-Monitor Support: Works seamlessly with multiple displays
- Privacy Controls: Exclude sensitive windows and applications
- MCP Integration: Purpose-built for AI agent workflows
The extension includes a comprehensive Language Server providing professional-grade code intelligence:
- Fix Invalid Format: Corrects invalid format values (bmp, gif) → suggests valid formats (png, jpeg, webp)
- Fix Quality Range: Clamps quality values to 0-100 range
- Add Missing Parameters: Generates parameter templates for incomplete function calls
- Migrate Deprecated API: Converts 6 deprecated functions to modern equivalents
- Signature Help: Shows parameter documentation for all 5 screenshot functions as you type (triggered by
(and,) - Inlay Hints - Dimensions: Shows
// 800x600pxinline after region captures - Inlay Hints - File Size: Shows
// ~2.5MBinline based on format and quality
- Document Symbols: Navigate capture operations and list operations via outline (Ctrl+Shift+O)
- Document Links: Clickable links to EXAMPLES.md for all 5 screenshot functions (Ctrl+Click)
- Call Hierarchy: Visualize function dependencies (captureFull→listDisplays)
- Semantic Highlighting: Custom colors for
capture*andlist*functions, special highlighting forenablePIIMasking - Color Provider: Visual colors for image formats (png=blue, jpeg=orange, webp=green, bmp=red)
- Folding Ranges: Collapse/expand capture operations and config objects
- Selection Ranges: Smart selection expansion with Shift+Alt+Right
- Linked Editing: Simultaneously edit format variables across file
- Type Hierarchy: Explore type relationships (CaptureConfig→Object)
-
Color Provider: Visual colors for image formats (png=blue, jpeg=orange, webp=green, bmp=red)
-
Folding Ranges: Collapse/expand capture operations and config objects
-
Selection Ranges: Smart selection expansion with Shift+Alt+Right
-
Linked Editing: Simultaneously edit format variables across file
-
Call Hierarchy: Visualize function dependencies (captureFull→listDisplays)
-
Type Hierarchy: Explore type relationships (CaptureConfig→Object)
-
Hover Information: Contextual help for functions, config properties, and identifiers
-
Code Completion: Smart autocomplete for configuration properties and values
-
Diagnostics: Real-time validation with helpful error messages
-
Code Lenses: Inline action buttons for quick screenshot operations
-
AI Agent Commands: Programmatic command execution for automation
-
Install from VS Code Marketplace (coming soon)
-
Or install from VSIX file:
code --install-extension mcp-screenshot-0.0.1.vsix
- MCP ACS Screenshot: Capture Full Screen - Capture the entire screen
- MCP ACS Screenshot: Capture Window - Select and capture a specific window
- MCP ACS Screenshot: Capture Region - Capture a rectangular region
- MCP ACS Screenshot: List Displays - Show all connected displays
- MCP ACS Screenshot: List Windows - Show all visible windows
- MCP ACS Screenshot: Open Settings - Configure extension settings
Hover over screenshot-related code to see documentation:
- Function Calls: Hover over
captureFullScreen(),captureWindow(), orcaptureRegion()to see parameter documentation and examples - Configuration Objects: Hover over screenshot configuration properties to see valid values and types
- Identifiers: Hover over display or window IDs to see information about that resource (when available)
All hover information is formatted as markdown with clear sections for parameters, return values, and usage examples.
Code lenses appear as inline action buttons in your code:
- 📸 Capture Screenshot: Appears near screenshot capture functions - click to execute the capture
- 🖥️ List Displays: Appears near display enumeration code - click to see all connected displays
- 🪟 List Windows: Appears near window enumeration code - click to see all visible windows
Code lenses provide quick access to screenshot operations without leaving your editor.
Real-time validation catches issues before runtime:
- Invalid Format: Warns when format is not 'png', 'jpeg', or 'webp' and suggests valid options
- Quality Range: Errors when quality parameter is outside 0-100 range
- Missing Parameters: Errors when required screenshot parameters are missing
- Deprecated APIs: Informational messages for deprecated screenshot APIs with migration guidance
All diagnostics include the exact location, clear messages, and suggested fixes.
Smart autocomplete for screenshot code:
- Configuration Properties: Type in a screenshot config object to see all valid properties with documentation
- Format Values: Autocomplete suggests 'png', 'jpeg', 'webp' when typing format parameters
- Quality Values: Autocomplete suggests common quality values (80, 90, 95, 100)
All completion items include documentation and insert with correct syntax.
The LSP exposes commands for programmatic execution:
mcp.screenshot.capture: Execute screenshot capture with parametersmcp.screenshot.listDisplays: Get list of available displaysmcp.screenshot.listWindows: Get list of available windowsmcp.screenshot.getCapabilities: Get screenshot system capabilities
Commands return structured results or errors for reliable automation.
You can assign custom keyboard shortcuts to any command via VS Code's keyboard shortcuts settings.
Configure the extension via VS Code settings:
{
"mcpScreenshot.defaultFormat": "png",
"mcpScreenshot.defaultQuality": 90,
"mcpScreenshot.saveDirectory": "${workspaceFolder}/screenshots",
"mcpScreenshot.enablePIIMasking": false,
"mcpScreenshot.autoSave": true,
"mcpScreenshot.autoStart": true
}mcpScreenshot.defaultFormat: Default image format (png, jpeg, webp, bmp)mcpScreenshot.defaultQuality: Default quality for lossy formats (1-100)mcpScreenshot.saveDirectory: Default directory for saving screenshotsmcpScreenshot.enablePIIMasking: Enable PII detection and masking by defaultmcpScreenshot.autoSave: Automatically save screenshots to diskmcpScreenshot.autoStart: Automatically start MCP server when VS Code opensmcpScreenshot.serverCommand: Command to run MCP screenshot servermcpScreenshot.serverArgs: Arguments for MCP screenshot server command
- Visual Studio Code 1.85.0 or higher
- Node.js 18.0.0 or higher
- Platform-specific dependencies:
- Linux: X11 or Wayland, ImageMagick
- macOS: screencapture (built-in)
- Windows: screenshot-desktop library
1. You: "@copilot Document the user registration flow"
2. AI: *Uses MCP ACS Screenshot to capture each step*
3. AI: *Analyzes UI elements and user journey*
4. AI: *Generates markdown with embedded screenshots*
5. Result: Complete documentation with visual guides
1. You: "@copilot This form validation isn't working right"
2. AI: *Captures current state and error conditions*
3. AI: *Analyzes expected vs actual behavior*
4. AI: *Creates detailed bug report with screenshots*
5. Result: Professional bug report ready for your team
1. You: "@copilot Review this new feature design"
2. AI: *Captures different states and interactions*
3. AI: *Analyzes usability and accessibility*
4. AI: *Provides specific improvement suggestions*
5. Result: Actionable design feedback with visual examples
1. You: "@copilot Check how this looks on mobile"
2. AI: *Captures multiple viewport sizes*
3. AI: *Identifies layout issues and breakpoints*
4. AI: *Suggests CSS improvements*
5. Result: Responsive design fixes with before/after comparisons
- Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run "MCP ACS Screenshot: Capture Full Screen"
- Screenshot is saved to configured directory
- Open Command Palette
- Run "MCP ACS Screenshot: Capture Window"
- Select window from the list
- Choose whether to include window frame
- Screenshot is captured
- Open Command Palette
- Run "MCP ACS Screenshot: Capture Region"
- Enter coordinates and dimensions
- Screenshot is captured
Fix Invalid Format:
// ⚠️ Warning: Invalid format 'bmp'
const screenshot = await captureFull({ format: 'bmp' });
// 💡 Quick Fix: Change to 'png', 'jpeg', or 'webp'Fix Quality Range:
// ❌ Error: Quality 150 out of range
const screenshot = await captureFull({ format: 'jpeg', quality: 150 });
// 💡 Quick Fix: Clamp to 100Add Missing Parameters:
// ❌ Error: Missing required parameters
const screenshot = await captureFull();
// 💡 Quick Fix: Add parameter template
const screenshot = await captureFull({ format: 'png', quality: 90 });Migrate Deprecated API:
// ℹ️ Info: takeScreenshot is deprecated
const screenshot = await takeScreenshot();
// 💡 Quick Fix: Migrate to captureFull
const screenshot = await captureFull({ format: 'png' });Signature Help:
// Type '(' to see parameter hints
captureFull(
// ↓ Shows: config: { format: string, quality?: number, ... }
{ format: 'png', quality: 90 }
);
// Type ',' to move to next parameter
captureWindow(
// ↓ Shows all config properties with types and descriptions
);Inlay Hints:
// Image dimensions hint
const region = await captureRegion({
x: 0, y: 0, width: 800, height: 600
}); // → 800x600px
// File size estimate hint
const full = await captureFull({
format: 'png', quality: 90
}); // → ~2.5MBDocument Symbols:
// Press Ctrl+Shift+O to see outline:
// 📸 Capture Operations
// ├─ captureFull (line 5)
// ├─ captureWindow (line 10)
// └─ captureRegion (line 15)
// 📊 List Operations
// ├─ listDisplays (line 20)
// └─ listWindows (line 25)
async function screenshots() {
await captureFull({ format: 'png' });
await captureWindow({ windowTitle: 'VSCode' });
await captureRegion({ x: 0, y: 0, width: 800, height: 600 });
await listDisplays();
await listWindows();
}Document Links:
// Hover over function to see underlined link
// Ctrl+Click to open EXAMPLES.md
captureFull({ format: 'png' }); // → Links to captureFull examples
captureWindow({ windowTitle: 'VSCode' }); // → Links to captureWindow examplesCall Hierarchy:
// Right-click 'captureFull' → Show Call Hierarchy
captureFull({ format: 'png' });
// Shows: captureFull → depends on → listDisplaysSemantic Highlighting:
// Functions highlighted in distinct color
captureFull({ format: 'png' }); // 'captureFull' highlighted
listDisplays(); // 'listDisplays' highlighted
// PII keyword highlighted for security awareness
const config = {
format: 'png',
enablePIIMasking: true // 'enablePIIMasking' highlighted
};Color Provider:
// Color squares appear in gutter
format: 'png' // 🟦 Blue square
format: 'jpeg' // 🟧 Orange square
format: 'webp' // 🟩 Green squareFolding Ranges:
// Click fold icon to collapse
captureFull({ // ▼ Click to fold
format: 'png',
quality: 90,
enablePIIMasking: true
}); // ▲ Click to unfoldSelection Ranges:
// Place cursor, press Shift+Alt+Right to expand
captureFull({ format: 'png' });
// 1st press: selects 'captureFull'
// 2nd press: selects entire function call
// 3rd press: selects entire lineLinked Editing:
// Edit 'format' on line 1, line 3 updates automatically
const format = 'png';
captureFull({ format }); // Updates when you edit line 1
captureWindow({ format }); // Also updatesSelection Ranges:
// Place cursor, press Shift+Alt+Right to expand
captureFull({ format: 'png' });
// 1st press: selects 'captureFull'
// 2nd press: selects entire function call
// 3rd press: selects entire lineLinked Editing:
// Edit 'format' on line 1, line 3 updates automatically
const format = 'png';
captureFull({ format }); // Updates when you edit line 1
captureWindow({ format }); // Also updatesType Hierarchy:
// Right-click 'CaptureConfig' → Show Type Hierarchy
const config: CaptureConfig = { format: 'png' };
// Shows: CaptureConfig → extends → ObjectHover Information:
// Hover over captureFullScreen to see documentation
const screenshot = await captureFullScreen({
format: 'png', // Hover to see valid formats
quality: 90 // Hover to see valid range
});// A code lens "📸 Capture Screenshot" appears above this function
async function takeScreenshot() {
const result = await captureFullScreen({ format: 'png' });
return result;
}
// A code lens "🖥️ List Displays" appears above this function
async function getDisplays() {
const displays = await listDisplays();
return displays;
}// ❌ Error: Quality must be between 0 and 100
const screenshot = await captureFullScreen({
format: 'png',
quality: 150 // Diagnostic appears here
});
// ⚠️ Warning: Invalid format, use 'png', 'jpeg', or 'webp'
const screenshot2 = await captureFullScreen({
format: 'gif' // Diagnostic appears here
});// Type inside the config object to see completions
const screenshot = await captureFullScreen({
// Type 'f' to see 'format' completion
// Type 'q' to see 'quality' completion
// Type 'e' to see 'enablePIIMasking' completion
});// AI agents can execute commands programmatically
const result = await vscode.commands.executeCommand(
'mcp.screenshot.capture',
{
type: 'fullscreen',
format: 'png',
quality: 90
}
);
const displays = await vscode.commands.executeCommand(
'mcp.screenshot.listDisplays'
);- PII Masking: Automatically detect and redact emails, phone numbers, and credit cards
- Window Exclusion: Exclude password managers and authentication dialogs
- Path Validation: Restrict file saves to allowed directories
- Rate Limiting: Prevent capture spam
Check the Output panel (View → Output → MCP ACS Screenshot) for error messages.
Ensure X11 access:
xhost +local:Grant screen recording permission:
- System Preferences → Security & Privacy → Privacy
- Select "Screen Recording"
- Add Visual Studio Code
- GitHub: https://github.com/digital-defiance/ai-capabilities-suite
- Issues: https://github.com/digital-defiance/ai-capabilities-suite/issues
- Email: [email protected]
MIT License - See LICENSE file for details
Contributions are welcome! Please see our contributing guidelines in the repository.
The LSP features work in the following file types:
- JavaScript (
.js) - TypeScript (
.ts) - JSX (
.jsx) - TSX (
.tsx) - JSON (
.json) - Configuration validation only
20 LSP Features Organized by Category:
- Code Actions: 4 actions (fix format, fix quality, add parameters, migrate API)
- Real-time Assistance: Signature help + 2 inlay hints (dimensions, file size)
- Code Navigation: Document symbols, document links, call hierarchy
- Visual Enhancements: Semantic highlighting, color provider, folding ranges
- Smart Editing: Selection ranges, linked editing, type hierarchy
- Core Intelligence: Hover, completion, diagnostics, code lens, AI commands
- Quality: 52+ automated tests, 97% LSP coverage (34/35 features)
- Performance: 2-5x faster than targets, < 100ms response times
- Added Language Server Protocol support
- Hover information for screenshot APIs
- Code lenses for quick actions
- Real-time diagnostics and validation
- Code completion for configuration
- AI agent command execution
- Multi-language support (JS, TS, JSX, TSX, JSON)
- Full screen capture
- Window capture
- Region capture
- Multi-format support
- PII masking
- Multi-monitor support
- MCP integration