custom-mcp-server
Exposes Databricks capabilities as tools for AI agents, including Genie spaces for natural-language data Q&A, SQL warehouses, Unity Catalog, and Databricks-hosted agent frameworks.
Surfaces the Genie data Q&A capability in Slack through a bot supporting slash commands, direct messages, and mentions, with automatic chart generation from query results.
Click on "Deploy 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., "@custom-mcp-serverAsk Genie: what were total sales by region last quarter?"
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.
A production-ready accelerator for building MCP servers on Databricks Apps:expose any Databricks capability as tools for AI agents.
Quickstart · Architecture · Configuration · Deployment · Documentation
What is this?
An accelerator that turns a Databricks workspace into an agent-ready backend. Anything running in Databricks (a Genie space, an Agent Framework/Agent Bricks agent on Model Serving, a SQL warehouse, any SDK-reachable capability) becomes an MCP tool: discoverable and callable by every MCP client (Claude, AI Playground, Copilot Studio agents in Teams, custom agents), with no client-side changes.
The core (what you build on):
MCP server (FastMCP + FastAPI) serving tools over streamable HTTP at
/mcp; add a tool by writing one decorated Python function (guide)Databricks Apps deployment: service-principal and end-user OAuth handled by the platform, secrets injected as app resources, guided by a Claude Code deploy skill
Production scaffolding: hermetic test suite covering every tool, enforced coding standards, resilient startup (optional integrations degrade gracefully, never crash the server)
The included example (a complete tool + channel, end to end):
ask_genietool: natural-language data Q&A via a Genie space, with caller-owned conversation continuitySlack bot: the same Genie capability surfaced to humans:
/askgenie, DMs, and @mentions, with automatic chart generation from query results
The example is a working reference, not the product: keep it, adapt it, or replace it with your own tools; the structure is what the accelerator delivers.
Related MCP server: Enterprise MCP Gateway and Tool Registry
Architecture
The diagram shows the accelerator with the included example wired in. The Databricks App box is the reusable core; the Genie space and Slack lane are the example capability and channel:
Full component and auth model breakdown: docs/architecture.md
MCP tools
Tool | Auth | Kind | Description |
| none | core | Liveness check |
| end user (forwarded OAuth token) | core | Identity of the calling user |
| app service principal | example | Conversational data Q&A against a Genie space |
Your own tools slot in beside these: one decorated function each, automatically discovered by clients and covered by the tests. To wrap a Databricks-hosted agent as a tool, follow the recipe.
As part of the example, the Slack surface answers the same Genie questions in-channel, formatted as Block Kit with an auto-generated chart (line/pie/bar chosen from the result shape).
Quickstart
Prerequisites: Python 3.11+, uv, Databricks CLI (authenticated).
uv sync
# Example configuration (all optional; the server runs without it:
# ask_genie returns a config error and the Slack bot stays disabled).
# See docs/setup-secrets.md for where these values come from.
export GENIE_SPACE_ID="<genie-space-id>"
export SLACK_BOT_TOKEN="xoxb-..."
export SLACK_APP_TOKEN="xapp-..."
uv run custom-mcp-server # → http://localhost:8000/mcp
uv run pytest tests/ # integration tests: discovers and calls every toolConfiguration
No secrets live in this repo. app.yaml resolves configuration from Databricks App resources (valueFrom:); locally they are plain environment variables. The pattern is the accelerator's contract: the current entries belong to the included example, and your own tools' configuration follows the same shape:
Env var | Deployed source (resource key) | Used by |
|
| example: Genie space to query |
|
| example: Slack bot token ( |
|
| example: Slack Socket Mode token ( |
Full setup (Slack app creation, secret scopes, resource binding): docs/setup-secrets.md
Deployment
With Claude Code (recommended): the repo ships a deploy skill covering the full checklist: prerequisites, secrets, app creation, resource bindings, deploy, verification. Open the repo in Claude Code and ask it to "deploy this app".
Manually: databricks apps create → databricks sync → databricks apps deploy; see docs/deployment.md, including verification steps and AI Playground testing.
Project structure
server/ # MCP server + Slack bot (see docs/architecture.md)
scripts/dev/ # Local server, remote OAuth testing, token generation
tests/ # Integration tests (auto-cover every registered tool)
docs/ # Documentation (architecture, setup, deployment, testing)
.claude/ # Claude Code deploy skill + skill-sync hook
app.yaml # Databricks Apps runtime config (secrets via valueFrom)Documentation
Full wiki index: docs/, organized as Understand → Set up → Deploy → Integrate → Extend.
Page | Contents |
Components, request flows, authentication model | |
Slack app setup, Databricks secrets, app resource binding | |
Claude Code skill, manual CLI deploy, verification, AI Playground | |
Integration tests, remote OAuth testing, token generation | |
Step-by-step: publish a Teams agent backed by this server | |
Why Teams ≠ Slack, integration options, phased plan | |
Tool development guide and conventions |
AI assistants working on this codebase: see Claude.md.
Development
uv run ruff format . # format
uv run ruff check . # lint
uv run pytest tests/ # integration testsThis server cannot be deployed
Maintenance
Related MCP Connectors
Give AI agents identity, scoped access, trusted context, and verifiable actions through MCP.
Governed AI agent skills — one library, distributed to devs and exposed to remote agents over MCP.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
- gatewayOAuthai.sealgate
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM-powered tools to manage Databricks permissions, credentials, and Git credentials via the MCP protocol.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to discover and execute tools via a secure MCP server with JWT authentication, RBAC, rate limiting, and audit logging.1MIT
- AlicenseAqualityDmaintenanceExposes Agent Skills to AI agents as MCP tools, enabling discovery and activation of skill instructions for coding agents.327MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to access a unified catalog of tools from various APIs (OpenAPI, GraphQL, MCP, Google Discovery) through the MCP protocol.173 npmMIT