ug mcp login: per-service sign-in status + login for agents' MCP services - #654
Open
sunishsheth2009 wants to merge 1 commit into
Open
sunishsheth2009 wants to merge 1 commit into
sunishsheth2009 wants to merge 1 commit into
Conversation
sunishsheth2009
force-pushed
the
mcp-login-command
branch
4 times, most recently
from
September 18, 2026 04:57
560591b to
0b050e9
Compare
`ug mcp login` shows which of the connection-backed AI Gateway MCP services the coding agents are configured to use are already signed in vs. still need a per-user connection sign-in, and runs the sign-in for the ones you pick (interactive picker) or name with `--services` / scope with `--agents`. Reuses databricks#679's building blocks: the developer + workspace-managed server enumeration is extracted from `list_mcp_command` into a shared `configured_mcp_servers_by_name` (behavior-preserving) that both `ug mcp list` and `ug mcp login` call, and the status is rendered with the same rich Table + `status_badge` styling from `ucode.ui`. Per-service status comes from the existing Unity Catalog REST APIs (the ones the `/mcp-service-login` page uses); sign-in is `databricks auth login --resource` (RFC 8707, databricks/cli#6621), so it works for any connection-backed MCP service, not just `system.ai.*`. The credential is per-user and shared across agents, so signing in once unblocks the service for every agent. Co-authored-by: Isaac <no-reply@databricks.com>
sunishsheth2009
force-pushed
the
mcp-login-command
branch
from
September 20, 2026 19:47
0b050e9 to
5c6bd73
Compare
sunishsheth2009
marked this pull request as ready for review
September 20, 2026 19:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
ug mcp login— sign in to the connection-backed AI Gateway MCP services the coding agents are configured to use. Shows which are already signed in vs. need a per-user connection sign-in, and runs the sign-in for the ones you pick (interactive picker) or name with--services/ scope with--agents.Why
Non-native agents (codex, gemini, opencode) reach connection-backed MCP services (e.g.
system.ai.github) viaug mcp-proxy, which vends tools only after a per-user connection login. Rather than block inside an agent-spawned proxy (fragile), this is an explicit, decoupled login the user runs in their own shell. It also works for Claude/Cursor — the credential is per-user and shared across all agents, so signing in once unblocks the service everywhere.Reuses the shared enumeration (incl. #717's OS-managed files)
list_mcp_command's developer + workspace-managed server merge is extracted into a sharedconfigured_mcp_servers_by_name(state, agents);ug mcp list,ug status, andug mcp loginall use it, so they agree on the configured-server set.state).configured_mcp_servers_by_namenow also reads those files (claude.read_managed_mcp_urls()/codex.read_managed_mcp_urls()), soug mcp loginsees managed mcp-services regardless of how they were delivered — the cross-PR gap is closed here instead of left as a follow-up.How it works (existing UC REST APIs — no unshipped deps)
GET /mcp-services/<full-name>→ id +source_connection(name +securable_kind)GET /connections/<conn>/user-credentials/<user>?dependent.mcp_service.id=<id>→provisioning_info.state(ACTIVE= signed in; HTTP 404 = needs login)Works for any connection-backed MCP service — not just
system.ai.*(source connection resolved from the service's own config).UX (symmetric with
ug mcp add)ug mcp login→ status table + picker (needs-sign-in pre-checked)--services system.ai.github[,github]→ targeted, non-interactive--agents claude,codex→ scope to those agents' servicesStatus renders with the same rich
Table+status_badgestyling asug mcp list. Sign-in isdatabricks auth login --resource <mcp-url>(databricks/cli#6621), with a clear "upgrade your CLI" error if--resourceis missing.Testing
tests/test_mcp_login.py— status classification, the--resourceinvocation incl. the old-CLI clear error,--services/--agentsscoping, workspace-managed inclusion, and OS-managed-file inclusion.tests/test_mcp.py—configured_mcp_servers_by_namemerge/scope + the managed-file read (TestConfiguredMcpServersByName).ruff+tyclean; the full mcp/login/cli/agent suite (876) is green.This pull request and its description were written by Isaac.
Example output
ug mcp login(real output) — the status table, then an interactive checklist (needs-sign-in pre-checked) to pick which to sign in to:Non-interactive form,
ug mcp login --names system.ai.github, signs in to the named service(s) directly (no picker), and printssigned inon success.