Databricks MCP Server
Enables AI assistants to interact with Databricks workspaces programmatically, providing comprehensive tools for cluster management, notebook operations, job orchestration, Unity Catalog data governance, user management, permissions control, and FinOps cost analytics.
README
Databricks MCP Server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with Databricks workspaces programmatically. This server provides tools for cluster management, notebook operations, job orchestration, Unity Catalog data governance, user management, permissions control, and FinOps cost analytics.
Features
🖥️ Cluster Management
- List, create, start, stop, and terminate clusters
- Edit cluster configurations and resize clusters
- Get cluster events and logs
- Pin/unpin clusters for organization
📔 Notebook Management
- List, create, read, and update notebooks
- Execute notebooks with parameters
- Import/export notebooks in multiple formats
- Move and organize notebooks in workspace
⚙️ Job Management
- Create and manage jobs with complex workflows
- Schedule jobs with cron expressions
- Trigger manual job runs
- Monitor job execution and retrieve outputs
- Configure notifications and alerts
👥 User & Group Management
- List and manage workspace users
- Create and manage groups
- Add/remove users from groups
- Manage service principals
🗄️ Unity Catalog
- Manage catalogs, schemas, and tables
- Query table metadata and statistics
- List volumes and external locations
- Execute SQL queries on catalog tables
🔒 Permissions & Access Control
- Get and set permissions on workspace objects
- Manage Unity Catalog grants and privileges
- View effective permissions
- Audit access control
💰 FinOps & Cost Analytics
- Analyze cluster costs and DBU consumption
- Track spending trends over time
- Forecast future costs
- Get cost optimization recommendations
- Analyze costs by custom tags
Installation
Prerequisites
- Node.js 18 or higher
- npm or yarn
- A Databricks workspace
- Databricks personal access token or service principal credentials
Install from npm
npm install -g databricks-mcp-server
Install from source
git clone https://github.com/yourusername/databricks-mcp-server.git
cd databricks-mcp-server
npm install
npm run build
Configuration
Environment Variables
Create a .env file in your project directory:
DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
DATABRICKS_TOKEN=your-personal-access-token
For more configuration options, see CONFIGURATION.md.
Claude Desktop Configuration
Add this to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"databricks": {
"command": "databricks-mcp-server",
"env": {
"DATABRICKS_HOST": "https://your-workspace.cloud.databricks.com",
"DATABRICKS_TOKEN": "your-personal-access-token"
}
}
}
}
Quick Start
Once configured, you can interact with your Databricks workspace through your AI assistant:
Example Queries
Cluster Management:
- "List all running clusters in my workspace"
- "Create a new cluster with 4 workers using the latest Spark version"
- "Terminate the idle clusters to save costs"
Notebook Operations:
- "Show me all notebooks in the /Users/me/projects directory"
- "Create a new Python notebook for data analysis"
- "Run the ETL notebook with these parameters"
Job Management:
- "List all scheduled jobs"
- "Create a daily job to run my data pipeline notebook"
- "What's the status of job run 12345?"
Unity Catalog:
- "List all catalogs in my metastore"
- "Show me the schema for the sales.customers table"
- "Query the last 10 records from production.analytics.metrics"
Cost Analytics:
- "What are my cluster costs for the last 30 days?"
- "Show me spending trends by week"
- "Give me cost optimization recommendations"
- "Forecast costs for the next month"
Available Tools
The server provides 60+ tools organized into 7 categories:
Cluster Tools (11 tools)
list_clusters- List all clustersget_cluster_details- Get detailed cluster infocreate_cluster- Create a new clusterstart_cluster- Start a terminated clusterrestart_cluster- Restart a clusterterminate_cluster- Terminate a clusteredit_cluster- Edit cluster configurationresize_cluster- Resize cluster workersget_cluster_events- Get cluster event historypin_cluster- Pin a clusterunpin_cluster- Unpin a cluster
Notebook Tools (8 tools)
list_notebooks- List notebooks in a pathread_notebook- Read notebook contentcreate_notebook- Create a new notebookupdate_notebook- Update notebook contentdelete_notebook- Delete a notebookmove_notebook- Move/rename a notebookcreate_directory- Create workspace directoryrun_notebook- Execute a notebook
Job Tools (10 tools)
list_jobs- List all jobsget_job_details- Get job configurationcreate_job- Create a new jobupdate_job- Update job settingsdelete_job- Delete a jobrun_job- Trigger a job runget_job_run_status- Check run statuslist_job_runs- List job run historycancel_job_run- Cancel a running jobget_job_run_output- Get job output
User Tools (11 tools)
list_users- List all usersget_user_details- Get user informationcreate_user- Add a new userdelete_user- Remove a userlist_groups- List all groupsget_group_details- Get group infocreate_group- Create a new groupdelete_group- Delete a groupadd_user_to_group- Add user to groupremove_user_from_group- Remove user from grouplist_service_principals- List service principals
Unity Catalog Tools (12 tools)
list_catalogs- List all catalogsget_catalog_details- Get catalog infocreate_catalog- Create a catalogdelete_catalog- Delete a cataloglist_schemas- List schemas in catalogget_schema_details- Get schema infocreate_schema- Create a schemadelete_schema- Delete a schemalist_tables- List tables in schemaget_table_details- Get table metadatadelete_table- Delete a tablelist_volumes- List volumeslist_external_locations- List external locationsquery_table- Execute SQL query
Permission Tools (7 tools)
get_permissions- Get object permissionsset_permissions- Set object permissionsupdate_permissions- Update object permissionsget_permission_levels- Get available permission levelsgrant_unity_catalog_permissions- Grant UC privilegesrevoke_unity_catalog_permissions- Revoke UC privilegesget_effective_permissions- Get effective UC permissions
FinOps Tools (5 tools)
get_cluster_costs- Analyze cluster costsanalyze_spending_trends- View spending trendsforecast_costs- Forecast future costsget_optimization_recommendations- Get cost-saving recommendationsanalyze_cost_by_tag- Analyze costs by tags
For detailed documentation of all tools, see API.md.
Development
Building
npm run build
Running in Development
npm run dev
Project Structure
databricks-mcp-server/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── databricks-client.ts # Databricks API client
│ ├── tools/
│ │ ├── clusters.ts # Cluster management tools
│ │ ├── notebooks.ts # Notebook management tools
│ │ ├── jobs.ts # Job management tools
│ │ ├── users.ts # User/group management tools
│ │ ├── unity-catalog.ts # Unity Catalog tools
│ │ ├── permissions.ts # Permission tools
│ │ └── finops.ts # FinOps tools
│ └── types/
│ └── databricks.ts # TypeScript type definitions
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── README.md
Examples
See EXAMPLES.md for detailed usage examples and common workflows.
Authentication
The server supports multiple authentication methods:
- Personal Access Token (recommended for individual use)
- Service Principal OAuth (recommended for production)
- Azure AD Token (for Azure Databricks)
See CONFIGURATION.md for detailed authentication setup.
Security Best Practices
- Store credentials in environment variables, never in code
- Use service principals for production deployments
- Implement least-privilege access for service accounts
- Rotate tokens regularly
- Use Unity Catalog for fine-grained data access control
Limitations
- Cost estimates in FinOps tools are approximations. For accurate billing, use the Databricks billing API or account console
- Some operations require specific Databricks editions (Unity Catalog requires Premium/Enterprise)
- Rate limiting is handled automatically with exponential backoff
- SQL execution requires a running SQL warehouse
Troubleshooting
Common Issues
Authentication Failed
- Verify your DATABRICKS_HOST is correct and includes https://
- Check that your DATABRICKS_TOKEN is valid and not expired
- Ensure your token has sufficient permissions
Tool Not Found
- Make sure the server is properly installed and configured
- Check Claude Desktop configuration file syntax
- Restart Claude Desktop after configuration changes
Permission Denied
- Verify your token has the required permissions
- Check workspace access controls
- Review Unity Catalog grants for data access
For more troubleshooting help, see CONFIGURATION.md.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Support
For issues, questions, or contributions:
- GitHub Issues: Report an issue
- Documentation: Full API Docs
- Examples: Usage Examples
Related Projects
Acknowledgments
Built with the Model Context Protocol SDK by Anthropic.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。