Skip to content

feat: add load_traffic_file tool for importing HAR and flow files#9

Merged
snapspecter merged 2 commits intosnapspecter:mainfrom
sleeyax:feat/load-traffic-file
Mar 31, 2026
Merged

feat: add load_traffic_file tool for importing HAR and flow files#9
snapspecter merged 2 commits intosnapspecter:mainfrom
sleeyax:feat/load-traffic-file

Conversation

@sleeyax
Copy link
Copy Markdown
Contributor

@sleeyax sleeyax commented Mar 27, 2026

Import flows from HAR or mitmproxy flow files into the traffic DB without running the proxy. Supports scope filtering and append mode.

Example usage using GitHub copilot in vscode:

image

sleeyax and others added 2 commits March 27, 2026 22:51
Import flows from HAR or mitmproxy flow files into the traffic DB
without running the proxy. Supports scope filtering and append mode.
@snapspecter
Copy link
Copy Markdown
Owner

Thanks, this is definitely a useful feature.

I made a few small changes before merging:

Async Unblocking: Wrapped the import_from_file execution in asyncio.to_thread so that reading large HAR/flow files won't block the MCP server's main event loop.
Security / Path Validation: Added os.path.exists validation and restricted imports to files ending in .har, .mitm, or .flow to prevent any unintended arbitrary file reads via the MCP interface.
Scope Checking: Fixed a minor issue where scope checking was using a basic substring match instead of checking for exact domain/suffix matches (apple.com previously would have incorrectly matched myapple.com).

@snapspecter snapspecter merged commit 5cba569 into snapspecter:main Mar 31, 2026
@sleeyax
Copy link
Copy Markdown
Contributor Author

sleeyax commented Mar 31, 2026

Perfect, thank you for improving and merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants