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
Give 2026-07-28 clients the initialize-free server/discover path. Streamable HTTP is sessionless and does not issue Mcp-Session-Id; older protocol versions remain a compatibility fallback and do not change the modern path.
Add strict JSON Schema 2020-12 input and output contracts, structured results with JSON text fallback, opaque attachment resources, cache metadata, trace propagation, and private internal-error isolation.
Harden HTTP with origin, protocol-header, request-size, rate, concurrency, and read-only-by-default controls.
Expand raw modern and legacy transport coverage across every advertised tool shape, and make the daemon-stop progress test deterministic.
Why
The previous server used a 2025-era stateful MCP stack. It could not give current agents sessionless discovery, per-request protocol metadata, structured output, resource caching, and the 2026-07-28 HTTP contract without msgvault owning a second protocol implementation. The official SDK now provides the modern path while keeping older clients usable.
Usage
Run msgvault mcp for stdio with the full local tool set. Run msgvault mcp --http 127.0.0.1:8080 for stateless Streamable HTTP; HTTP stays read-only by default. Add --http-allow-writes only for trusted clients that need export_attachment or stage_deletion.
The migration is generally sound, but one medium-severity regression should be fixed before merging.
Medium
internal/mcp/handlers.go:1595 — get_stats now fails entirely when vector statistics collection partially fails, even though CollectStats returns usable partial data and archive/account statistics have already succeeded. Log the vector error and return the partial StatsView to preserve best-effort behavior.
Addressed the get_stats finding in a0c287e. Vector statistics remain best effort: partial StatsView data is returned with archive and account statistics, while the underlying vector error is logged privately. Added a regression test that failed on the prior behavior. Focused MCP tests, the full internal/mcp package, repo vet, and lint (0 issues) pass.
Code is generally sound, but daemon-backed search errors need proper MCP translation.
Medium
internal/mcp/handlers.go:218 — bodySearchError recognizes only local query sentinels, so expected daemon errors such as invalid_query, body_search_unavailable, and body_search_index_unavailable become generic JSON-RPC internal errors. Similar remote input errors, including invalid account or pagination scope, also fall through dependencyError.
Fix: Safely whitelist and translate known daemon APIErrorCode() values into tool-error results with static messages, keep unknown codes isolated, and add coverage for daemon-backed adapters.
Addressed the daemon error-translation finding in a2ded20. MCP now converts only a fixed whitelist of known daemon request/search codes to static tool-error messages. Raw daemon messages never cross the wire; unknown codes still return generic -32603 and are logged privately. Regression coverage runs real daemonclient adapters for body, hybrid, and similar searches. Focused adapter tests, the full internal/mcp package, repo vet, and lint (0 issues) pass.
The migration is generally sound, but one medium-severity resource-control gap remains.
Medium
internal/mcp/middleware.go:96 — The invocation limiter applies only to tools/call, allowing resources/read to bypass rate and concurrency limits while loading and base64-encoding attachments up to 50 MiB. Parallel reads could exhaust server memory. Apply equivalent rate and concurrency controls to resources/read, returning an appropriate JSON-RPC busy error when saturated.
Fixed the resource-read limiter gap in 90b51cbc. resources/read now shares the same process-wide rate and concurrency policy as tools/call. Saturated reads return a stable -32000 JSON-RPC busy error before the attachment reader runs. Added raw modern HTTP regression coverage for both token-burst exhaustion and concurrent reads. Focused tests, the full tagged internal/mcp package, repository-wide vet, and lint (0 issues) pass.
Pushed final CI portability corrections in 7c8ea0d2. The raw stdio peer now uses portable bounded I/O instead of os.File.SetDeadline, which Windows anonymous pipes do not support. The Nix vendorHash is updated to the exact fixed-output hash reported after the official SDK dependency change. Focused stdio/resource tests, the full tagged internal/mcp package, repository-wide vet, and lint (0 issues) pass. Roborev found no issues on the prior head; this final head is ready for another review.
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
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.
What changed
server/discoverpath. Streamable HTTP is sessionless and does not issueMcp-Session-Id; older protocol versions remain a compatibility fallback and do not change the modern path.Why
The previous server used a 2025-era stateful MCP stack. It could not give current agents sessionless discovery, per-request protocol metadata, structured output, resource caching, and the 2026-07-28 HTTP contract without msgvault owning a second protocol implementation. The official SDK now provides the modern path while keeping older clients usable.
Usage
Run
msgvault mcpfor stdio with the full local tool set. Runmsgvault mcp --http 127.0.0.1:8080for stateless Streamable HTTP; HTTP stays read-only by default. Add--http-allow-writesonly for trusted clients that needexport_attachmentorstage_deletion.