Skip to content

feat: add dynamic MCP server infrastructure to McpPool#3869

Open
bistack wants to merge 1 commit into
Hmbown:mainfrom
bistack:feat/mcp-dynamic-servers
Open

feat: add dynamic MCP server infrastructure to McpPool#3869
bistack wants to merge 1 commit into
Hmbown:mainfrom
bistack:feat/mcp-dynamic-servers

Conversation

@bistack

@bistack bistack commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Add in-memory dynamic server support to McpPool for runtime-started MCP servers from conversation context. This is the foundation layer for a start_mcp_server tool that allows LLM to dynamically start MCP servers.

Changes

  • New dynamic_servers field (parking_lot::RwLock) on McpPool
  • add_runtime_server_config() rejects duplicate names (static or dynamic), returns Result
  • get_or_connect() checks dynamic servers before static config
  • server_names() includes both static and dynamic servers
  • Conflict tests for static/dynamic name overlap

Design decisions

  • Duplicate names are rejected rather than silently shadowed — users may ignore shadow warnings and not realize the static server is being replaced

Testing

  • cargo fmt --all -- --check
  • cargo clippy -p codewhale-tui --all-targets --all-features
  • cargo test -p codewhale-tui --locked -- add_runtime_server_config — 3 passed
  • cargo test -p codewhale-tui --locked -- workspace_mcp_pool — 4 passed
  • cargo test -p codewhale-tui --locked -- reload_if_config_changed — 4 passed

Related

Addresses issue 3 from PR #3866.

@bistack bistack requested a review from Hmbown as a code owner July 1, 2026 11:01
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Thanks @bistack for taking the time to contribute.

This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant recurring PR access by commenting /lgtm on a pull request.

@bistack bistack closed this Jul 1, 2026
@bistack bistack reopened this Jul 2, 2026
Add in-memory dynamic server support to McpPool for runtime-started
MCP servers from conversation context.

- New `dynamic_servers` field (parking_lot::RwLock) on McpPool
- `add_runtime_server_config()` rejects duplicate names (static or dynamic)
- `get_or_connect()` checks dynamic servers before static config
- `server_names()` includes both static and dynamic servers
- Conflict tests for static/dynamic name overlap

Prerequisite for Hmbown#3866 (start_mcp_server tool). Extracted as a focused
infrastructure PR to isolate the trust-boundary surface (runtime MCP pool
mutation) from the tool implementation.
@bistack bistack force-pushed the feat/mcp-dynamic-servers branch from 19a93d6 to fc26429 Compare July 2, 2026 09:10
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