@alango/arc-devtools-mcp
v0.1.0
Published
MCP server to control Arc via AppleScript, with optional CDP support
Readme
arc-browser-mcp
MCP server that controls Arc via AppleScript, with optional CDP (remote-debugging-port) support for reading console/network events.
Requirements
- macOS (Arc AppleScript)
- Arc
- Bun
Install
bun installRun
bun run devbunx
After publishing to npm, you can run it without cloning:
bunx --package @alango/arc-devtools-mcp arc-devtools-mcpTools
AppleScript:
arc_list_spacesarc_focus_spacearc_list_tabsarc_get_active_tabarc_open_urlarc_focus_tabarc_close_tabarc_reload_tabarc_execute_js
CDP (remote debugging):
arc_cdp_statusarc_cdp_connectarc_cdp_disconnectarc_cdp_get_consolearc_cdp_get_network
OpenCode configuration
Add an MCP entry pointing at this repo:
{
"mcp": {
"arc": {
"command": "bash",
"args": [
"-lc",
"cd /Users/alan/Developments/arc-browser-mcp && bun run dev"
]
}
}
}Examples
List tabs:
{"tool":"arc_list_tabs","input":{}}Open a URL:
{"tool":"arc_open_url","input":{"url":"https://example.com"}}Execute JS in active tab:
{"tool":"arc_execute_js","input":{"javascript":"console.log('hello from mcp')"}}Connect to CDP and read console/network:
{"tool":"arc_cdp_connect","input":{"port":9222}}{"tool":"arc_cdp_get_console","input":{"limit":50}}{"tool":"arc_cdp_get_network","input":{"limit":200}}CDP (Console / Network)
Arc's remote debugging WebSocket can reject non-DevTools clients unless you allow the Origin.
To enable CDP for this server:
- Quit Arc
osascript -e 'tell application "Arc" to quit'- Relaunch Arc with flags
open -na "Arc" --args \
--remote-debugging-port=9222 \
--remote-allow-origins=http://127.0.0.1If you want to allow any Origin (less strict):
open -na "Arc" --args \
--remote-debugging-port=9222 \
--remote-allow-origins=*Environment variables
ARC_MCP_CDP_ORIGIN(default:http://127.0.0.1)- Must match what you pass to
--remote-allow-origins=...(unless you use*).
- Must match what you pass to
ARC_MCP_ARC_USER_DATA_DIR- Overrides the Arc user data dir used to read
DevToolsActivePort.
- Overrides the Arc user data dir used to read
Troubleshooting
403 Forbidden/ "Rejected an incoming WebSocket connection"- Arc was launched without the matching
--remote-allow-origins=.... - Fix: restart Arc with
--remote-allow-origins=http://127.0.0.1(or*).
- Arc was launched without the matching
http://127.0.0.1:9222/json/versionreturns 404- This can happen in Arc. This server falls back to
DevToolsActivePortfor browser WebSocket discovery.
- This can happen in Arc. This server falls back to
- Port is listening but connect fails intermittently
- Arc can restart/rotate the
DevToolsActivePortUUID. Re-runarc_cdp_connect.
- Arc can restart/rotate the
