Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,26 @@ ug mcp remove --agents codex
It shows the servers you currently have configured — each with the coding tools it's registered
on — and removes the ones you select from those tools. It needs no Databricks login.

#### List configured servers and their connection status

To see the Databricks MCP servers `ug` has configured and whether each coding agent is currently
connected to them, use `ug mcp list`:

```bash
ug mcp list

# Limit the report to specific agents.
ug mcp list --agents claude,codex
```

It prints one row per configured server — `NAME`, `LOCATION`, `AGENTS`, and a `STATUS` aggregated
from each agent's own `mcp list` (connected/failed; Codex reports `enabled`/`disabled`, since its
listing does not health-check). When agents disagree, `STATUS` splits into `agent:state`.
Workspace-managed servers are tagged, and any servers an agent lists that `ug` didn't configure are
summarized as a per-agent count. Skills connections are managed separately (via `ug skill` /
`ug configure skills`) and aren't listed here. It reads local state plus each installed agent's
`mcp list`, so it needs no Databricks login.

### Skills (optional)

Configure Unity Catalog Skills for your coding tools with `ug configure skills`:
Expand Down Expand Up @@ -376,6 +396,8 @@ The output looks like:
| `ug mcp add --agents claude --services system.ai.slack` | Set up the agent(s) if needed and register the server for them |
| `ug mcp remove` | Interactively unregister configured MCP servers from your coding tools |
| `ug mcp remove --agents codex` | Unregister selected servers from specific agents only |
| `ug mcp list` | List configured MCP servers and their live per-agent connection status |
| `ug mcp list --agents claude` | Show the connection-status report for specific agents only |
| `ug configure skills` | Register the skills MCP connection (utility tools only); no skills download |
| `ug configure skills --location main.default [--path <dir>]` | Download a schema's skills to disk (under `<dir>`, or your home dir) and register a schema-less skills MCP connection |
| `ug configure skills --location main.default --skill my-skill` | Download only the named skill(s) from a schema (comma-separated for several) |
Expand Down
52 changes: 44 additions & 8 deletions src/ucode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
configure_mcp_command,
configure_skills_mcp_command,
configured_mcp_clients,
list_mcp_command,
purge_cross_workspace_mcp_residue,
remove_mcp_command,
remove_skills_command,
Expand Down Expand Up @@ -916,18 +917,16 @@ def status() -> int:
print_kv("Model Provider Service", provider_service)
print_kv("Base URL", base_url)
if configured and tool in MCP_CLIENTS:
tool_mcp_servers = [
str(server.get("name"))
# High-level overview: just a count per agent. `ug mcp list` (see the note below) shows
# the per-server detail and live connection status, so status stays scannable.
mcp_count = sum(
1
for server in mcp_servers
if tool in (server.get("clients") or [])
and server.get("name")
and server.get("kind") != SKILLS_MCP_KIND
]
print_kv("MCP list command", str(MCP_CLIENTS[tool]["list_command"]))
print_kv(
"MCP servers",
", ".join(tool_mcp_servers) if tool_mcp_servers else "none saved by ug",
)
Comment on lines +922 to 928

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This count reads only mcp_servers, but ug mcp list also counts managed_mcp_servers (workspace-pushed). So a workspace with a managed server shows MCP servers: 0 here yet lists it under ug mcp list, which the note just below points to for the detail. Worth folding managed servers into the count so the two views agree.

print_kv("MCP servers", str(mcp_count))
print_kv("Config file", str(config_path) if config_path.exists() else "missing")
if tool == "claude":
managed_path, managed_status, backup_status = claude_agent.managed_settings_status(
Expand Down Expand Up @@ -990,6 +989,7 @@ def status() -> int:
print_kv("State file", str(STATE_PATH) if STATE_PATH.exists() else "missing")
print_note("Use `ug configure` to update workspace settings or configure new tools.")
print_note("Use `ug configure mcp` to add Databricks MCP servers to configured coding tools.")
print_note("Use `ug mcp list` to see configured MCP servers and their connection status.")
print_note(
"Use `ug configure skills` to set up Unity Catalog Skills for configured coding tools."
)
Expand Down Expand Up @@ -1051,7 +1051,11 @@ def revert() -> int:
configure_app = typer.Typer(add_completion=False, no_args_is_help=False)
app.add_typer(configure_app, name="configure", help="Configure workspace and tool settings.")
mcp_app = typer.Typer(add_completion=False, no_args_is_help=True)
app.add_typer(mcp_app, name="mcp", help="MCP servers exposed by ug.")
app.add_typer(
mcp_app,
name="mcp",
help="Inspect and manage the Databricks MCP servers ug configures for your coding agents.",
)
skill_app = typer.Typer(add_completion=False, no_args_is_help=True)
app.add_typer(skill_app, name="skill", help="Databricks Skills for your coding tools.")

Expand Down Expand Up @@ -1188,6 +1192,38 @@ def mcp_remove(
raise typer.Exit(130) from None


@mcp_app.command("list")
def mcp_list(
agents: Annotated[
str | None,
typer.Option(
"--agents",
help="Comma-separated coding agents to report on (e.g. claude,codex). Without "
"--agents, every installed MCP-capable agent is included.",
),
] = None,
) -> None:
"""List the Databricks MCP servers ug has configured and their live connection status.

Reads ug's saved state and each installed agent's own `mcp list` to show, per agent, whether
each server is connected. Read-only; needs no Databricks login. Use the `add`/`remove`
subcommands to change what's configured.
"""
requested_agents = (
None
if agents is None
else ({a.strip().lower() for a in agents.split(",") if a.strip()} or None)
)
try:
list_mcp_command(agents=requested_agents)
except RuntimeError as exc:
print_err(str(exc))
raise typer.Exit(1) from None
except KeyboardInterrupt:
print_err("Interrupted.")
raise typer.Exit(130) from None


@mcp_app.command("web-search")
def mcp_web_search_cmd() -> None:
"""Run the web_search MCP server over stdio. Invoked as a subprocess by Claude Code."""
Expand Down
Loading
Loading