databricks_ops_mcp
A governed MCP server exposing Databricks operations as tools for jobs orchestration, SQL execution, notebook creation, Unity Catalog governance, lineage, clusters, and DLT pipelines, with safety features like dry-run and audit logging.
README
databricks_ops_mcp
A governed MCP server exposing Databricks operations as tools — jobs orchestration, SQL execution, notebook creation, Unity Catalog governance, lineage, clusters, and DLT pipelines. Built as a reuse template: same pattern as a SharePoint/Jira MCP server, pointed at the Databricks REST API.
Tools (17)
| Category | Read-only | Write-gated |
|---|---|---|
| Jobs | list_jobs, get_run_status, list_failed_runs | run_job, repair_run |
| SQL | preview_table | execute_sql (DML/DDL only; SELECT is free) |
| Workspace | export_notebook, list_workspace | create_notebook |
| Unity Catalog | list_tables, get_table_grants, get_table_lineage | — |
| Compute/DLT | list_clusters, list_pipelines | restart_cluster, start_pipeline_update |
Safety model
- Dry-run by default: every write tool returns a validated dry-run message until
DBX_WRITE_ENABLED=true. Promote per environment (DEV=true, PROD=false + approval flow). - Audit log: every tool call appends a JSONL record (timestamp, tool, payload).
- Context safety: results capped at
DBX_MAX_RESULT_ROWS/DBX_MAX_RESULT_CHARS. - Read-only SQL enforcement: statements must start with SELECT/SHOW/DESCRIBE/EXPLAIN/WITH unless writes are enabled; multi-statement submissions are rejected.
- Placeholders only: no real hostnames, principals, or credentials anywhere in code. Everything comes from environment variables.
Setup
pip install -r requirements.txt
cp .env.example .env # fill in host, token (PAT or OAuth M2M), warehouse ID
Run
# Local (stdio) — for Claude Desktop / Claude Code
python server.py
# Remote (streamable HTTP) — for Databricks Apps / ECS / Lambda-backed deployments
MCP_TRANSPORT=http python server.py
Claude Desktop config
{
"mcpServers": {
"databricks_ops": {
"command": "python",
"args": ["/path/to/databricks_ops_mcp/server.py"],
"env": {
"DATABRICKS_HOST": "https://workspace_placeholder.cloud.databricks.com",
"DATABRICKS_TOKEN": "token_placeholder",
"DATABRICKS_WAREHOUSE_ID": "warehouse_id_placeholder",
"DBX_WRITE_ENABLED": "false"
}
}
}
}
Claude Code
claude mcp add databricks_ops -- python /path/to/databricks_ops_mcp/server.py
Bedrock / custom agents
Run with MCP_TRANSPORT=http behind your FastAPI gateway or as a Databricks App;
point the agent's MCP client at the streamable HTTP endpoint. For Databricks Apps
hosting, replace the bearer token with app OAuth (on-behalf-of user) so Unity
Catalog enforces per-user permissions.
Example flows
- "List failed runs from today, get the status of the worst one, and repair it"
→
list_failed_runs→get_run_status→repair_run(approval-gated in PROD) - "Create a notebook that deduplicates the claims feed and preview the target table"
→
create_notebook→preview_table - "What feeds this table and who can modify it?"
→
get_table_lineage+get_table_grants(Conversational Data Steward core)
Extension roadmap
create_job_from_spec— NL → metadata-driven pipeline config → Jobs API- Column-level lineage + cross-platform trace into MSTR cubes (second MCP server)
deploy_bundlevia Asset Bundles for Git-first production deployment- Approval elicitation (
ctx.elicit) on write tools instead of a global flag - Cost tools over
/api/2.0/usage(billing usage export)
Project layout
databricks_ops_mcp/
├── server.py # FastMCP/MCPServer registration (SDK 1.x & 2.x compatible)
├── client.py # Shared async REST client, errors, audit, truncation
├── config.py # Env-driven settings and guardrails
├── tools/
│ ├── jobs.py # /api/2.2/jobs/*
│ ├── sql.py # /api/2.0/sql/statements (submit → poll → fetch)
│ ├── workspace.py # /api/2.0/workspace/* (notebook import/export)
│ ├── unity_catalog.py # /api/2.1/unity-catalog/* + lineage-tracking
│ └── compute.py # /api/2.1/clusters/*, /api/2.0/pipelines/*
├── requirements.txt
└── .env.example
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。