Summary
The Settings UI exposes an Agent MCP server toggle (codingCli.mcpServer), described as controlling whether Freshell is exposed as an MCP tool to coding agents. The setting is persisted, but new coding-agent launches still inject Freshell MCP config unconditionally.
This is not about MCP being enabled by default. Default-on appears intentional. The bug is that switching the toggle off does not affect subsequent launches.
Evidence
codingCli.mcpServer exists in settings and defaults to true.
- The Settings UI writes the toggle through
applyServerSetting({ codingCli: { mcpServer: checked } }).
src/components/settings/AdvancedSettings.tsx
- Terminal launches read provider-specific defaults from
cfg.settings.codingCli.providers[...], but do not pass the global codingCli.mcpServer setting into the spawn path.
providerNotificationArgs(...) calls generateMcpInjection(...) unconditionally for coding CLI terminal modes.
server/terminal-registry.ts
generateMcpInjection(...) injects Freshell MCP config for Claude, Codex, Gemini, Kimi, and OpenCode.
server/mcp/config-writer.ts
- The Claude SDK/fresh-agent path also currently builds
mcpServers: createClaudeSdkMcpServers(...) without an obvious gate for codingCli.mcpServer.
Expected behavior
When codingCli.mcpServer === false, newly launched coding-agent sessions should not receive Freshell MCP injection.
Existing running agents do not need to be mutated; a new setting should apply to new launches.
Actual behavior
The setting is persisted, but new agent launches still receive Freshell MCP injection.
Scope notes
This should only govern Freshell's own injected freshell MCP server. It should not attempt to manage unrelated external MCP servers configured globally by Claude, Codex, OpenCode, etc. For example, a third-party MCP like Railway belongs to user/global agent config and should be handled separately.
Suggested acceptance criteria
- With the toggle on or unset, current behavior remains unchanged.
- With the toggle off, new Claude/Codex/Gemini/Kimi/OpenCode terminal panes omit Freshell MCP config.
- With the toggle off, Fresh Agent / SDK launch paths also omit Freshell MCP where applicable.
- Existing turn-completion notification plumbing remains intact, such as Codex TUI notification flags and Claude stop-hook bell settings.
- Add focused tests proving the toggle gates MCP injection while preserving notification behavior.
Summary
The Settings UI exposes an
Agent MCP servertoggle (codingCli.mcpServer), described as controlling whether Freshell is exposed as an MCP tool to coding agents. The setting is persisted, but new coding-agent launches still inject Freshell MCP config unconditionally.This is not about MCP being enabled by default. Default-on appears intentional. The bug is that switching the toggle off does not affect subsequent launches.
Evidence
codingCli.mcpServerexists in settings and defaults totrue.shared/settings.tsapplyServerSetting({ codingCli: { mcpServer: checked } }).src/components/settings/AdvancedSettings.tsxcfg.settings.codingCli.providers[...], but do not pass the globalcodingCli.mcpServersetting into the spawn path.server/ws-handler.tsproviderNotificationArgs(...)callsgenerateMcpInjection(...)unconditionally for coding CLI terminal modes.server/terminal-registry.tsgenerateMcpInjection(...)injects Freshell MCP config for Claude, Codex, Gemini, Kimi, and OpenCode.server/mcp/config-writer.tsmcpServers: createClaudeSdkMcpServers(...)without an obvious gate forcodingCli.mcpServer.server/sdk-bridge.tsExpected behavior
When
codingCli.mcpServer === false, newly launched coding-agent sessions should not receive Freshell MCP injection.Existing running agents do not need to be mutated; a new setting should apply to new launches.
Actual behavior
The setting is persisted, but new agent launches still receive Freshell MCP injection.
Scope notes
This should only govern Freshell's own injected
freshellMCP server. It should not attempt to manage unrelated external MCP servers configured globally by Claude, Codex, OpenCode, etc. For example, a third-party MCP like Railway belongs to user/global agent config and should be handled separately.Suggested acceptance criteria