Skip to content

refactor(mcp): converge runtime lifecycle ownership - #1987

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/core-mcp-runtime-owner-pr9
Aug 2, 2026
Merged

refactor(mcp): converge runtime lifecycle ownership#1987
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/core-mcp-runtime-owner-pr9

Conversation

@limityan

@limityan limityan commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • encapsulate MCP process start/stop/status/connection access in MCPServerRuntimeState instead of exposing mutable process handles across the Services/Core boundary
  • split external ephemeral install/retirement logic from persistent MCP lifecycle while keeping product publication, workspace scope, and readiness in Core
  • remove duplicate provider-neutral policy assertions from the heavy Core test target and reuse the existing Services owner contract coverage

Architecture and behavior

  • Services owns registry/process/connection-pool/catalog lifecycle; Core injects typed local/remote start paths and publishes product-facing tools/events only after external retirement/start-token checks
  • Started always carries a live connection; invalid context or a missing post-start connection fails explicitly
  • local and remote restart now share the complete Core stop_server -> start_server lifecycle, preventing stale connection-pool, ToolRegistry, catalog, or listener references
  • public Core compatibility imports remain unchanged

Dependency and CI impact

  • no Cargo dependency, feature, lockfile, workflow, job, or CI test-step changes
  • no product-full expansion; owner verification uses only bitfun-services-integrations --no-default-features --features mcp
  • 7 files, 1 commit, 645 insertions / 600 deletions

Verification

  • cargo test -p bitfun-services-integrations --no-default-features --features mcp --test mcp_contracts (41 passed)
  • cargo test -p bitfun-core --lib service::mcp::server::manager::tests -- --nocapture (3 passed)
  • cargo check -p bitfun-core --lib
  • git diff --check gcwing/main...HEAD
  • isolated adversarial review completed; restart connection split, optional-success state, and path-before-idempotency findings were fixed and re-reviewed with no remaining P0-P2

Local-only artifacts

The implementation spec and plan under docs/superpowers/** remain untracked locally and are not part of this PR.

@limityan
limityan merged commit 2541693 into GCWing:main Aug 2, 2026
7 checks passed
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