Skip to content

velichkin/request-interceptor-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Request Interceptor MCP

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.

How It Works

Claude Code  ──(stdio/MCP)──▶  MCP Server + WS Bridge (:9876)
                                          │ WebSocket
                                          ▼
                                 Chrome Extension (MV3)
                                   chrome.debugger / CDP Fetch

Installation

npm install
npm run build -w packages/mcp-server
npm run build -w packages/chrome-extension

Setup

1. MCP Server — Claude Code CLI

claude mcp add request-interceptor -e INTERCEPTOR_BRIDGE_PORT=9876 -- node /absolute/path/to/packages/mcp-server/dist/index.js

2. MCP Server — Claude Desktop

Add 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" }
    }
  }
}

3. Chrome Extension

  1. Open chrome://extensions
  2. Enable Developer mode
  3. Load unpacked → select the packages/chrome-extension/dist/ folder
  4. On the target tab, open the extension popup and click Attach Debugger

Usage

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.

Notes

  • 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 9876 and can be changed via the INTERCEPTOR_BRIDGE_PORT environment variable.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors