feat(transport): add transport flag and ClientSource seam #8
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/transport-flag-clientsource"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First step of the multi-user remote MCP epic (#YTMCP-2). Pure refactor: stdio behavior is unchanged, and no HTTP / SQLite / OAuth code lands here.
What changed
main.rsselects the transport from--transport <stdio|http>(or--transport=<value>), falling back toYT_MCP_TRANSPORT, then to the defaultstdio. Thehttparm returns a clear not-yet-implemented error (tracked in #YTMCP-6).server.rsintroduces aClientSourceenum and aresolve_client()helper; every#[tool]method resolves its YouTrack client through it instead of reading a bareArc<Client>field. The only variant today isSingle(the stdio env client). The per-user HTTP variant (resolved from the authenticated request principal) is added with the remote transport, so the tool layer will not need to change again.tokiogains thenetandsignalfeatures for the upcoming HTTP server and the new shutdown handling.Cargo.lockis unchanged.Verification
just check(fmt, clippy with-D warnings, build, Docker builder-stage compile) passes.cargo testpasses.--transport http,YT_MCP_TRANSPORT=http, an unknown value, and a missing--transportvalue each produce the expected error and exit 1; the default stdio path completes an MCPinitializehandshake and logs to stderr.Resolves #YTMCP-3.