Skip to content

Add ucode configure --mcp one-shot flag#199

Merged
AarushiShah-db merged 1 commit into
databricks:mainfrom
sunishsheth2009:sunish-sheth_data/configure-mcp-flag
Jul 23, 2026
Merged

Add ucode configure --mcp one-shot flag#199
AarushiShah-db merged 1 commit into
databricks:mainfrom
sunishsheth2009:sunish-sheth_data/configure-mcp-flag

Conversation

@sunishsheth2009

Copy link
Copy Markdown
Collaborator

Summary

Adds a --mcp flag to ucode configure so an agent and its Databricks MCP server(s) can be set up in a single command:

ucode configure --agents claude --mcp system.ai.slack

Previously this took two steps (ucode configure --agents claude then ucode configure mcp --services system.ai.slack). The new flag folds them together for a cleaner getting-started story (e.g. the AI Gateway MCP-services "Get started" panel can now recommend one command per client).

Behavior

  • --mcp takes a comma-separated list of fully-qualified <catalog>.<schema>.<name> service names.
  • Runs after the workspace + agents are configured (right beside the existing --tracing hook) and dispatches to the already-tested configure_mcp_command(services=...).
  • Without --agents (e.g. MCP-only clients such as Cursor): configures just the workspace — no interactive agent picker — then registers the servers.
  • Bare short names (slack) are rejected with a pointer to ucode configure mcp for the interactive picker.

Changes

  • src/ucode/cli.py: --mcp option on the configure callback + handler; an MCP-only branch that does a workspace-only configure_shared_state when no --agent(s) is given.
  • tests/test_cli.py: TestConfigureMcpFlag — with-agents dispatch, MCP-only workspace-config path (no picker), bare-short-name rejection.
  • README.md: documents the flag.

Verification

uv run pytest → all CLI tests pass (tests/test_cli.py: 83 passed); uv run ruff check clean. Verified against a live workspace that the MCP-only path resolves clients correctly ("Configuring for: Cursor") and queries the real Unity Catalog MCP-services API before registering.

Note: the Cursor MCP-only path pairs with the ucode cursor client support in the separate cursor PR; the --mcp flag itself is independent and works today for the model agents.

This pull request and its description were written by Isaac.

rohita5l
rohita5l previously approved these changes Jul 9, 2026
@sunishsheth2009

Copy link
Copy Markdown
Collaborator Author

Note: this flag is transport-independent — it dispatches to configure_mcp_command, which under #201 registers each client's Databricks MCP server as a ucode mcp-proxy stdio entry. Verified it merges cleanly on top of #201 (no conflict) and its tests pass on that base, so it can land in either order relative to #201.

Register Databricks MCP service(s) for configured agents in a single command:

    ucode configure --agents claude --mcp system.ai.slack

`--mcp` takes a comma-separated list of fully-qualified `<catalog>.<schema>.<name>`
service names. It runs after the workspace + agents are configured (alongside the
existing `--tracing` hook) and dispatches to the already-tested
`configure_mcp_command(services=...)`.

Without `--agents` (e.g. for MCP-only clients like Cursor) it configures just the
workspace — no interactive agent picker — then registers the servers. Bare short
names are rejected with a pointer to `ucode configure mcp` for the picker.

Co-authored-by: Isaac
@sunishsheth2009

Copy link
Copy Markdown
Collaborator Author

Rebased onto latest master — conflict resolved (GitHub now reports MERGEABLE).

The only conflict was in cli.py: master added the --enable-fable and --enable-databricks-ai-tools configure options in the same option block where this PR adds --mcp. Resolved by keeping all three. No logic changes to the --mcp behavior.

This PR is independent of the proxy PR (#201) — the --mcp flag dispatches to the existing configure_mcp_command(services=...) that's already on master, and touches only cli.py / README.md / test_cli.py. It can merge on its own.

Verified locally after rebase: ruff format --check + ruff check + ty check clean; 920 passed (the 2 test_e2e_user_agent failures are the pre-existing live-gateway network tests, unrelated to this change and failing identically on master).

@AarushiShah-db
AarushiShah-db merged commit 0a5225a into databricks:main Jul 23, 2026
2 checks passed
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.

3 participants