Add UCODE_USE_UC_SECURABLES opt-in for UC model-services and MCP-services discovery#151
Merged
Merged
Conversation
When UCODE_USE_MODEL_SERVICES is set, discover models via the Unity Catalog model-services API and address them as system.ai.<model-name> instead of the per-family AI Gateway listings. Base URLs are unchanged — only the model name differs. The flag is sticky: it's persisted into state at configure time so launches honor it without re-exporting the env var (an explicit env var still wins). Discovery uses a small page size with per-page retries because the metastore listing is slow and frequently 504s, and filters to system.ai.* so model services from other schemas don't leak into the family buckets. Co-authored-by: Isaac
rohita5l
reviewed
Jun 12, 2026
rohita5l
left a comment
Collaborator
There was a problem hiding this comment.
@asujithan can you add some e2e tests
rohita5l
reviewed
Jun 12, 2026
rohita5l
approved these changes
Jun 12, 2026
rohita5l
left a comment
Collaborator
There was a problem hiding this comment.
@AarushiShah-db can you also PTAL
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.
Summary
When
UCODE_USE_UC_SECURABLESis set, ucode discovers two kinds of UCsecurables that are otherwise invisible:
Models via the Unity Catalog model-services API, addressed as
system.ai.<model-name>instead of the per-family AI Gateway listings.Base URLs are unchanged — only the model name differs.
Curated MCP servers via the Unity Catalog mcp-services API
(
system.ai.github,system.ai.slack,system.ai.atlassian, …),surfaced in
ucode configure mcpalongside the existing UC connection-based MCP entries. Selecting one registers an HTTP MCP server pointing at
/<workspace>/ai-gateway/mcp-services/<full-name>.The flag is sticky — persisted into state at configure time so launches
honor it without re-exporting the env var (an explicit env var still wins).
With it unset, ucode behavior is unchanged: legacy AI Gateway model lists
and the existing MCP picker.
Discovery uses a small page size with per-page retries because the metastore listing is slow and frequently 504s, and filters to system.ai.* so model services from other schemas don't leak into the family buckets.
Test plan
uv run ruff check .uv run pytest tests/test_databricks.pyUCODE_USE_UC_SECURABLES=1 uv run ucode configureon e2-dogfoodpulls Claude/Codex models as
system.ai.*.UCODE_USE_UC_SECURABLES=1 uv run ucode configure mcpsurfacessystem.ai.github, etc.; selection registers correctly andtools/listworks after one-time managed-OAuth authorize.uv run pytest(full suite)MCP services surfaced:
![Uploading Screenshot 2026-06-11 at 4.43.34 PM.png…]()

System.ai models surfaced:
In Claude:


In Pi (all 3 model families supported shown):

Co-authored-by: Isaac