For power users working with Claude’s desktop application, managing MCP tool opt-ins can become repetitive. Especially if you’re trying to use Claude in an agentic way – letting it take the reigns and execute. Stopping every minute to approve a tool, can sort of defeat the point. Here we introduce a technique to automatically approve trusted tools, streamlining your workflow. But as we’ll stress, use with caution.
The script we’re relying upon was developed by Richard Weiss (GitHub: Richard-Weiss). His work provides the foundation for the auto-approval functionality described in this article.
Important Warning
Before implementing this solution, please consider the following risks:
- Auto-approving tools removes an important security checkpoint that prevents Claude from executing potentially harmful operations without your explicit permission. We strongly advise against using this with any tools which can incur high API expenses or can delete files/content from your systems. Claude 3.7 is certainly capable but we’ve seen it go off-piste a few times in our tool enabled chats.
- The recommendation is to include only non-mutating (read-only) tools in your trusted list, such as directory listing functions
- Review the code thoroughly before implementation to ensure it meets your security requirements. If you don’t understand it, why not ask Claude to help explain it to you?
- Be aware that future Claude updates might change how tools work, potentially affecting this solution
Setup Guide
Step 1: Enable Developer Tools
First, you need to enable Developer Tools in the Claude Desktop application:
For macOS:
echo '{"allowDevTools": true}' > ~/Library/Application\ Support/Claude/developer_settings.json
For Windows:
- Navigate to
%APPDATA%\Claude
- Create or edit
developer_settings.json
to include{"allowDevTools": true}
Step 2: Access Developer Tools
- Open the Claude Desktop App
- Use the keyboard shortcut:
- macOS:
Command + Option + Shift + I
- Windows:
Ctrl + Shift + Alt + I
- macOS:
- Two DevTools windows will open – use the one with
https://claude.ai
in the window title
Step 3: Setup the Auto-Approve Script
You can set this up as a snippet for easy reuse:
- Open the “Sources” tab in the DevTools window
- Select the “Snippets” tab
- Click “New snippet”
- Name it (e.g., “ClaudeAutoApprove”)
- Paste the script (see below)
- Save with Ctrl+S or Command+S
The Script
Instead of republishing the entire code here, you can access and copy the script from Richard Weiss’s GitHub Gist:
Claude MCP Auto Approve Script
Visit the link above to view and copy the full script.
How to Use
- Open Claude Desktop and the Developer Tools
- Navigate to Snippets and run your saved script
- The script will:
- Monitor for tool permission dialogs
- Check if the requested tool is in your trusted list
- Auto-approve trusted tools
- Log activity to the console
Important Note: The snippet does not persist between sessions. You’ll need to reopen DevTools and run the snippet each time you restart the Claude Desktop app. However, using the Snippets feature makes this process much faster and easier than pasting the code each time.
You can confirm the script is running by checking the console, which will display logs like “Starting observer for trusted tools” and other status messages when tool requests are detected.
Customizing the Trusted Tools List
Modify the trustedTools
array to include only the tools you want to auto-approve:
const trustedTools = [
'list-allowed-directories', // List allowed directories
'read_file', // Read file content (non-mutating)
'search_files', // Search for files (non-mutating)
'get_file_info' // Get file metadata (non-mutating)
];
Troubleshooting
- If the script stops working after a Claude update, check the console for errors and adapt the selectors as needed
- If auto-approval is triggering too frequently, increase the
COOLDOWN_MS
value - To stop auto-approval, simply refresh the Claude app or close and reopen it
Conclusion
This auto-approval script can significantly streamline your workflow with Claude’s tools, but remember to use it responsibly. Always prioritize security by limiting auto-approval to safe, non-mutating tools that you trust.
By carefully implementing this solution, you can maintain a balance between convenience and security when working with Claude’s desktop application.
Leave a comment