Skip to content

refactor(yaad): migrate MCP server onto hawk-mcpkit#35

Merged
Patel230 merged 6 commits into
mainfrom
refactor/yaad-mcpkit-migration
Jul 15, 2026
Merged

refactor(yaad): migrate MCP server onto hawk-mcpkit#35
Patel230 merged 6 commits into
mainfrom
refactor/yaad-mcpkit-migration

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

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

  • go build ./..., go test ./... pass with the replace directive pointing at the local hawk-mcpkit

Patel230 added 6 commits July 15, 2026 11:17
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
Patel230 merged commit 7d52bde into main Jul 15, 2026
12 checks passed
@Patel230
Patel230 deleted the refactor/yaad-mcpkit-migration branch July 15, 2026 20:58
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
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