Every time I ask Claude something that requires using an MCP server, it shows this dialog:

image.png

I wanted to automatically allow all MCP use, so I came across this post on reddit which talks about a trick in Electron apps where you can enable “DevTools” for the app. This allows you to script the app using JavaScript, change the HTML+CSS of the app (and thus, its theme and page elements!), see network traffic, etc.

This was the moment I started to like Electron apps, because this level of customizability and scriptability is rare in modern software. Emacs (with Elisp) and Microsoft Office (with VBA) have had this feature for decades, and certain macOS apps (mainly the ones shipped with the OS) list some of their “commands” and “properties” in a <app-name>.sdef which Script Editor (and Automator) can use for scripting the app. This SDEF file is accessible through Script Editor like this (there is another way which doesn’t require Script Editor; see my article on automating Spotify on macOS):

image.png

Back to MCP! Here’s how you can make Claude approve MCP use on its own (but make sure you don’t enable this for MCP tools that mutate things. For example, notice that I have commented out "edit_file", "move_file", "write_file" in the file_system MCP:

  1. On macOS, enable DevTools for the Claude app by doing this:
echo '{"allowDevTools": true}' > ~/Library/Application\\ Support/Claude/developer_settings.json
  1. Run Claude.app and press Command-Option-Shift-i. This opens up the DevTools window.
  2. There could be more than one tab. Choose the one that contains “https://claude.ai/new”. Go to Sources and make a new Snippet with any name you want. Then paste the following code in it.
  1. Save the snippet and run it by right-clicking on it. From now on, if Claude needs to use any tool mentioned in your trusted_tools list, it will automatically press the “Allow for this chat” button in the dialog that pops up.

That’s it! Hope it helps you automate your tasks.

Bonus 1: My MCP Servers

If you’re curious about my MCP “dotfile”, here it is:

{
    "mcpServers": {
        "puppeteer": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-puppeteer"
            ]
        },
        "filesystem": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-filesystem",
                "/Users/**<username>**/Desktop",
                "/Users/**<username>**/downloads"
            ]
        },
        "playwright": {
            "command": "npx",
            "args": [
                "@playwright/mcp@latest"
            ]
        },
        "MCP Neovim Server": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-neovim-server"
            ],
            "env": {
                "ALLOW_SHELL_COMMANDS": "true"
            }
        },
        "mcp-openai": {
            "command": "npx",
            "args": [
                "-y",
                "@mzxrai/mcp-openai@latest"
            ],
            "env": {
                "OPENAI_API_KEY": "**<change-this>**"
            }
        },
        "iterm-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "iterm-mcp"
            ]
        },
        "memory": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-memory"
            ]
        }
    }
}

On macOS, this is located at /Users/**<username>**/Library/Application Support/Claude/claude_desktop_config.json.

Bonus 2: Automating the automation!

I found https://github.com/itsKaynine/electron-injector which injects JavaScript code into Electron apps at runtime. This is super useful. First, install the Rust compiler: