Skip to content

fix: SSE body cap parity, remove dead MCPGraph, tool-search docs - #9

Merged
Patel230 merged 5 commits into
mainfrom
fix/audit-sweep-2026-08
Aug 16, 2026
Merged

fix: SSE body cap parity, remove dead MCPGraph, tool-search docs#9
Patel230 merged 5 commits into
mainfrom
fix/audit-sweep-2026-08

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

  • SSE transport now applies the body-size cap on bearer-only and no-auth paths (matches the comment's parity claim and the streamable-HTTP transport). Regression test included.
  • Dead MCPGraph/MCPNode/MCPEdge types deleted (zero importers outside graph.go).
  • Vault docstring rescope (in-memory only, no persistent backing).
  • Tool-search index drift documented loudly; Search() results now sorted by name.

buildSSEServer now routes the SSE handler through an http.Server wrapped
in the same middleware as the streamable HTTP transport: httpTokenHandler
(auth + body cap) on the WithHTTPToken path, capBodyHandler (body cap)
on the bearer-only and no-auth paths. Previously only the token path of
ServeSSE capped the body, and ServeSSEWithShutdown skipped the token gate
entirely, contradicting the parity the file's header comment claims.

Wiring via mcpserver.WithHTTPServer keeps SSEServer.Start/Shutdown
managing the wrapped server, so the shutdown contract is unchanged.
graph.go (MCPNode/MCPEdge/MCPGraph/NewMCPGraph) has zero references
outside its own test — verified by grep across mcpkit, yaad, sight,
inspect, eyrie, tok, trace, hawk-core-contracts, and hawk itself.
Consumers project their own graph shapes; AddGraphResource and
GraphMIMEType in mcpkit.go stay (they are referenced).
Remove the 'var _ = fmt.Sprintf' import-keeper in vault.go, and
rewrite the file's package comment to describe what the vault actually
does: a strictly in-memory store with no persistent backing and no
zeroization of secret values on Delete. The previous wording implied
an OS-keychain/encrypted-file backing that does not exist.
Search iterates an internal map, so result order was nondeterministic;
sort by tool name in both the empty-query and term-query branches and
pin the behavior with TestToolSearchIndexSearch_SortedOrder. Also add
loud doc comments on IndexTool (index- and Server-level) and
SearchTools: the index is NOT kept in sync with AddTool and nothing
indexes automatically, so callers must index each tool explicitly.
- transport_sse.go: omit redundant type in handler declaration (ST1023)
- go.mod + CI: Go 1.26.6 — 1.26.5 stdlib has reachable vulns
  (GO-2026-6090, GO-2026-6089) that fail govulncheck
@Patel230
Patel230 merged commit 4a5ea25 into main Aug 16, 2026
12 checks passed
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