1jehuang / 1jehuang/jcode

Add TUI console toggler for MCP servers

Open
#440 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

autonomous: no enhancement priority: medium triage: needs-decision
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

Update after rebasing against current master (v0.41): some MCP plumbing and display work has now landed upstream, so the original description overstated what remains in my branch.

Current state on master

Master already has:

  • MCP management tool actions: list, connect, disconnect, reload
  • MCP config loading/reload support
  • MCP server state plumbing through TUI state
  • MCP server display in the header/status area

Master does not yet have:

  • A /mcp slash command
  • An inline TUI picker/switcher for MCP servers
  • Space-to-toggle enable/disable UX
  • A clear runtime policy for hiding disabled server tools from model prompts/tool schemas

Current state of my branch

Reference branch: https://github.com/alecuba16/jcode/tree/feature/mcp-server-toggles

Latest branch head: c4e68c36

Compare: https://github.com/1jehuang/jcode/compare/master...alecuba16:jcode:feature/mcp-server-toggles

After rebasing on current master, the branch now includes:

  • Overview widget: Shows enabled MCP servers with tool counts in the fixed Overview panel
  • Enable/disable toggle: enable and disable actions on the mcp tool that persist to ~/.jcode/mcp.json
    • Disabling a server disconnects it and unregisters its tools from the prompt
    • Enabling a server connects it and registers its tools into the prompt
  • Matches opencode behavior for toggling MCP servers on/off

Files changed: crates/jcode-app-core/src/tool/mcp.rs, crates/jcode-tui/src/tui/app/tui_state.rs, crates/jcode-tui/src/tui/info_widget.rs, crates/jcode-tui/src/tui/info_widget_tests.rs

The branch ahead by 1, behind by 0 relative to upstream master (rebased on latest).

Requested follow-up

Add a TUI console MCP switcher so users can enable/disable configured MCP servers without editing config files or restarting.

Suggested UX:

  • /mcp opens an inline picker listing configured MCP servers
  • Space toggles a server enabled/disabled for the current session
  • Enter applies changes
  • Disabled servers should not expose their MCP tools to the model prompt/tool schema
  • UI should show enough status to understand which servers are enabled, disabled, connected, or unavailable

Design decisions needed

  • Should toggles be session-only, persisted to config, or support both?
  • If a connected server is disabled, should it disconnect immediately or only hide its tools?
  • How should global vs project MCP config precedence interact with per-session toggles?
  • How should remote sessions receive and apply the enabled/disabled server list?

Acceptance criteria

  • Users can open a TUI MCP switcher from the console
  • Users can toggle configured MCP servers without editing JSON manually
  • Disabled server tools are omitted from model-visible tools at runtime
  • Current MCP management actions (list, connect, disconnect, reload) continue to work
  • Header/info-widget MCP status remains accurate after toggles
  • Tests cover picker rendering, toggle behavior, and disabled-tools filtering

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading crates/jcode-app-core/src/tool/mcp.rs and crates/jcode-tui/src/tui/app/tui_state.rs, then inspect crates/jcode-tui/src/tui/info_widget.rs and crates/jcode-tui/src/tui/info_widget_tests.rs. Done means the TUI provides the requested picker and toggle behavior, disabled tools are filtered, status remains accurate, existing MCP actions continue to work, and tests cover rendering and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.