Shared MCP tool infrastructure for the algo2go/* module family. Hosts the
three intermediate-leaf packages that every per-domain tool sub-module
(trade, portfolio, admin, alerts, analytics, paper, misc) imports.
Packages
common — Tool + Tool2 interfaces, ToolHandler + ToolHandlerDeps
(27 typed Provider ports composed via the 5-context Investment-K builder),
WithSession/WithViewerBlock/WithTokenRefresh session+RBAC helpers,
MarshalResponse + SanitizeData + LLM-injection guards, TTL/LRU cache,
elicitation primitives, ToolManifest integrity hashing, retry helpers.
18 production files, 2,432 LOC.
plugin — Registry struct + RegisterInternalTool (the per-tool
init()-time registration surface) + plugin discovery + 7 widget-plugin
helpers. Cross-depends on common for the Tool interface. 14 production
files, ~2,925 LOC.
middleware — Fully clean leaf. Timeout, correlation-ID,
circuit-breaker, and middleware-chain primitives. 6 production files,
~702 LOC. No coupling to common or plugin.
Cross-package dependencies (within this module)
plugin → common (one-way, via the Tool interface)
middleware → (nothing else in this module — fully independent leaf)
common → (no intra-module deps; its own external surface)
Origin
Extracted 2026-05-16 from github.com/algo2go/kite-mcp-bootstrap/mcp/{common,plugin,middleware}
as Phase 2 of the bootstrap-decomposition arc (Shape A* in the strategy doc
at kite-mcp-server/.research/bootstrap-decomp-strategy.md, commit
280ae67). Zero behavior change at extraction; the canonical consumer
(kite-mcp-bootstrap) imports this module via replace during the
Phase A canary window, then via GOPROXY once Phase B canary deletion
lands.
License
MIT — see LICENSE.