Electron MCP Server

v1.8.0
io.github.YawLabs/electron-mcp Checked 1 hour ago Published 1 day ago

Electron.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.

ParameterTypeDescription
channelName *stringThe IPC channel name, e.g. 'get-user-data', 'save-settings', 'open-file-dialog'
description *stringWhat this IPC channel does, e.g. 'Fetches user profile from the database'
direction *stringCommunication direction for the channel
apiNamespacestringThe namespace on window.electronAPI to group this under, e.g. 'users', 'settings'. Defaults to 'api'.
argsstringTypeScript type for the arguments, e.g. '{ userId: string }' or 'string'. Omit for no arguments.
returnTypestringTypeScript 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.

ParameterTypeDescription
methods *arrayArray of methods to expose through the preload bridge
namespacestringThe 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.

ParameterTypeDescription
mainCodestringContent of the main process IPC handler code to analyze
preloadCodestringContent of the preload script (preload.ts/js) to analyze
rendererCodestringContent 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.

ParameterTypeDescription
windows *arrayWindows to manage
persistStatebooleanWhether 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.

ParameterTypeDescription
topic *stringWhich aspect of the process model to explain
electronVersionstringTarget 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…

ParameterTypeDescription
browserWindowConfigstringBrowserWindow constructor options as a JSON string or code snippet
electronVersionstringElectron major version if not in package.json (e.g. '45')
htmlContentstringContent of the main HTML file to check CSP meta tags
mainCodestringMain process code -- used to detect non-HTTPS URLs in loadURL/loadFile calls
packageJsonstringContent of package.json to check Electron version and dependencies
preloadCodestringContent 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.

ParameterTypeDescription
level *string'recommended' for sensible defaults, 'strict' for maximum security, 'custom' to specify each fuse individually
customFusesobjectIndividual 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.

ParameterTypeDescription
bundlerstringBundler used (affects script-src for HMR in dev mode). Defaults to 'vite'.
externalConnectionsarrayExternal origins the app connects to, e.g. ['https://api.example.com', 'wss://ws.example.com']
externalImagesarrayExternal origins for images, e.g. ['https://cdn.example.com']
needsEvalbooleanWhether eval() is needed (some template compilers). Defaults to false.
needsInlineStylesbooleanWhether 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.

ParameterTypeDescription
code *stringSource code to analyze (main process, preload, or renderer)
fileTypestringWhich 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.

ParameterTypeDescription
errorOutput *stringThe build error output (stderr/stdout) to diagnose
buildToolstringWhich build tool produced the error. Defaults to 'unknown' (auto-detect).
platformstringTarget 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.

ParameterTypeDescription
provider *stringUpdate distribution method: 'github' (GitHub Releases), 's3' (AWS S3), 'generic' (any HTTP server)
autoDownloadbooleanAutomatically download updates (default true)
autoInstallOnQuitbooleanInstall update on app quit (default true)
genericUrlstringBase URL for updates (for 'generic' provider)
githubOwnerstringGitHub owner (for 'github' provider)
githubRepostringGitHub repo name (for 'github' provider)
s3BucketstringS3 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.

ParameterTypeDescription
protocol *stringCustom protocol scheme, e.g. 'myapp' (will handle myapp:// URLs)
routesarrayRoutes to handle within the protocol
singleInstancebooleanEnforce 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.

ParameterTypeDescription
name *stringProject name (lowercase, hyphens ok), e.g. 'my-electron-app'
buildToolstringBuild tool. Defaults to 'electron-vite'.
featuresarrayOptional features to include
frameworkstringFrontend 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.

ParameterTypeDescription
currentVersion *integerCurrent Electron major version (e.g. 28)
targetVersion *integerTarget 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.

ParameterTypeDescription
code *stringSource code to scan for deprecated API usage
electronVersionintegerCurrent 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.

ParameterTypeDescription
mainCodestringMain process code to analyze
packageJsonstringpackage.json content to check for bundling and dependencies
preloadCodestringPreload script code to analyze
rendererCodestringRenderer 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.

ParameterTypeDescription
concept *stringThe 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.