You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MCPHawk is a passive sniffer for **Model Context Protocol (MCP)** traffic, similar to Wireshark but MCP-focused. It's Wireshark x mcpinspector.
14
+
MCPHawk is a passive network analyzer for **Model Context Protocol (MCP)** traffic, providing deep visibility into MCP client-server interactions. Think Wireshark meets mcpinspector, purpose-built for the MCP ecosystem.
15
15
16
-
- It captures JSON-RPC traffic between MCP clients and WebSocket/TCP-based MCP servers (IPv4 and IPv6) e.g. from any tool, agent, or LLM
17
-
- MCPHawk can reconstruct full JSON-RPC messages from raw TCP traffic without requiring a handshake.
18
-
- It captures traffic "on the wire" between any MCP client and server—does not require client/server modification.
16
+
**Key Capabilities:**
17
+
-**Protocol-Aware Capture**: Understands MCP's JSON-RPC 2.0 transport layer, capturing and reassembling messages from raw TCP streams
18
+
-**Transport Agnostic**: Monitors MCP traffic across all standard transports
19
+
-**Zero-Configuration Monitoring**: Passively observes MCP communication without proxies, certificates, or modifications to clients/servers
sudo mcphawk web --port 3000 --with-mcp --mcp-transport http --mcp-port 8765
160
177
```
161
178
162
-
## MCP Server for Querying Captured Data
179
+
## MCP Server Integration
180
+
181
+
MCPHawk includes a built-in MCP server, allowing you to query captured traffic through the Model Context Protocol itself. This creates powerful possibilities:
163
182
164
-
MCPHawk includes an MCP server that allows you to query captured traffic using the Model Context Protocol. This is perfect for:
165
-
- Building AI agents that analyze captured traffic
166
-
- Integrating traffic analysis into your MCP-enabled tools
167
-
- Programmatically searching and filtering captured data
183
+
-**AI-Powered Analysis**: Connect Claude or other LLMs to analyze traffic patterns
184
+
-**Automated Monitoring**: Build agents that detect anomalies or specific behaviors
185
+
-**Integration Testing**: Programmatically verify MCP interactions in CI/CD pipelines
168
186
169
187
<imgsrc="examples/branding/mcphawk_claudedesktop.png"alt="MCPHawk Claude Desktop MCP"width="100%">
170
188
171
-
### Available MCP Tools
189
+
### Available Tools
190
+
191
+
The MCP server exposes these tools for traffic analysis:
172
192
173
-
-**query_traffic** - Fetch logs with pagination (limit/offset)
174
-
-**get_log** - Retrieve specific log entry by ID
175
-
-**search_traffic** - Search by content, message type, or traffic type
176
-
-**get_stats** - Get traffic statistics (requests, responses, errors, etc.)
177
-
-**list_methods** - List all unique JSON-RPC methods seen
193
+
| Tool | Description | Parameters |
194
+
|------|-------------|------------|
195
+
|`query_traffic`| Fetch captured logs with pagination |`limit`, `offset`|
196
+
|`get_log`| Retrieve specific log entry |`log_id`|
197
+
|`search_traffic`| Search logs by content or type |`search_term`, `message_type`, `traffic_type`, `limit`|
198
+
|`get_stats`| Get traffic statistics | None |
199
+
|`list_methods`| List unique JSON-RPC methods | None |
178
200
179
-
### Using with Streamable HTTP Transport
201
+
### Transport Options
180
202
181
-
The HTTP transport makes it easy to test and integrate:
203
+
#### HTTP Transport (Development & Testing)
204
+
205
+
The HTTP transport uses Server-Sent Events (SSE) for streaming responses:
#### stdio Transport (Production & Claude Desktop)
201
222
202
-
Configure in Claude Desktop settings:
223
+
For Claude Desktop integration:
203
224
204
225
```json
205
226
{
@@ -212,7 +233,13 @@ Configure in Claude Desktop settings:
212
233
}
213
234
```
214
235
215
-
See [examples/stdio_client.py](examples/stdio_client.py) for a complete working example of stdio communication.
236
+
The stdio transport follows the standard MCP communication pattern:
237
+
1. Client sends `initialize` request
238
+
2. Server responds with capabilities
239
+
3. Client sends `initialized` notification
240
+
4. Normal tool calls can proceed
241
+
242
+
See [examples/mcp_sdk_client.py](examples/mcp_sdk_client.py) for HTTP client example or [examples/stdio_client.py](examples/stdio_client.py) for stdio communication.
216
243
217
244
## Platform Support
218
245
@@ -225,7 +252,7 @@ See [examples/stdio_client.py](examples/stdio_client.py) for a complete working
225
252
226
253
- Requires elevated privileges (`sudo`) on macOS/Linux for packet capture
227
254
- Limited to localhost/loopback interface monitoring
228
-
-WebSocket capture requires traffic to be uncompressed
255
+
-Cannot decrypt TLS/HTTPS traffic (WSS, HTTPS)
229
256
- IPv6 support requires explicit interface configuration on some systems
230
257
- High traffic volumes (>1000 msgs/sec) may impact performance
231
258
@@ -241,12 +268,13 @@ sudo mcphawk web --auto-detect
241
268
- Ensure the MCP server/client is using localhost (127.0.0.1 or ::1)
242
269
- Check if traffic is on the expected port
243
270
- Try auto-detect mode to find MCP traffic: `--auto-detect`
244
-
- On macOS, ensure you're allowing the terminal to capture packets in System Preferences
271
+
- Verify traffic is unencrypted (not HTTPS/TLS)
272
+
- On macOS, ensure Terminal has permission to capture packets in System Preferences
245
273
246
-
**WebSocket Traffic Not Showing:**
247
-
-Verify the WebSocket connection is uncompressed
248
-
- Check if the server is using IPv6 (::1) - MCPHawk supports both IPv4 and IPv6
249
-
-Ensure the WebSocket frames contain valid JSON-RPC messages
274
+
**SSE/HTTP Responses Not Showing:**
275
+
-Confirm the server uses standard SSE format (event: message\ndata: {...}\n\n)
276
+
- Check if responses use chunked transfer encoding
277
+
-Enable debug mode to see detailed packet analysis: `--debug`
250
278
251
279
## Potential Upcoming Features
252
280
@@ -308,10 +336,3 @@ mcphawk web --port 3000
308
336
cd frontend && npm run build:watch # Auto-rebuild on changes
0 commit comments