bricks-and-context
Provides tools for interacting with Databricks workspaces, including executing SQL queries with bounded outputs, managing jobs (list, trigger, cancel, get output), and discovering schemas, tables, and table metadata.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bricks-and-contextRun SELECT * FROM sales LIMIT 10"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐งฑ Bricks and Context
Production-grade Model Context Protocol (MCP) server for Databricks
SQL Warehouses ยท Jobs API ยท Multi-Workspace ยท Built for AI Agents
โจ What is this?
Bricks and Context lets AI assistants (Cursor, Claude Desktop, etc.) talk directly to your Databricks workspaces through the Model Context Protocol.
Think of it as a bridge: your AI asks questions, this server translates them into Databricks API calls, and returns structured, AI-friendly responses.
Why use this?
Pain Point | How we solve it |
AI gets overwhelmed by huge query results | Bounded outputs โ configurable row/byte/cell limits |
Flaky connections cause random failures | Retries + circuit breakers โ automatic fault tolerance |
Managing multiple environments is tedious | Multi-workspace โ switch between dev/prod with one parameter |
Raw API responses confuse AI models | Markdown tables โ structured, LLM-optimized output |
Related MCP server: Databricks MCP Server Template
๐ง Available Tools
Tool | What it does |
| Run SQL with bounded, AI-safe output |
| List all schemas in the workspace |
| List tables in a schema with metadata |
| Get column types, nullability, structure |
| Preview rows for data exploration |
| Verify Databricks connectivity |
Tool | What it does |
| List jobs with optional name filtering |
| Full job config: schedule, cluster, tasks |
| Run history with state and duration |
| Start a job with optional parameters |
| Stop a running job |
| Retrieve logs, errors, notebook output |
Tool | What it does |
| Hit rates, memory usage, category breakdown |
| Operation latencies, error rates, health |
๐ Quick Start
1. Clone & Install
git clone https://github.com/laraib-sidd/bricks-and-context.git
cd bricks-and-context
uv sync # or: pip install -e .2. Configure Workspaces
Copy the template and add your credentials:
cp auth.template.yaml auth.yamlEdit auth.yaml:
default_workspace: dev
workspaces:
- name: dev
host: your-dev.cloud.databricks.com
token: dapi...
http_path: /sql/1.0/warehouses/...
- name: prod
host: your-prod.cloud.databricks.com
token: dapi...
http_path: /sql/1.0/warehouses/...๐ก
auth.yamlis gitignored. Your secrets stay local.
3. Run
python run_mcp_server.py๐ฏ Cursor Integration
Cursor uses stdio transport and doesn't inherit your shell environment. You need explicit paths.
Step 1: Ensure dependencies are installed
cd /path/to/bricks-and-context
uv syncStep 2: Open MCP settings in Cursor
Cmd+Shift+P โ "Open MCP Settings" โ Opens ~/.cursor/mcp.json
Step 3: Add this configuration
Using uv run (recommended):
{
"mcpServers": {
"databricks": {
"command": "uv",
"args": [
"--directory", "/path/to/bricks-and-context",
"run", "python", "run_mcp_server.py"
],
"env": {
"MCP_AUTH_PATH": "/path/to/bricks-and-context/auth.yaml",
"MCP_CONFIG_PATH": "/path/to/bricks-and-context/config.json"
}
}
}
}Or using venv directly:
{
"mcpServers": {
"databricks": {
"command": "/path/to/bricks-and-context/.venv/bin/python",
"args": ["/path/to/bricks-and-context/run_mcp_server.py"],
"env": {
"MCP_AUTH_PATH": "/path/to/bricks-and-context/auth.yaml",
"MCP_CONFIG_PATH": "/path/to/bricks-and-context/config.json"
}
}
}
}Step 4: Restart Cursor
Reload the window to activate the MCP server.
Test it
Ask your AI:
"List my Databricks jobs"
"Run
SELECT 1on Databricks""Describe the table
catalog.schema.my_table"
๐ Multi-Workspace
Define multiple workspaces in auth.yaml, then select per-call:
execute_sql_query(sql="SELECT 1", workspace="prod")
list_jobs(limit=10, workspace="dev")When workspace is omitted, the server uses default_workspace.
โ๏ธ Configuration
config.json โ Tunable settings (committed)
Setting | Default | Description |
| 10 | Connection pool size |
| 200 | Max rows returned per query |
| 262144 | Max response size (256KB) |
| 200 | Truncate long cell values |
| false | Enable INSERT/UPDATE/DELETE |
| true | Retry transient SQL failures |
| false | Cache repeated queries |
| 300 | Cache TTL |
| 30 | Jobs API timeout |
Any setting can be overridden via environment variable (uppercase, e.g.,
MAX_RESULT_ROWS=500).
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Client (Cursor / Claude) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ stdio
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastMCP Server โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SQL Tools โ โ Job Tools โ โ Observability โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ Connection Pool โ โ Job Manager โ โ Cache / Perf Monitor โ
โ (SQL Connector) โ โ (REST API 2.1) โ โ โ
โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโฌโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Databricks Workspace(s) โ
โ SQL Warehouse Jobs Service โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐ก๏ธ Reliability Features
Feature | Description |
Bounded outputs | Rows, bytes, and cell-character limits prevent OOM |
Connection pooling | Thread-safe with per-connection health validation |
Retry with backoff | Exponential backoff + jitter for transient failures |
Circuit breakers | Automatic fault isolation, prevents cascading failures |
Query caching | Optional TTL-based caching for repeated queries |
๐งโ๐ป Development
uv sync --dev # Install dev dependencies
uv run pytest # Run tests
uv run black . # Format code
uv run mypy src/ # Type check๐ License
MIT โ see LICENSE
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA Model Context Protocol server that enables AI assistants to interact with Databricks workspaces, allowing them to browse Unity Catalog, query metadata, sample data, and execute SQL queries.Last updatedMIT
- Flicense-qualityDmaintenanceEnables AI assistants like Claude to interact with Databricks workspaces through a secure, authenticated interface. Supports custom prompts and tools that leverage the Databricks SDK for workspace management, job execution, and SQL operations.Last updated
- Flicense-qualityDmaintenanceEnables AI agents to access enterprise data from Unity Catalog (vector search, functions, Genie spaces) and perform developer actions in Databricks like managing notebooks and running jobs.Last updated
- Alicense-qualityDmaintenanceEnables 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.Last updated322MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโฆ
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/laraib-sidd/bricks-and-context'
If you have feedback or need assistance with the MCP directory API, please join our Discord server