M3c: Add thin stdio MCP adapter and interface parity tests #52

Closed
opened 2026-09-07 15:31:14 +00:00 by kilo · 0 comments
Member

Goal

Expose Scarcity Router's accepted machine-interface v1 through a minimal stdio
MCP adapter that calls the same application/core as CLI and REST.

Why

External orchestrators need local MCP interoperability without a REST server
lifecycle or duplicated selection semantics. The adapter must preserve the
accepted M2/M3 contracts while keeping Scarcity Router recommendation-only.

Scope

  • scarcity_status
  • scarcity_select
  • scarcity_simulate
  • stdio transport only
  • official MCP Python SDK
  • exact structured success envelopes
  • exact logical invalid_request/internal_error tool-error payloads
  • shared machine request parsing
  • CLI/REST/MCP/direct parity tests
  • generic external-orchestrator integration example
  • narrow MCP transport-parser compatibility decision

Acceptance Criteria

  • exactly three MCP tools
  • MCP uses stdio only
  • no resources/prompts/execution tools
  • MCP never calls REST
  • success structured payloads equal REST logical envelopes
  • valid no-solution remains successful tool result
  • degraded provider remains successful domain data
  • invalid application input produces logical invalid_request tool error
  • internal application failure produces logical internal_error tool error
  • shared application/core path remains authoritative
  • representative direct == CLI == REST == MCP parity proven
  • no model execution
  • no provider/catalog/ranking change
  • full tests and basedpyright pass

Constraints

  • Branch from current origin/develop and target develop with one PR.
  • Do not create a [project] table or freeze package branding.
  • Use mcp>=2,<3 in the existing development dependency group and update uv.lock.
  • Keep REST strict JSON behavior unchanged; do not implement a custom MCP protocol transport.
  • Do not add HTTP/SSE MCP, authentication, credentials, provider endpoints, model execution, or local inference support.
  • Human review remains the merge gate; leave the PR open and unmerged.
  • Authoritative contract: docs/machine-interfaces.md (D-028)
  • M3 roadmap: docs/roadmap.md
  • REST implementation/application seam: scarcity_router/server.py and scarcity_router/selection_app.py

Non-scope

  • prompt proxy
  • model dispatch
  • HTTP MCP
  • SSE
  • auth
  • remote MCP
  • MCP resources/prompts
  • new providers
  • Astra onboarding
  • reasoning-effort implementation
  • M3 closeout live acceptance
## Goal Expose Scarcity Router's accepted machine-interface v1 through a minimal stdio MCP adapter that calls the same application/core as CLI and REST. ## Why External orchestrators need local MCP interoperability without a REST server lifecycle or duplicated selection semantics. The adapter must preserve the accepted M2/M3 contracts while keeping Scarcity Router recommendation-only. ## Scope - scarcity_status - scarcity_select - scarcity_simulate - stdio transport only - official MCP Python SDK - exact structured success envelopes - exact logical invalid_request/internal_error tool-error payloads - shared machine request parsing - CLI/REST/MCP/direct parity tests - generic external-orchestrator integration example - narrow MCP transport-parser compatibility decision ## Acceptance Criteria - exactly three MCP tools - MCP uses stdio only - no resources/prompts/execution tools - MCP never calls REST - success structured payloads equal REST logical envelopes - valid no-solution remains successful tool result - degraded provider remains successful domain data - invalid application input produces logical invalid_request tool error - internal application failure produces logical internal_error tool error - shared application/core path remains authoritative - representative direct == CLI == REST == MCP parity proven - no model execution - no provider/catalog/ranking change - full tests and basedpyright pass ## Constraints - Branch from current origin/develop and target develop with one PR. - Do not create a [project] table or freeze package branding. - Use mcp>=2,<3 in the existing development dependency group and update uv.lock. - Keep REST strict JSON behavior unchanged; do not implement a custom MCP protocol transport. - Do not add HTTP/SSE MCP, authentication, credentials, provider endpoints, model execution, or local inference support. - Human review remains the merge gate; leave the PR open and unmerged. ## Links - Authoritative contract: docs/machine-interfaces.md (D-028) - M3 roadmap: docs/roadmap.md - REST implementation/application seam: scarcity_router/server.py and scarcity_router/selection_app.py ## Non-scope - prompt proxy - model dispatch - HTTP MCP - SSE - auth - remote MCP - MCP resources/prompts - new providers - Astra onboarding - reasoning-effort implementation - M3 closeout live acceptance
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Creatidy/scarcity-router#52
No description provided.