Get the FREE Ultimate OpenClaw Setup Guide →

mcp-sniffer

MCP Sniffer captures network traffic between MCP clients and servers and displays it in a web UI.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio shivdeepak-mcp-sniffer pipx run mcp-sniffer \
  --env LOG_LEVEL="Log level (default: INFO)" \
  --env LISTEN_HOST="Host to listen on (default: 127.0.0.1)" \
  --env LISTEN_PORT="Port to listen on (default: 3002)" \
  --env WEB_UI_HOST="Web UI host (default: 127.0.0.1)" \
  --env WEB_UI_PORT="Web UI port (default: 8888)" \
  --env UPSTREAM_HOST="Upstream MCP server host (default: 127.0.0.1)" \
  --env UPSTREAM_PORT="Upstream MCP server port (default: 3001)"

How to use

MCP Sniffer acts as a reverse proxy between MCP clients and servers, capturing request and response payloads so you can visualize traffic in a web UI, similar to a browser's Network tab but for Model Context Protocol. After installation, run the tool to start a local proxy that observes MCP conversations and serves a Web UI for inspection. Use the CLI options to customize where it listens and where it forwards traffic, as well as the Web UI location. The UI lets you inspect individual MCP requests and responses, filter by connections, and review payloads captured by the proxy.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • pipx (recommended) or pip

Installation steps:

  1. Install MCP Sniffer via pipx (recommended): pipx install mcp-sniffer

  2. Alternatively, install with pip (if you don't use pipx): pip install mcp-sniffer

  3. Run the MCP Sniffer: mcp-sniffer --listen-host 127.0.0.1 --listen-port 3002 --upstream-host 127.0.0.1 --upstream-port 3001 --web-ui-host 127.0.0.1 --web-ui-port 8888

  4. Open the Web UI in your browser at http://127.0.0.1:8888

Notes:

  • You can configure environment variables to set defaults (see mcp_config for details).
  • If you are running inside containers, ensure port mappings expose the UI and proxy ports appropriately.

Additional notes

Tips and common issues:

  • Ensure the upstream MCP server is reachable from the machine running the sniffer; firewall rules may block the port.
  • The Web UI runs on a separate port; make sure you can access it from your browser.
  • Use the environment variable options (LISTEN_HOST, LISTEN_PORT, UPSTREAM_HOST, UPSTREAM_PORT, WEB_UI_HOST, WEB_UI_PORT, LOG_LEVEL) to tailor the deployment.
  • If you encounter TLS/SSL requirements on the upstream, you may need additional configuration or a local MITM setup depending on your network.
  • The sniffer stores traffic in the live session only; consider capturing long sessions by widening the listen window and ensuring sufficient resources for payloads.

Related MCP Servers

Sponsor this space

Reach thousands of developers