Electron MCP Server
v1.8.0Electron.js MCP server — IPC scaffolding, security auditing, build tooling for AI assistants
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
electron_scaffold_ipc_channel
Generate complete IPC boilerplate for a new feature: ipcMain handler in the main process, preload bridge function with contextBridge, TypeScript type declarations, and renderer-side usage example. Produces all the files needed for a secure, type-safe IPC channel.
| Parameter | Type | Description |
|---|---|---|
channelName * | string | The IPC channel name, e.g. 'get-user-data', 'save-settings', 'open-file-dialog' |
description * | string | What this IPC channel does, e.g. 'Fetches user profile from the database' |
direction * | string | Communication direction for the channel |
apiNamespace | string | The namespace on window.electronAPI to group this under, e.g. 'users', 'settings'. Defaults to 'api'. |
args | string | TypeScript type for the arguments, e.g. '{ userId: string }' or 'string'. Omit for no arguments. |
returnType | string | TypeScript type for the return value (renderer-to-main only), e.g. '{ name: string; email: string }'. Omit for void. |
electron_generate_preload_bridge
Generate a complete, secure preload.ts with contextBridge.exposeInMainWorld for multiple API methods. Produces the preload script, TypeScript declarations for window.electronAPI, and security best practices. Use this when you need to expose several main-process APIs to the renderer at once.
| Parameter | Type | Description |
|---|---|---|
methods * | array | Array of methods to expose through the preload bridge |
namespace | string | The property name on window, e.g. 'electronAPI'. Defaults to 'electronAPI'. |
electron_audit_ipc_security
Analyze preload script and main process IPC code for security issues. Checks for: raw ipcRenderer exposure, missing sender validation, synchronous IPC usage, listener memory leaks, prototype pollution via contextBridge, and insecure channel patterns. Provide the actual code content to analyze.
| Parameter | Type | Description |
|---|---|---|
mainCode | string | Content of the main process IPC handler code to analyze |
preloadCode | string | Content of the preload script (preload.ts/js) to analyze |
rendererCode | string | Content of renderer code that uses IPC, to check for anti-patterns |
electron_generate_window_manager
Generate multi-window management boilerplate for Electron apps. Creates a WindowManager class that handles window lifecycle, inter-window communication, window state persistence, and proper cleanup. Supports common patterns like main + child windows, modal dialogs, and detached panels.
| Parameter | Type | Description |
|---|---|---|
windows * | array | Windows to manage |
persistState | boolean | Whether to persist window positions/sizes across restarts (default true) |
electron_explain_process_model
Get a clear, version-aware explanation of Electron's multi-process architecture. Covers the main process, renderer processes, preload scripts, utility processes, contextBridge, and how they interact. Useful for understanding the mental model before building features.
| Parameter | Type | Description |
|---|---|---|
topic * | string | Which aspect of the process model to explain |
electronVersion | string | Target Electron version for version-specific guidance (e.g. '28', '33', '45'). Defaults to latest. |
electron_audit_security
Audit an Electron app against the official security checklist. Covers 19 of the items that can be detected from static inputs (BrowserWindow configuration, main process code, package.json, preload, HTML): HTTPS-only content, nodeIntegration, contextIsolation, sandbox, webSecurity, CSP, allowRunningInsecureContent, experimentalFeatures, enableBlinkFeatures, raw ipcRenderer exposure, direct window assignment, @electron/remote, supported Electron version, shell.openExternal validation, file:// usage, <webview> tag, will-navigate handler, setWindowOpenHandler, and IPC sender validation. The remain…
| Parameter | Type | Description |
|---|---|---|
browserWindowConfig | string | BrowserWindow constructor options as a JSON string or code snippet |
electronVersion | string | Electron major version if not in package.json (e.g. '45') |
htmlContent | string | Content of the main HTML file to check CSP meta tags |
mainCode | string | Main process code -- used to detect non-HTTPS URLs in loadURL/loadFile calls |
packageJson | string | Content of package.json to check Electron version and dependencies |
preloadCode | string | Content of the preload script |
electron_configure_fuses
Generate @electron/fuses configuration to harden your Electron app. Fuses are compile-time toggles that disable dangerous Electron features (like ELECTRON_RUN_AS_NODE, NODE_OPTIONS) and cannot be re-enabled by end users. Essential for production apps.
| Parameter | Type | Description |
|---|---|---|
level * | string | 'recommended' for sensible defaults, 'strict' for maximum security, 'custom' to specify each fuse individually |
customFuses | object | Individual fuse settings (only for 'custom' level) |
electron_configure_csp
Generate a Content Security Policy for an Electron app. Accounts for the bundler (Vite, webpack), framework (React, Vue, Svelte), and whether dev-mode exceptions are needed. Returns both meta-tag and session.webRequest approaches.
| Parameter | Type | Description |
|---|---|---|
bundler | string | Bundler used (affects script-src for HMR in dev mode). Defaults to 'vite'. |
externalConnections | array | External origins the app connects to, e.g. ['https://api.example.com', 'wss://ws.example.com'] |
externalImages | array | External origins for images, e.g. ['https://cdn.example.com'] |
needsEval | boolean | Whether eval() is needed (some template compilers). Defaults to false. |
needsInlineStyles | boolean | Whether inline styles are required (e.g. CSS-in-JS). Defaults to false. |
electron_lint_security
Static analysis of Electron code for dangerous patterns: shell.openExternal with user input, @electron/remote usage, disabled webSecurity, missing navigation restrictions, unrestricted window creation, and other OWASP-style vulnerabilities specific to Electron.
| Parameter | Type | Description |
|---|---|---|
code * | string | Source code to analyze (main process, preload, or renderer) |
fileType | string | Which process this code runs in. Helps scope the analysis. Defaults to 'main'. |
electron_diagnose_build_error
Diagnose Electron build/packaging errors from electron-builder, electron-forge, or electron-packager output. Identifies common failures: code signing errors, native module rebuild issues, ASAR packaging problems, missing platform-specific configuration, and __dirname path resolution bugs.
| Parameter | Type | Description |
|---|---|---|
errorOutput * | string | The build error output (stderr/stdout) to diagnose |
buildTool | string | Which build tool produced the error. Defaults to 'unknown' (auto-detect). |
platform | string | Target platform. Defaults to 'unknown' (auto-detect). |
electron_configure_auto_update
Generate complete auto-update configuration using electron-updater. Produces main process setup, update event handling, renderer notification UI code, and platform-specific signing requirements. Supports GitHub releases, S3, and generic HTTP update servers.
| Parameter | Type | Description |
|---|---|---|
provider * | string | Update distribution method: 'github' (GitHub Releases), 's3' (AWS S3), 'generic' (any HTTP server) |
autoDownload | boolean | Automatically download updates (default true) |
autoInstallOnQuit | boolean | Install update on app quit (default true) |
genericUrl | string | Base URL for updates (for 'generic' provider) |
githubOwner | string | GitHub owner (for 'github' provider) |
githubRepo | string | GitHub repo name (for 'github' provider) |
s3Bucket | string | S3 bucket name (for 's3' provider) |
electron_configure_deep_linking
Generate complete custom protocol / deep linking setup for Electron. Produces protocol registration, URL handling in both single-instance and multi-instance modes, platform-specific configuration (macOS Info.plist, Windows registry, Linux .desktop), and electron-builder/forge config.
| Parameter | Type | Description |
|---|---|---|
protocol * | string | Custom protocol scheme, e.g. 'myapp' (will handle myapp:// URLs) |
routes | array | Routes to handle within the protocol |
singleInstance | boolean | Enforce single instance -- new URLs focus the existing window (default true) |
electron_scaffold_project
Generate a complete, secure, modern Electron project scaffold. Includes proper process separation, TypeScript configuration, framework integration, build tooling, security defaults, and an example IPC channel. Produces a full project structure ready to develop.
| Parameter | Type | Description |
|---|---|---|
name * | string | Project name (lowercase, hyphens ok), e.g. 'my-electron-app' |
buildTool | string | Build tool. Defaults to 'electron-vite'. |
features | array | Optional features to include |
framework | string | Frontend framework. Defaults to 'react'. |
electron_migrate_version
Generate a migration checklist for upgrading between Electron versions. Lists all breaking changes, deprecated APIs, and required code modifications between the current and target versions.
| Parameter | Type | Description |
|---|---|---|
currentVersion * | integer | Current Electron major version (e.g. 28) |
targetVersion * | integer | Target Electron major version (e.g. 45) |
electron_check_deprecated_apis
Scan code for usage of deprecated or removed Electron APIs. Returns a list of deprecated APIs found with their replacements and the version they were deprecated/removed in.
| Parameter | Type | Description |
|---|---|---|
code * | string | Source code to scan for deprecated API usage |
electronVersion | integer | Current Electron major version to determine what's deprecated (default: 45) |
electron_audit_performance
Analyze Electron app code for 7 official performance anti-patterns: eager module loading, synchronous main-process operations, excessive BrowserWindows at startup, unnecessary polyfills, CDN-loaded assets, heavy preload scripts, and unbundled dependencies. Returns specific fixes.
| Parameter | Type | Description |
|---|---|---|
mainCode | string | Main process code to analyze |
packageJson | string | package.json content to check for bundling and dependencies |
preloadCode | string | Preload script code to analyze |
rendererCode | string | Renderer process code to analyze |
electron_explain_concept
Get a clear, authoritative explanation of an Electron concept. Counters outdated tutorial content with accurate, version-aware information. Covers: process model, context isolation, sandbox, IPC, ASAR, fuses, code signing, and build tool comparison.
| Parameter | Type | Description |
|---|---|---|
concept * | string | The Electron concept to explain |
electron_knowledge_version
Return metadata about the embedded Electron knowledge used by this MCP's analysis tools -- the date it was last verified against official Electron docs, the current Electron stable version at that time, and the supported version range for migration/deprecation checks. Call this when you need to know whether the advice from other tools is current.