Repository navigation
MCP: leave closed and filtered ports out of scan replies, send compact JSON - #502
Merged
Merged
Conversation
…t JSON scan_ports and inspect_host returned one object per scanned port. A 1,024-port scan of a LAN machine with two open ports was 136,834 bytes, almost all "closed". They now keep open, open|filtered and errored ports unless include_closed is true: the same scan is 178 bytes, 93,799 with include_closed. Tool results are serialized compactly rather than pretty-printed, which took a sweep of the local network from 15,399 bytes to 8,746. The MCP docs example is re-captured from a real session on this build.
Contributor
|
Site preview: https://pr-502.netscli-site-preview.pages.dev Built from 3b062ae with Production is unaffected: netscli.com is served from GitHub Pages via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scan_portsandinspect_hostreturned one entry for every port scanned. They now return open,open|filteredand errored ports unlessinclude_closed: true. Tool results are also compact JSON rather than indented.Measured with
netscli serveover stdio on this build against main (reply text bytes):scan_ports1–1024 on a LAN machine, 2 openinclude_closed: trueinspect_hostdefault portssweep_networklocal /24discover_networklocal /24The tool descriptions say an empty list means every port was closed or filtered. Docs example re-captured from a real session, crate README and CHANGELOG (under 0.3.4) updated.