Skip to content

fix: Local MCP tools remain available after mode switch from agent to non-agent#518

Merged
dwash96 merged 5 commits into
cecli-dev:v0.100.0from
szmania:cli-27-local-mcp-tools-remain-on-mode-switch
May 19, 2026
Merged

fix: Local MCP tools remain available after mode switch from agent to non-agent#518
dwash96 merged 5 commits into
cecli-dev:v0.100.0from
szmania:cli-27-local-mcp-tools-remain-on-mode-switch

Conversation

@szmania
Copy link
Copy Markdown

@szmania szmania commented May 19, 2026

Problem

When switching from Agent mode to a non-agent mode (e.g., /code, /ask), the "Local" MCP server (which provides agent-only tools like tool calling and file editing) remained connected. This meant agent-specific tools were still available in non-agent modes, which is incorrect behavior.

Changes

Core Fix: Local MCP Server Disconnection on Mode Switch

  • cecli/coders/base_coder.py: When switching from an AgentCoder to a non-agent coder, the "Local" MCP server is now disconnected. When switching back to agent mode, it reconnects automatically via initialize_mcp_tools().

Testing

  • Added tests/coders/test_coder_switching.py to verify Local server disconnection/reconnection on mode switch
  • All existing tests updated for new method signatures

Your Name added 5 commits May 18, 2026 15:54
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
@dwash96 dwash96 merged commit 4e54d0d into cecli-dev:v0.100.0 May 19, 2026
1 check passed
@dwash96 dwash96 mentioned this pull request May 19, 2026
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.

2 participants