dbt
dbt-mcp-server
claude mcp add --transport stdio kannandreams-dbt-mcp-server python mcp_dispatcher.py \ --env SLACK_WEBHOOK_URL="Slack webhook URL for task status alerts"
How to use
This MCP server provides a unified JSON interface for triggering dbt operations (models, tests, and related tasks) via a single, extensible MCP workflow. Use the server to run dbt commands through the MCP dispatcher, receiving status updates and results over HTTP or CLI, with optional Slack notifications on success or failure. The server accepts mcp requests in a JSON format that specifies which dbt actions to run, along with any relevant context or parameters. It is designed to be invoked from CLI, API calls, or AI-assisted workflows (e.g., Claude).
Typical usage paths include:
- Direct CLI invocation: pass an mcp_request.json to the dispatcher to start a dbt operation.
- HTTP/API usage: send a JSON payload to the MCP endpoint to trigger dbt tasks and monitor progress.
- AI-enabled automation: integrate with prompt-driven tools to trigger dbt models, tests, and other tasks through the unified MCP interface.
Tools and capabilities exposed by this server include:
- Triggering dbt models and tests via a clean JSON spec (permitted actions expressed in the mcp_request).
- Optional Slack notifications on task completion or failure (configured with SLACK_WEBHOOK_URL).
- Compatibility with Claude and other AI clients for prompt-driven automation, enabling seamless orchestration of dbt workflows through natural language prompts.
How to install
Prerequisites
- Python 3.8+ installed on your system
- pip available in your PATH
- (Optional but recommended) a virtual environment
- Access to a dbt adapter appropriate for your data warehouse (e.g., dbt-postgres, dbt-redshift, dbt-snowflake) and credentials configured
Step-by-step installation
- Clone or download the repository to your development machine.
- Create and activate a virtual environment (optional but recommended):
- python -m venv venv
- source venv/bin/activate (Linux/macOS) or venv\Scripts\activate (Windows)
- Install project dependencies:
- pip install -r requirements.txt
- Install dbt and adapter (adjust for your warehouse):
- pip install dbt-postgres (example for PostgreSQL; use dbt-snowflake, dbt-redshift, etc., as appropriate)
- Configure environment variables needed by the server:
- SLACK_WEBHOOK_URL (optional, for Slack alerts)
- Run the MCP Dispatcher:
- python mcp_dispatcher.py
Optional: Test with a sample request
- Create a file named mcp_request.json with the appropriate mcpServers payload (see README for example), then run:
- python mcp_dispatcher.py mcp_request.json
Additional notes
Tips and common issues:
- Ensure your Python environment has the dbt package and the correct adapter installed for your data warehouse.
- If using Slack alerts, verify SLACK_WEBHOOK_URL is correctly configured and accessible from the running environment.
- When running locally, ensure port usage does not conflict with other services and update your mcp_request.json to target the correct server name if you have multiple MCP servers configured.
- The dispatcher expects valid JSON in the mcp_request.json file; malformed JSON will result in startup or runtime errors.
- For Claude or other AI integrations, expose the MCP API in a secure manner (e.g., authentication, rate limiting) as needed for your workflow.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP