refactor(yaad): migrate MCP server onto hawk-mcpkit#35
Merged
Conversation
api/proto/yaad.proto defined the full YaadService (14 RPCs incl. 2 streaming) but had no generated Go code and no server implementation — PLAN.md and ARCHITECTURE.md both marked this explicitly TODO. Generates Go code via buf (new buf.gen.yaml) and adds GrpcServer, a thin adapter over *engine.Engine following the same pattern as RESTServer/MCPServer. WatchMemories/WatchStale bridge to the existing SSEBroadcaster used by REST's SSE streaming, so there's one subscription mechanism, not two. Verified with a real bufconn-based in-process client/server exercising every RPC, including a live streaming delivery test.
internal/bench's harness (R@K/MRR) already worked but had only an 18-question self-seeded QA set, no external-corpus coverage. Adds benchmark/locomo, a data adapter for the public LoCoMo-10 dataset (snap-research/locomo), and benchmark/cmd/locomobench to run it — the harness itself is reused unmodified. Ran it for real: 1,540 non-adversarial QA pairs across 10 conversations, R@1 3.1%/R@10 19.1%/MRR 0.072, published under benchmark/results/yaad-locomo/2026-07-15/. Numbers are structurally lower than yaad-longmem-core's self-seeded baseline by design, not regression — see that run's notes.md for why (substring-match proxy vs. LoCoMo's real LLM-judged generation metric, paraphrased/computed answers).
yaad re-implemented (transport wiring, HTTP-level auth middleware, the strArg/jsonResult handlers) that hawk-mcpkit already provides. Replace the raw *mcpserver.MCPServer with a *mcpkit.Server and route every tool/prompt/resource registration through it. WithAPIKey now uses kit.WithHTTPToken (HTTP-level bearer/apikey gating), transports delegate to kit.ServeStdio/ServeHTTP/ServeHTTPWithShutdown, and the duplicated auth middleware, buildHTTPServer, body cap, and helper functions are deleted. Handler signatures and behavior are unchanged; strArg/intArgOr stay as small unexported yaad helpers.
From hawk/external/yaad the sibling hawk-mcpkit resolves at ../../../hawk-mcpkit (the sibling copy uses ../hawk-mcpkit).
Patel230
added a commit
that referenced
this pull request
Jul 16, 2026
* Implement gRPC server for the existing YaadService proto api/proto/yaad.proto defined the full YaadService (14 RPCs incl. 2 streaming) but had no generated Go code and no server implementation — PLAN.md and ARCHITECTURE.md both marked this explicitly TODO. Generates Go code via buf (new buf.gen.yaml) and adds GrpcServer, a thin adapter over *engine.Engine following the same pattern as RESTServer/MCPServer. WatchMemories/WatchStale bridge to the existing SSEBroadcaster used by REST's SSE streaming, so there's one subscription mechanism, not two. Verified with a real bufconn-based in-process client/server exercising every RPC, including a live streaming delivery test. * Ingest LoCoMo-10 external benchmark, publish first honest baseline internal/bench's harness (R@K/MRR) already worked but had only an 18-question self-seeded QA set, no external-corpus coverage. Adds benchmark/locomo, a data adapter for the public LoCoMo-10 dataset (snap-research/locomo), and benchmark/cmd/locomobench to run it — the harness itself is reused unmodified. Ran it for real: 1,540 non-adversarial QA pairs across 10 conversations, R@1 3.1%/R@10 19.1%/MRR 0.072, published under benchmark/results/yaad-locomo/2026-07-15/. Numbers are structurally lower than yaad-longmem-core's self-seeded baseline by design, not regression — see that run's notes.md for why (substring-match proxy vs. LoCoMo's real LLM-judged generation metric, paraphrased/computed answers). * refactor(yaad): migrate MCP server onto hawk-mcpkit yaad re-implemented (transport wiring, HTTP-level auth middleware, the strArg/jsonResult handlers) that hawk-mcpkit already provides. Replace the raw *mcpserver.MCPServer with a *mcpkit.Server and route every tool/prompt/resource registration through it. WithAPIKey now uses kit.WithHTTPToken (HTTP-level bearer/apikey gating), transports delegate to kit.ServeStdio/ServeHTTP/ServeHTTPWithShutdown, and the duplicated auth middleware, buildHTTPServer, body cap, and helper functions are deleted. Handler signatures and behavior are unchanged; strArg/intArgOr stay as small unexported yaad helpers. * fix(yaad): correct mcpkit replace path for external submodule layout From hawk/external/yaad the sibling hawk-mcpkit resolves at ../../../hawk-mcpkit (the sibling copy uses ../hawk-mcpkit). * fix(yaad): use sibling mcpkit path for external submodule layout * ci: clone sibling hawk-mcpkit for mcpkit dependency
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.
Summary
Migrates yaad MCP server from raw mark3labs/mcp-go onto the shared hawk-mcpkit scaffolding, giving yaad the kit standard construction, transports (stdio + streamable HTTP), and auth gates without hand-rolling them. Also includes the LoCorado-10 external benchmark ingest baseline and a gRPC server for the existing YaadService proto.
Why
Consistency with sight and inspect; removes duplicated MCP boilerplate and adopts the ecosystem standard construction + transports + HTTP auth.
Verification