A terminal-based JSON-RPC debugger with interception capabilities, built with Rust and ratatui. Inspect, modify, and debug JSON-RPC requests and responses in real-time.
Demo video of pointing metamask JSON-RPC at the debugger:
Screen.Recording.2025-06-03.at.3.44.25.PM.mov- 🔍 Real-time monitoring of JSON-RPC requests and responses with timing information
- ⏸️ Request interception - pause, inspect, and modify requests before forwarding
- 🎨 Syntax highlighting for JSON content with proper indentation
- 📊 HTTP headers display for debugging transport details
- ⌨️ Vim-style navigation with comprehensive keyboard shortcuts
- 🎯 Dynamic configuration - change target URL and port on the fly
- 📝 External editor support for request/response modification
- 📋 Table view with status, transport, method, ID, and duration columns
- 🔄 Custom response creation for intercepted requests
- Rust 1.70+ (install from rustup.rs)
Start the debugger with default settings (port 8080, no default target):
Once the debugger is running, send JSON-RPC requests to the proxy:
The TUI is divided into three main sections:
- ✓ Success - Request completed successfully
- ✗ Error - Request returned an error
- ⏳ Pending - Request sent, waiting for response
- ↑/↓ or Ctrl+p/Ctrl+n - Navigate between requests
- j/k - Scroll details panel up/down (vim-style)
- d/u or Ctrl+d/Ctrl+u - Page down/up in details
- G - Go to bottom of details
- g - Go to top of details
- s - Start/stop the proxy server
- t - Edit target URL
- c - Create new request (normal mode) / Complete request with custom response (intercept mode)
- q - Quit application
- p - Toggle pause mode (intercept new requests)
- a - Allow selected intercepted request
- e - Edit selected request body in external editor
- h - Edit selected request headers in external editor
- c - Complete request with custom response
- b - Block selected request
- r - Resume all pending requests
The debugger supports Charles Proxy-style request interception:
- Enable pause mode: Press p to start intercepting requests
- Make requests: Send JSON-RPC requests to the proxy
- Inspect: Intercepted requests appear in the pending list with ⏸ icon
- Modify:
- Press e to edit request body in your external editor
- Press h to edit HTTP headers
- Press c to create a custom response
- Control: Press a to allow, b to block, or r to resume all
The debugger uses your system's default editor for request modification:
- Checks $EDITOR environment variable
- Falls back to $VISUAL
- Defaults to vim, then nano, then vi
Modified requests show with a ✏ icon and [MODIFIED] or [BODY]/[HEADERS] labels.
- EDITOR - Preferred text editor for request modification
- VISUAL - Alternative editor (fallback)
Some ports may conflict with system services:
- Port 7000: Used by Apple AirPlay on macOS
- Port 5000: Often used by other development tools
Use alternative ports like 8080, 9090, 3000, 4000, 8000, or 8888.
- Start the debugger: jsonrpc-debugger
- Set target URL: Press t and enter your target
- Enable pause mode: Press p
- Make a request (it will be intercepted)
- Edit the request: Press e to modify body or h for headers
- Allow the modified request: Press a
- Enable pause mode and intercept a request
- Press c to create a custom response
- Edit the JSON response in your external editor
- The custom response is sent back to the client
- Press c in normal mode
- Edit the JSON-RPC request template in your external editor
- The request is sent through the proxy to the target
If you get a "port already in use" error:
If requests fail with "connection refused":
- Check that the target URL is correct and reachable
- Verify the target server is running
- Test the target directly with curl
- Make sure you've set a target URL (press t in the TUI)
If external editing fails:
The debugger displays JSON with:
- 2-space indentation
- Syntax highlighting (keys in cyan, strings in green, numbers in blue, etc.)
- Proper line breaks and formatting
If JSON appears malformed, check that the original request/response is valid JSON.
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
.png)

