Skip to content

MCP: leave closed and filtered ports out of scan replies, send compact JSON - #502

Merged
fstubner merged 1 commit into
mainfrom
fix/mcp-compact-output
Oct 3, 2026
Merged

fstubner merged 1 commit into
mainfrom
fix/mcp-compact-output

Conversation

@fstubner

@fstubner fstubner commented Oct 3, 2026

Copy link
Copy Markdown
Owner

scan_ports and inspect_host returned one entry for every port scanned. They now return open, open|filtered and errored ports unless include_closed: true. Tool results are also compact JSON rather than indented.

Measured with netscli serve over stdio on this build against main (reply text bytes):

Call main this branch
scan_ports 1–1024 on a LAN machine, 2 open 136,834 178
same, include_closed: true 93,799
inspect_host default ports 850 291
sweep_network local /24 15,399 8,746
discover_network local /24 4,367 3,317

The 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.

…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.
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Site preview: https://pr-502.netscli-site-preview.pages.dev

Built from 3b062ae with NETSCLI_PREVIEW=1 — noindex, and analytics disabled so it does not report into netscli.com's numbers.

Production is unaffected: netscli.com is served from GitHub Pages via pages.yml, which is manual-only.

@fstubner
fstubner merged commit 4300b7f into main Oct 3, 2026
16 checks passed
@fstubner
fstubner deleted the fix/mcp-compact-output branch October 3, 2026 19:40
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.

1 participant