Skip to content

Automating Claude Desktop via Chrome DevTools Protocol

tools 1 min read

Electron apps support the Chrome DevTools Protocol. That means Claude Desktop can be launched with a debug flag and controlled programmatically:

/Applications/Claude.app/Contents/MacOS/Claude --remote-debugging-port=9222

Hit localhost:9222 and you can inject JavaScript directly into the UI. From there, things get interesting fast.

What you can do

  • Extract responses — Use a MutationObserver to capture Claude’s outputs as JSON
  • Auto-approve MCP dialogs — Automatically click through permission prompts
  • Voice integration — Pipe Whisper transcription into the prompt field, add text-to-speech on the output
  • Custom shortcuts — Add keyboard listeners for things like Ctrl+Shift+E to export conversations
  • Multi-instance orchestration — Run multiple Claude windows on different debug ports, each specialized for a different task

The recursive bit

Claude Desktop runs MCP servers. MCP servers can invoke the DevTools Protocol. Which means Claude Desktop can drive another Claude Desktop instance. The control layer becomes another thing the AI can operate.

  • electron-mcp-server
  • claude-autoapprove
  • Claude_Automation
  • codemcp
  • Auto-Actions Framework

The security surface here is real — combining keyboard listeners with response extraction in an MCP server is basically a keylogger with AI output capture. Worth thinking about as MCP adoption grows.


Originally posted on LinkedIn

Navigate with