Skip to content

Commit cfae0eb

Browse files
author
Your Name
committed
fix: Disable Local MCP server when switching from AgentCoder
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
1 parent 7e2674f commit cfae0eb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cecli/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,13 @@ def get_io(pretty):
12421242
for tag in [MessageTag.SYSTEM, MessageTag.EXAMPLES, MessageTag.STATIC]:
12431243
ConversationService.get_manager(coder).clear_tag(tag)
12441244

1245+
old_coder = coder
12451246
coder = await Coder.create(**kwargs)
12461247

1248+
if isinstance(old_coder, AgentCoder) and not isinstance(coder, AgentCoder):
1249+
if coder.mcp_manager and coder.mcp_manager.get_server("Local"):
1250+
await coder.mcp_manager.disconnect_server("Local")
1251+
12471252
if switch.kwargs.get("show_announcements") is False:
12481253
coder.suppress_announcements_for_next_prompt = True
12491254

0 commit comments

Comments
 (0)