Add Cursor as an MCP client - #192
Merged
sunishsheth2009 merged 1 commit intoJul 28, 2026
Merged
Conversation
sunishsheth2009
force-pushed
the
sunish-sheth_data/cursor-mcp-support
branch
from
July 8, 2026 18:10
7e10377 to
a40057e
Compare
rohita5l
previously approved these changes
Jul 9, 2026
sunishsheth2009
force-pushed
the
sunish-sheth_data/cursor-mcp-support
branch
from
July 10, 2026 00:16
a40057e to
05e841f
Compare
Collaborator
Author
|
Reworked on top of the uniform Dependency: this PR is stacked on #201 — merge that first. Until #201 lands, its proxy commit appears in this PR's diff. What changed from the earlier revision:
Re-verified end-to-end against |
Cursor runs models on the user's own Cursor account, so ucode configures no models for it. It registers Databricks MCP servers in ~/.cursor/mcp.json using the same uniform mechanism as every other client: a local stdio server that runs `ucode mcp-proxy`, which mints a fresh OAuth token per request. So Cursor needs no token in its config and no launch-time token export. - agents/cursor.py: build/write/remove ~/.cursor/mcp.json entries + thin launch() - mcp.py: register cursor in MCP_CLIENTS + MCP_ONLY_CLIENTS; configure/remove branches - cli.py: `ucode cursor` launcher; accept `cursor` in `--agents` - README + tests (test_agent_cursor.py, cursor coverage in test_mcp.py) Co-authored-by: Isaac
sunishsheth2009
force-pushed
the
sunish-sheth_data/cursor-mcp-support
branch
from
July 27, 2026 18:11
05e841f to
dec48c9
Compare
AarushiShah-db
approved these changes
Jul 28, 2026
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
Adds Cursor as an MCP client in ucode, so
ucode configure mcpcan register Databricks managed MCP servers into~/.cursor/mcp.json, plus aucode cursorlauncher.Cursor is MCP-only:
cursor-agentruns models on the user's own Cursor account and exposes no gateway base URL, so ucode configures no models for it (it stays out ofagents.__init__._MODULES). What ucode does is register Databricks MCP servers in Cursor's config via the existingucode configure mcpflow.Auth: the uniform
ucode mcp-proxybridge (no per-client logic)This PR is reworked on top of the
ucode mcp-proxyfoundation (#201). Cursor uses the exact same mechanism as every other client: each Databricks MCP server is registered as a local stdio server that runsucode mcp-proxy, which bridges to the Databricks streamable-HTTP endpoint and mints a fresh OAuth token per request. So there is no literal token in~/.cursor/mcp.json, no${env:...}expansion, and no background refresh thread — Cursor just spawns the proxy like any stdio server, and auth never expires mid-session.This also sidesteps the earlier DCR failure: with no bearer in the config,
cursor-agentdoesn't attempt the dynamic-client-registration flow that Databricks managed MCP doesn't support.Changes
src/ucode/agents/cursor.py(new):build_mcp_server_entry(argv)→{command, args}stdio entry;write_/remove_mcp_server_configmerge surgically into the shared~/.cursor/mcp.json(preserving the user's own entries);launch()is a thinexecofcursor-agent(no token wiring — the proxy authenticates itself).src/ucode/mcp.py: registercursorinMCP_CLIENTS; configure/remove branches dispatch the proxy argv to cursor;MCP_ONLY_CLIENTSso cursor is eligible whenevercursor-agentis installed (it never lands inavailable_tools).src/ucode/cli.py:ucode cursorlauncher; acceptcursorin--agents(partitioned out of the model-agent path, workspace-only configure).src/ucode/agents/__init__.py: comment documenting why cursor is intentionally not a model-routing agent.tests/test_agent_cursor.py, cursor coverage intests/test_mcp.py) + README.Verification
Verified end-to-end against a live workspace (
uc-dogfood,e2-dogfoodUC):ucode mcp-proxystdio handshake against.../api/2.0/mcp/functions/system/ai:initialize→DatabricksMCPServer,tools/list→ 4 live tools (system__ai__ai_classify,ai_extract,ai_parse_document,python_exec).configure_client_mcp_server("cursor", ...)through the real code path writes the correct{command, args}proxy entry into~/.cursor/mcp.json(merging, not clobbering).cursor-agentis installed and reads~/.cursor/mcp.json; the registered entry is the proxy argv, so auth is handled byucode mcp-proxyper request.uv run pytest→ 876 passed (2 pre-existingtest_e2e_user_agentnetwork failures unrelated to this change);uv run ruff format --checkanduv run ty check src/clean.This pull request and its description were written by Isaac.