A Model Context Protocol (MCP) server that captures console logs from Chrome/Edge browsers via a browser extension and exposes them to MCP clients.
Web Page Console → Chrome Extension → HTTP Bridge → MCP Server → MCP Client
- Real-time Console Log Capture: Captures console.log, console.warn, console.error, etc.
- MCP Resources: Exposes logs as structured data via MCP protocol
- Search & Filter: Search logs by content, level, URL, and time range
- Export Options: Export logs in JSON, CSV, or text format
- Statistics: Get detailed statistics about captured logs
- Cross-browser: Works with Chrome and Edge
npm install
npm run build:all
For Chrome:
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked" and select the
dist/extension
directory
For Edge:
- Open Edge and go to
edge://extensions/
- Enable "Developer mode"
- Click "Load unpacked" and select the
dist/extension
directory
# Start with default port (8765)
npm start
# Start with custom port
node dist/index.js --port 9000
npm run inspector
- Open any webpage in Chrome
- Open Developer Tools (F12)
- Go to the "Console MCP" panel
- Click "Start Capture" to begin capturing console logs
- Console logs from the webpage will appear in the panel and be forwarded to the MCP server
- Use the "Settings" button to configure the server port if needed
- Use the "Filters" button to add custom console/network filters as needed
-
console://logs/all
- All captured console logs -
console://logs/recent
- Last 100 console logs -
console://stats
- Statistics about captured logs
-
search_logs
- Search logs by term, level, or URL -
export_logs
- Export logs in various formats -
clear_logs
- Clear all stored logs -
get_log_stats
- Get log statistics -
get_server_info
- Get server information including current port
# Watch mode for TypeScript
npm run dev
# Build extension only
npm run extension:build
# Build everything
npm run build:all
- Ensure the MCP server is running:
npm start
- Check that the configured port (default 8765) is not blocked by firewall
- Verify the extension is loaded in Chrome/Edge
- Check the browser console for HTTP connection errors
- Make sure "Start Capture" is clicked in the DevTools panel
- Check that console logs are actually being generated on the webpage
- Look for errors in the browser console and DevTools panel console
chrome-console-mcp/
├── src/ # MCP server source code
│ ├── index.ts # Main MCP server
│ ├── console-manager.ts # Log management
│ ├── http-bridge.ts # HTTP bridge (configurable port)
│ └── types.ts # Type definitions
├── extension/ # Chrome extension
│ ├── manifest.json # Extension manifest
│ ├── background.js # Background script
│ └── devtools/ # DevTools panel
└── dist/ # Built files