Skip to content

mcp: add ucode mcp remove to unregister configured MCP servers - #351

Open
sunishsheth2009 wants to merge 2 commits into
databricks:mainfrom
sunishsheth2009:sunish-sheth_data/mcp-remove
Open

mcp: add ucode mcp remove to unregister configured MCP servers#351
sunishsheth2009 wants to merge 2 commits into
databricks:mainfrom
sunishsheth2009:sunish-sheth_data/mcp-remove

Conversation

@sunishsheth2009

Copy link
Copy Markdown
Collaborator

What

Adds ucode mcp remove, completing the ucode mcp <verb> set alongside the recently-merged ucode mcp add (#340).

ucode mcp remove shows the MCP servers you currently have configured — each annotated with the coding tools it's registered on — and unregisters the ones you select from those tools.

$ ucode mcp remove
? Remove MCP: (space to toggle, ctrl-a all, enter to remove, type to filter)
  [ ] system-ai-github (Claude Code, Codex)
  [ ] databricks-sql (Claude Code)

Design

  • Interactive only — no --location/--services/--all flags. Removal is a small, destructive operation where seeing the concrete list (and which tools each server is on) before selecting is the safer UX.
  • Skills connections are never shown — they're owned by ucode configure skills, matching how the configure mcp / add pickers already treat them.
  • No Databricks login required — unregistering a server is purely local (it shells out to claude mcp remove and friends), so it works even when the workspace token has expired. setup_mcp_clients grows a require_auth toggle for this; the add/configure paths keep forcing auth as before.

Removal targets each server's recorded clients (via the existing apply_mcp_server_changes remove path), so a server registered on a tool that isn't currently configured is still cleaned up.

Changes

  • src/ucode/mcp.py: remove_mcp_command(), _prompt_for_mcp_removal(), and a require_auth/action_note toggle on setup_mcp_clients.
  • src/ucode/cli.py: @mcp_app.command("remove").
  • README.md: documents ucode mcp remove.
  • tests/test_mcp.py: TestRemoveMcpCommand (removes selection, cancel = no-op, skills excluded, empty config skips the picker) + a picker-rendering test.

Testing

uv run ruff format/ruff check, uv run ty check src/, and uv run pytest all pass (the only failures are the two pre-existing network-dependent test_e2e_user_agent tests).

This pull request and its description were written by Isaac.

Completes the `ucode mcp <verb>` set alongside `ucode mcp add`. `ucode mcp
remove` shows the MCP servers you currently have configured — each with the
coding tools it's registered on — and unregisters the ones you select from
those tools.

It's interactive only (no flags), never touches skills connections (owned by
`configure skills`), and needs no Databricks login: unregistering a server is
purely local, so it works even when the workspace token has expired
(setup_mcp_clients grows a `require_auth` toggle for this).
Skills get a separate docs update later; don't reference the skills
relationship in the README or CLI --help here.
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