databricks
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 0
- Forks
- 0
03 SKILL.md 正文
Databricks (databricks-mcp)
Read-only MCP server that runs SQL against a Databricks SQL warehouse via the Statement Execution API. FastMCP server name databricks_mcp, tool prefix databricks_.
Scope correction: this is a thin data-plane query client, not a management-plane server. There are no clusters, jobs, SQL-warehouse admin, Unity Catalog governance, workspace, DBFS, secrets, or repos tools. It queries whatever warehouse and namespace it is pointed at (default hive_metastore.default; example query SELECT count(*) FROM main.default.events).
Server at a glance
- 3 read-only tools, zero writes. No
DATABRICKS_WRITE_TOOLS_ENABLEDflag exists (by design). If a write tool is ever added, gate it behind an env flag per the template's permission-tier pattern and keep the guard. - Two write-prevention layers: (1)
list_tables/describe_tableonly interpolate a regex-validated dotted identifier (_validate_identifier, up tocatalog.schema.table), never free text; (2)assert_read_only()insrc/databricks_client.pyguardsrun_select: strips/*...*/and--comments, rejects stacked statements, requires the first word in{SELECT, SHOW, DESCRIBE, WITH}, and rejectsINSERT/UPDATE/DELETE/MERGE/DROP/CREATE/ALTER/TRUNCATE/GRANT/REVOKE/COPY/REPLACEas whole words. On violation it raisesWriteGuardErrorand never touches the warehouse. - Transport: stdio (engineer, default) or
streamable-http(aliashttp, for the Databricks App). Health/health, metrics/metrics, MCP endpoint/mcp/.
Auth model
Single connector code path with a per-request AuthProvider header callable:
- Local / stdio: PAT in
DATABRICKS_TOKEN-> staticBearer. Token captured in a closure, never stored as an attribute (kept out of repr/logs). Local-dev only. - Databricks App (prod): no PAT. The runtime injects service-principal OAuth M2M creds (
DATABRICKS_CLIENT_ID/DATABRICKS_CLIENT_SECRET);main._resolve_authbuildsdatabricks.sdk.core.Config(host=...)and passescfg.authenticateas the provider, which returns a fresh Bearer per request and refreshes the ~hourly token. Header fetched per request, never cached on the pooled httpx client. (Fixed in commit7a4b4c9: the App uses OAuth M2M, not a PAT.) - Claude Code attach:
scripts/mcp_app_launcher.ps1mints a fresh U2M token each spawn viadatabricks auth token --profile <your-oauth-profile>and bridges stdio to the App/mcpwithnpx mcp-remote.
API surface: only the SQL Statement Execution API v2.0 (POST /api/2.0/sql/statements, GET /api/2.0/sql/statements/{id}). No Jobs 2.1, Unity Catalog REST, or SCIM. Host shape https://adb-<workspace-id>.<n>.azuredatabricks.net.
Env vars
| Var | Default / example | Purpose |
|---|---|---|
DATABRICKS_HOST |
https://adb-<workspace-id>.<n>.azuredatabricks.net |
Workspace URL (not a secret) |
DATABRICKS_TOKEN |
unset in prod | PAT, local-dev only. Never log/commit |
DATABRICKS_WAREHOUSE_ID |
<warehouse-id> |
Target SQL warehouse |
DATABRICKS_CATALOG / DATABRICKS_SCHEMA |
hive_metastore / default |
Default namespace |
DATABRICKS_APP_PORT |
injected by App | Bind port (takes precedence over MCP_PORT) |
DATABRICKS_CLIENT_ID / DATABRICKS_CLIENT_SECRET |
injected by App | Service-principal OAuth M2M (consumed by the Databricks SDK) |
MCP_TRANSPORT / MCP_PORT / MCP_HOST / MCP_SERVER_NAME / LOG_FORMAT / LOG_LEVEL |
stdio / 8080 / 0.0.0.0 / databricks_mcp / text / INFO | Fleet transport + logging |
Tool inventory
All read-only (readOnlyHint:True). All take response_format: markdown|json (default markdown). Input models forbid extra keys and strip whitespace.
| Tool | Purpose | SQL issued | Key params |
|---|---|---|---|
databricks_list_tables |
List tables in a schema | SHOW TABLES IN <schema> |
schema_name (default hive_metastore.default, validated dotted identifier) |
databricks_describe_table |
Describe a table's columns | DESCRIBE TABLE <table> |
table (required, validated dotted identifier) |
databricks_run_select |
Run one arbitrary read-only statement | the statement, post read-only guard | statement (1-10000 chars, non-blank) |
API specifics
DatabricksConnector.execute()posts to/api/2.0/sql/statementswith{warehouse_id, statement, catalog, schema, wait_timeout:"25s", format:"JSON_ARRAY"}, then polls PENDING/RUNNING (default 5 attempts x 2s, httpx timeout 60s). Any non-SUCCEEDEDterminal state raisesDatabricksErrorwith thestatus.error.message.- Result shape: columns from
manifest.schema.columns[].name, rows fromresult.data_array(empty list if absent). Returned to tools as{"columns": [...], "rows": [[...]]}. - Poll budget is bounded (~25s inline wait + ~10s polling). Queries that exceed it raise
DatabricksErrorrather than waiting longer. This is a design limit, not a bug: for long queries, narrow the query. - Default namespace
hive_metastore.defaultis the legacy Hive metastore, not a Unity Catalog catalog. Pass a fully-qualifiedcatalog.schema.tableto reach elsewhere.
Deployment
Primary prod target is a Databricks App (app.yaml runs python src/main.py with MCP_TRANSPORT=streamable-http, LOG_FORMAT=json; the runtime injects DATABRICKS_APP_PORT + OAuth M2M creds). Deploy with databricks apps create mcp-databricks (the App resource name MUST start with mcp- or the AI Playground won't list it), databricks sync, databricks apps deploy. The caller IP must be on the workspace IP access list or the App returns 403. app.yaml + requirements.txt (kept in sync with pyproject by hand) drive the App build. Also runnable as stdio (engineer mode) or a Streamable-HTTP container.
Fleet conventions (adding a tool)
Scaffolded from mcp-template-build, conforms to the fleet conformance contract. Same shape as [[microsoft-graph]], [[sonarqube]], [[cribl]].
- Subclass
BaseModule(or extendTablesModule) insrc/custom_components/;discover_modules()instantiates each subclass at startup. Register underfn.__name__, which MUST start withdatabricks_. - Input is a single Pydantic
BaseModel(ConfigDict(extra="forbid"),Field(...)); set all four annotations. Validate any identifier interpolated into SQL with_validate_identifier; never interpolate raw user free-text into a statement. - respx-mocked
tests/test_<area>.py(mockconn.execute); no live warehouse in unit tests. - Pre-push gate:
pytest -v+ruff check src tests+mypy src(strict) +check_pydantic_inputs.py src+check_no_print.py src(stdout is the JSON-RPC channel; log to stderr) +check_jwt_allowlist.py.
Python >=3.12,<4.0, Poetry for dev (pip + requirements.txt for the App/Docker build). Do not run the container conformance Docker gate locally; stdio release is githooks only.
04 同仓库更多 Skills
vibesec
This skill helps Claude write secure web applications. Use this when working on any web application or when a user requests a scan or audit to ensure security best practices are followed.
ui-ux-guide
Modern, clean UI/UX guidance + review skill. Use when you need actionable UX/UI recommendations, design principles, or a design review checklist for new features or existing systems (web/app). Focus on CRAP (Contrast/Repetition/Alignment/Proximity) plus task-first UX, information architecture, feedback & system status, consistency, affordances, error prevention/recovery, and cognitive load. Enforce a modern minimal style (clean, spacious, typography-led), reduce unnecessary copy, forbid emoji as icons, and recommend intuitive refined icons from a consistent icon set.
tufin
暂无简介
tines
Tines is a no-code automation and orchestration platform commonly used as a SOAR replacement, IT automation engine, and workflow builder. Use this skill whenever the user mentions Tines, Tines stories, actions, the AI Agent action, Story copilot, Webhook actions, HTTP Request actions, Event Transform, Send to Story, Resources, Pages, Cases, Records, credentials, Connect Flows, formulas, pills (`<<slug.body.field>>` syntax), the Tines API, the Tines Terraform provider, tenants, change control, self-hosted Tines, Helm charts for Tines, Tines Tunnel, Command-over-HTTP, Tines on Azure or AWS, Tines credits and the AI credit pool, the Workbench, MCP server templates exposed by Tines, or any automation or workflow build inside Tines. Also trigger when the user asks about migrating from Cortex XSOAR / XSIAM or other SOAR platforms to Tines, designing playbook or story patterns, integrating security tools through Tines, building forms with Pages, running case management in Tines, or is debugging a Tines workflow, even if they don't name a specific Tines concept.
tines-3b
Tines 3B is a separate product from Tines (Stories), not an upgrade path. Workflows are git repositories, steps are containerized code directories that pipe stdin to stdout, and an AI agent builds them from prompts. Use this skill whenever the user mentions Tines 3B, 3B spaces, 3B workflows, steps, config.toml, route_auth, route_type, webpage routes, volumes and /storage, Tines units (TUs), connectors and the credential proxy, 3B skills, watchtower, autofix, autotune, solo runs, 3B branches or push-live, the 3B REST API or MCP endpoint, GitSync, tunnels and networks, or docs.3b.tines.com. Also trigger when comparing 3B against Tines Stories, deciding which of the two a use case belongs in, or migrating between them. For classic Tines (stories, actions, pills, formulas, Cases, Records, Pages), use the `tines` skill instead.
threatconnect
ThreatConnect TIP and Polarity overlay expert. Use for any task involving ThreatConnect or Polarity: REST API calls (v2/v3), authentication (Token/HMAC), TQL queries, Indicators, Groups, Cases, Workflow, Tags, Security Labels, Associations, ThreatAssess scoring, CAL configuration, indicator deprecation, exclusion lists, TAXII feeds (inbound/outbound), feed metrics, dashboards, Query Cards, Threat Graph, ATT&CK Visualizer, Risk Quantifier, Polarity integrations (Core, IOC Submission, Intel Search, CAL, XSOAR), Polarity custom development (Node.js), Polarity server administration, Playbooks, Components, Workflow Playbooks, App Builder, TcEx, indicator distribution to SIEM/SOAR (XSIAM, Sentinel, Splunk, Elastic, Tines, Torq, BlinkOps), HTTP errors, HMAC signature failures, indicator formatting (ASN, CIDR, Host, URL, Registry Key), or troubleshooting. Trigger even without explicit ThreatConnect/Polarity mention if the task involves threat intelligence platform operations.