Intercept and mock HTTP responses in Chrome via MCP tools. An AI assistant configures the rules — the Chrome extension applies them, substituting the response body, status code, and headers.
Claude Code ──(stdio/MCP)──▶ MCP Server + WS Bridge (:9876)
│ WebSocket
▼
Chrome Extension (MV3)
chrome.debugger / CDP Fetch
npm install
npm run build -w packages/mcp-server
npm run build -w packages/chrome-extensionclaude mcp add request-interceptor -e INTERCEPTOR_BRIDGE_PORT=9876 -- node /absolute/path/to/packages/mcp-server/dist/index.jsAdd to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"request-interceptor": {
"command": "node",
"args": ["/absolute/path/to/packages/mcp-server/dist/index.js"],
"env": { "INTERCEPTOR_BRIDGE_PORT": "9876" }
}
}
}- Open
chrome://extensions - Enable Developer mode
- Load unpacked → select the
packages/chrome-extension/dist/folder - On the target tab, open the extension popup and click Attach Debugger
Once the MCP server is running and the extension is connected, give commands through Claude:
Mock the response for https://api.example.com/users with [{"id":1,"name":"Test"}]
Available MCP tools:
| Tool | Description |
|---|---|
add_rule |
Adds an interception rule |
list_rules |
Lists all rules |
remove_rule |
Removes a rule by ID |
toggle_rule |
Enables / disables a rule |
add_rule accepts: urlPattern (supports * wildcards), method (optional), responseBody, responseStatusCode, responseHeaders.
- Chrome displays a yellow "debugging" banner on tabs with an attached debugger — this is expected for a dev tool.
- Rules are stored in memory only; they must be re-added after restarting the MCP server.
- The bridge port defaults to
9876and can be changed via theINTERCEPTOR_BRIDGE_PORTenvironment variable.