Skip to content

Refactor MCP runtime ownership into services integrations#699

Merged
limityan merged 3 commits into
GCWing:mainfrom
limityan:yanzhn/refactor-mcp-runtime
May 13, 2026
Merged

Refactor MCP runtime ownership into services integrations#699
limityan merged 3 commits into
GCWing:mainfrom
limityan:yanzhn/refactor-mcp-runtime

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

@limityan limityan commented May 13, 2026

Summary

  • Move MCP config orchestration, server process lifecycle, local/remote transport lifecycle, context helper, and dynamic MCP tool provider ownership into bitfun-services-integrations behind the mcp feature.
  • Keep bitfun-core as the compatibility facade and product runtime assembly point for core ConfigService store adaptation, OAuth data-dir injection, BitFunError mapping, and global tool registry wiring.
  • Extend boundary checks and MCP contract tests so the new owner crate cannot silently depend back on bitfun-core, while existing MCP wire shapes, auth/config behavior, dynamic manifest metadata, and remote Streamable HTTP behavior stay covered.
  • Update the core decomposition docs to mark PR2 as complete, keep later runtime/tool work guarded, and add the product-surface contract principle for CLI/Desktop/Remote/Server/ACP: surface divergence, capability convergence.

Product / Behavior Boundary

This PR is intended as a structural ownership refactor plus documentation guardrail update only. It preserves the existing product runtime behavior through core facades and explicit adapter injection, and does not change MCP configuration semantics, OAuth storage location semantics, tool registry ownership, remote-connect behavior, CLI/Desktop/Remote/ACP presentation behavior, or feature defaults.

Validation

  • git diff --check gcwing/main...HEAD
  • node scripts/check-core-boundaries.mjs
  • $env:BITFUN_BOUNDARY_CHECK_SELF_TEST='1'; node scripts/check-core-boundaries.mjs
  • cargo test -p bitfun-services-integrations --features mcp --test mcp_contracts -- --nocapture
  • cargo check -p bitfun-services-integrations --no-default-features
  • cargo check -p bitfun-core
  • cargo test -p bitfun-core dynamic_tool_provider_prefers_mcp_registry_metadata -- --nocapture
  • cargo test -p bitfun-core merge_dynamic_mcp_tools_appends_registered_mcp_tools_once -- --nocapture
  • cargo test -p bitfun-core remote_mcp_streamable_http_accepts_202_and_delivers_response_via_sse -- --nocapture
  • cargo check --workspace
  • cargo test --workspace
  • Docs-only follow-up: git diff --check; git diff -- package.json scripts/dev.cjs scripts/desktop-tauri-build.mjs scripts/ensure-openssl-windows.mjs scripts/ci/setup-openssl-windows.ps1 BitFun-Installer

Notes: workspace check/test pass with an existing CLI unused-import warning for src/apps/cli/src/ui/theme.rs:4. cargo test --workspace also emitted a Windows incremental compilation finalize warning, but exited successfully and all tests passed.

@limityan limityan merged commit 3ba76c1 into GCWing:main May 13, 2026
4 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