Context
GET /v1/upstream/ruleset (src/api/routes.ts:2335) returns the latest upstream ruleset snapshot (getLatestUpstreamRulesetSnapshot) — public, unauthenticated, no params, explicitly grouped in the code comment above /v1/finding-taxonomy as "the same class of public static discovery data as /v1/scoring/model and /v1/upstream/ruleset." Its sibling GET /v1/upstream/drift (which embeds loadUpstreamStatus plus recent drift reports) is already exposed as loopover_get_upstream_drift (remote MCP + local stdio). The raw ruleset snapshot itself — genuinely distinct data, not returned by the drift tool's payload — has neither.
Requirements
⚠️ Required pattern — mirror loopover_get_upstream_drift's two-surface shape exactly (src/mcp/server.ts:2330-2337, stdio registration packages/loopover-mcp/bin/loopover-mcp.ts:1916-1923). This tool takes no input (the REST route has zero path/query params) — use an empty/no-argument input schema. No separate human CLI verb exists for upstream-drift either — do not add one here.
- Register
loopover_get_upstream_ruleset as a remote MCP tool in src/mcp/server.ts, no input arguments, calling getLatestUpstreamRulesetSnapshot exactly as the REST route does — including its not-found case (upstream_ruleset_not_found when no snapshot exists yet).
- Add
loopover_get_upstream_ruleset to MCP_TOOL_CATEGORIES as "utility" (the category loopover_get_upstream_drift uses).
- Register
loopover_get_upstream_ruleset as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts, calling GET /v1/upstream/ruleset via apiGet.
- Do not add a new human-typable CLI verb.
- Do not change
getLatestUpstreamRulesetSnapshot, the REST route, or its (lack of) auth.
Deliverables
Test Coverage Requirements
src/mcp/server.ts and packages/loopover-mcp are both under the 99%+ Codecov patch gate — cover both the found and not-found branches. Mirror loopover_get_upstream_drift's test for the tool-registration shape.
Expected Outcome
loopover_get_upstream_ruleset is reachable via remote MCP and local stdio MCP, matching its existing public REST route — an MCP client can pull the raw upstream ruleset the same way it already can pull the drift report.
Links & Resources
src/api/routes.ts:2335 (existing REST route, public/unauthenticated)
src/mcp/server.ts:2330-2337, packages/loopover-mcp/bin/loopover-mcp.ts:1916-1923 (the loopover_get_upstream_drift pattern to mirror)
src/mcp/server.ts:1798-1890 (MCP_TOOL_CATEGORIES map)
Context
GET /v1/upstream/ruleset(src/api/routes.ts:2335) returns the latest upstream ruleset snapshot (getLatestUpstreamRulesetSnapshot) — public, unauthenticated, no params, explicitly grouped in the code comment above/v1/finding-taxonomyas "the same class of public static discovery data as/v1/scoring/modeland/v1/upstream/ruleset." Its siblingGET /v1/upstream/drift(which embedsloadUpstreamStatusplus recent drift reports) is already exposed asloopover_get_upstream_drift(remote MCP + local stdio). The raw ruleset snapshot itself — genuinely distinct data, not returned by the drift tool's payload — has neither.Requirements
loopover_get_upstream_rulesetas a remote MCP tool insrc/mcp/server.ts, no input arguments, callinggetLatestUpstreamRulesetSnapshotexactly as the REST route does — including its not-found case (upstream_ruleset_not_foundwhen no snapshot exists yet).loopover_get_upstream_rulesettoMCP_TOOL_CATEGORIESas"utility"(the categoryloopover_get_upstream_driftuses).loopover_get_upstream_rulesetas a local stdio MCP tool inpackages/loopover-mcp/bin/loopover-mcp.ts, callingGET /v1/upstream/rulesetviaapiGet.getLatestUpstreamRulesetSnapshot, the REST route, or its (lack of) auth.Deliverables
loopover_get_upstream_rulesetregistered as a remote MCP tool insrc/mcp/server.ts, category"utility", no-argument input.loopover_get_upstream_rulesetregistered as a local stdio MCP tool inpackages/loopover-mcp/bin/loopover-mcp.ts.Test Coverage Requirements
src/mcp/server.tsandpackages/loopover-mcpare both under the 99%+ Codecov patch gate — cover both the found and not-found branches. Mirrorloopover_get_upstream_drift's test for the tool-registration shape.Expected Outcome
loopover_get_upstream_rulesetis reachable via remote MCP and local stdio MCP, matching its existing public REST route — an MCP client can pull the raw upstream ruleset the same way it already can pull the drift report.Links & Resources
src/api/routes.ts:2335(existing REST route, public/unauthenticated)src/mcp/server.ts:2330-2337,packages/loopover-mcp/bin/loopover-mcp.ts:1916-1923(theloopover_get_upstream_driftpattern to mirror)src/mcp/server.ts:1798-1890(MCP_TOOL_CATEGORIESmap)