Simple HTTP proxy logger that captures and logs HTTP requests and responses. It includes a web UI for viewing and managing the logs. Filter error codes and path. Based on mitm.
- Proxies HTTP requests and logs them to files
- Web UI for viewing request/response details
- Ability to clear logs with a single button
- Auto-refresh to show new requests
- Color-coded method types and error statuses
Configuration is managed through config.yaml:
# Proxy Configuration
server:
listen_port: 8083 # Port that the proxy server listens on
forward_port: 8081 # Port to forward requests to
host: localhost # Host for both listening and forwarding
ui:
enabled: true # Whether to enable the UI
port: 8080 # Port for the UI web server
logging:
log_dir: request_log # Directory to store logs-
Install dependencies:
make install -
Run the proxy:
make start -
Access the UI in your browser:
http://localhost:8080 -
Configure your client to use the proxy (e.g.,
http://localhost:8083)
Note: The
main.pyproxy buffers full responses and is best for standard HTTP. SSE streams are long-lived and should be inspected with mitmproxy using the addon below.
You can specify a custom configuration file using the PROXY_CONFIG environment variable:
PROXY_CONFIG=/path/to/custom-config.yaml python main.py
This repo includes a mitmproxy addon that logs SSE frames and JSON-RPC POST bodies. It is more reliable than the buffering proxy when debugging MCP SSE transports.
-
Install mitmproxy:
uv pip install -r requirements.txt -
Start mitmproxy with the addon:
MCP_SSE_LOG_DIR=./sse_logs \ mitmdump -p 8085 -s addons/mcp_sse_logger.py --set stream_large_bodies=0Or via Make (override vars as needed):
MCP_SSE_LOG_DIR=./sse_logs \ make mitm-sse -
Route your client through the proxy:
HTTP_PROXY=http://127.0.0.1:8085 \ HTTPS_PROXY=http://127.0.0.1:8085 \ NO_PROXY= \ mcp-cli --url http://127.0.0.1:8080/sse --transport sse list
If your client ignores proxy settings for localhost (Go clients do this by default), run mitmproxy in reverse mode and point the client directly at the mitm port:
MCP_SSE_LOG_DIR=./sse_logs \
mitmdump -p 8085 -s addons/mcp_sse_logger.py --set stream_large_bodies=0 \
--mode reverse:http://127.0.0.1:8080
# Or via Make:
MCP_SSE_LOG_DIR=./sse_logs \
make mitm-sse MITM_MODE=--mode\ reverse:http://127.0.0.1:8080
mcp-cli --url http://127.0.0.1:8085/sse --transport sse list
Log output:
sse_logs/sse_*.logcaptures the SSE stream (event:/data:lines).sse_logs/sse_posts.logcaptures client->server JSON-RPC POST bodies.
Notes:
- For HTTPS targets, install the mitmproxy CA cert or use
--ssl-insecureas needed. NO_PROXYoften includes127.0.0.1by default; clear it to ensure proxying.
- View a list of all captured requests
- Click on a request to see detailed information
- View request/response headers and bodies
- Clean all logs with a single button
- Auto-refresh to show new requests as they come in
