This extension integrates BrowserTools MCP (Model Context Protocol) into Zed editor, providing browser monitoring and interaction capabilities through Zed's assistant system.
- Browser Capture: Capture screenshots, console logs, and DOM elements from your current browser page
- Browser Audit: Run various audits including accessibility, performance, SEO, and best practices
- Browser Debug: Start a comprehensive browser debugging session
- Zed Editor
- Rust installed via rustup
- Node.js (v14 or higher)
- BrowserTools Chrome Extension installed in your Chrome browser
-
Clone this repository:
git clone https://github.com/mirageN1349/browser-tools-context-server cd browser-tools-context-server
-
Open Zed Editor
-
Navigate to Extensions
-
Click "Install Dev Extension" and select the directory where you cloned this repository
- Open Zed Editor
- Navigate to Extensions
- Search for "BrowserTools Context Server"
- Click "Install"
Add the following to your Zed settings.json:
{
"context_servers": {
"browser-tools-context-server": {
"settings": {
"port": 3025,
"host": "127.0.0.1",
"server_command": "npx",
"server_args": ["@agentdeskai/browser-tools-server@1.2.0"]
}
}
}
}
You can customize the port, host, server command and args if needed.
- Download the BrowserTools Chrome Extension
- Install in Chrome by navigating to chrome://extensions, enabling "Developer mode", and clicking "Load unpacked"
- Select the unzipped extension folder
After installing the extension and the Chrome extension:
- Open Chrome with the BrowserTools extension enabled
- Open Zed and ensure the BrowserTools Context Server extension is activated
- Run the following command in your terminal to start the server manually:
npx @agentdeskai/browser-tools-server@1.2.0
- Open the Assistant in Zed
- Use any of the following slash commands:
-
/browser-capture screenshot
- Take a screenshot of the current page -
/browser-capture logs
- View browser console logs -
/browser-capture errors
- View browser console errors -
/browser-capture network
- View browser network logs -
/browser-capture network-errors
- View browser network errors -
/browser-capture clear
- Clear logged data -
/browser-capture element
- Get information about a selected DOM element -
/browser-audit accessibility
- Run an accessibility audit -
/browser-audit performance
- Run a performance audit -
/browser-audit seo
- Run an SEO audit -
/browser-audit best-practices
- Check best practices -
/browser-audit nextjs
- Run NextJS-specific audit (if applicable) -
/browser-audit all
- Run all available audits -
/browser-debug start
- Start comprehensive debugger mode
This extension:
- Integrates with Zed's context server system to launch the BrowserTools MCP server
- Automatically installs required npm packages (@agentdeskai/browser-tools-mcp and @agentdeskai/browser-tools-server)
- Provides slash commands that communicate with the MCP server
- The MCP server communicates with the Chrome extension to capture and analyze browser data
- Make sure the Chrome extension is installed and enabled
- Check that your browser is running and the extension is active (you should see the BrowserTools icon in Chrome)
- Verify that the ports in your configuration match those used by the Chrome extension
- If you encounter issues, try restarting both Chrome and Zed
To modify this extension:
- Make changes to the source code
- Reinstall as a dev extension in Zed
- Test your changes
MIT