MCP follow-ups: status count via shared enumerator + async-only proxy auth - #810
Open
sunishsheth2009 wants to merge 7 commits into
Open
sunishsheth2009 wants to merge 7 commits into
sunishsheth2009 wants to merge 7 commits into
Conversation
sunishsheth2009
force-pushed
the
mcp-status-single-enumerator
branch
2 times, most recently
from
September 23, 2026 20:53
911bc79 to
c0529c2
Compare
sunishsheth2009
marked this pull request as ready for review
September 23, 2026 22:22
`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>
Rewrite the MCP Servers section in the plain, scannable style of the Skills section: a one-line intro, a single command block with friendly comments (add / list / login / remove), and one plain-language note that you only sign in once. Move the jargon (agent scoping, V2 typed selectors, the mcp-proxy/token mechanics, CLI version requirement) into a collapsible "Advanced options" block so business users aren't hit with it up front. Co-authored-by: Isaac <no-reply@databricks.com>
Show non-technical users what the commands actually print — the one-line add confirmation, the ug mcp list status table, and the one-time sign-in — right under the command block. Co-authored-by: Isaac <no-reply@databricks.com>
…rvers Keep the section to the essentials: intro, the command block, the one-time sign-in note, and just the two actionable Advanced options (agent scoping, typed selectors). Removes the sample add/list/login session and the mcp-proxy/CLI-version bullets. Co-authored-by: Isaac <no-reply@databricks.com>
sunishsheth2009
force-pushed
the
mcp-status-single-enumerator
branch
from
September 28, 2026 22:49
311534e to
5eaa991
Compare
The formatter version in CI advanced since these files were first written, so ruff-format-check flagged them. Reformat to match; no behavior change. Co-authored-by: Isaac <no-reply@databricks.com>
…ntation) `ug status` re-implemented the configured-MCP-server enumeration inline: it merged mcp_servers + managed_mcp_servers, deduped by name, and separately read the Claude/Codex OS-managed files — a parallel copy of `configured_mcp_servers_by_name`, the function `ug mcp list` and `ug mcp login` already use. The two could silently drift (the code even carried a comment asking a reader to keep them in agreement). Route the per-agent MCP count through `configured_mcp_servers_by_name` so all three commands read one enumerator. Net -9 lines and the count now matches `ug mcp list` by construction, including servers delivered through an agent's OS-managed file. No behavior change; existing TestStatus coverage (incl. managed-server + dedupe) stays green. Co-authored-by: Isaac <no-reply@databricks.com>
The proxy only ever drives the httpx Auth from an AsyncClient, so the sync auth_flow was never exercised at runtime — it duplicated the async flow and existed only for the tests to drive synchronously. Remove it and override sync_auth_flow to raise a clear ProxyAuthError, so a future sync client fails loudly instead of silently falling back to httpx's no-op default flow (which would skip the bearer). Tests now drive async_auth_flow through one _drive helper (anyio.run), and a new test_sync_auth_flow_is_rejected covers the guard. Co-authored-by: Isaac <no-reply@databricks.com>
sunishsheth2009
force-pushed
the
mcp-status-single-enumerator
branch
from
September 28, 2026 22:54
5eaa991 to
f052f80
Compare
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.
Follow-ups split out of #557/#654 to keep those focused (per reviewer request). No behavior change; both are DRY/dead-code cleanups.
1.
ug status: count MCP servers via the shared enumeratorug statusre-implemented the "which MCP servers are configured" enumeration inline (mergedmcp_servers + managed_mcp_servers, deduped by name, separately read the Claude/Codex OS-managed files) — a parallel copy ofconfigured_mcp_servers_by_name, the enumeratorug mcp listandug mcp loginalready use. Routed the per-agent count through it, so all three commands read one source of truth and the count can't drift. Net −9 lines.revert_mcp_configswas intentionally left alone: its narrowermcp_servers + managed_mcp_serversmerge is the user-scope set it removes; OS-managed files are reverted separately byclaude.revert_managed_settings()/codex.revert_managed_config().2.
ug mcp-proxy: async-only auth (drop the dead syncauth_flow)The proxy only ever drives its httpx
Authfrom anAsyncClient, so the syncauth_flownever ran at runtime — it duplicated the async flow and existed only so the tests could drive it synchronously. Removed it;sync_auth_flownow raises a clearProxyAuthErrorso a future sync client fails loudly instead of silently falling back to httpx's no-op default (which would skip the bearer). Tests driveasync_auth_flowthrough one_drivehelper (anyio.run), andtest_sync_auth_flow_is_rejectedcovers the guard. (Resolves the "do we still need the sync one?" thread on #557.)Testing
ruff+tyclean.test_mcp_proxy.py(36) green after the async-driver rewrite;TestStatus/TestStatusLiveModels(8) green for the status change. No production behavior change in either.This pull request and its description were written by Isaac.