Skip to content

Commit 2635617

Browse files
authored
Add MCP server instructions (#761)
## Summary I've been testing with a new MCP client. It requires a lot of explicit instructions to use the server. I'm hoping these instructions will allow the agent to use dbt MCP more readily. ## Checklist - [x] I have performed a self-review of my code - [x] I have made corresponding changes to the documentation (in https://github.com/dbt-labs/docs.getdbt.com) if required -- Mention it here - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes
1 parent 912be1c commit 2635617

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Enhancement or New Feature
2+
body: Add MCP server instructions
3+
time: 2026-05-07T12:27:43.171144-05:00

src/dbt_mcp/mcp/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
from mcp.types import ContentBlock, TextContent, Tool
1313

1414
from dbt_mcp.config.config import Config
15-
from dbt_mcp.errors.common import MissingHostError
1615
from dbt_mcp.dbt_admin.tools import register_admin_api_tools
1716
from dbt_mcp.dbt_cli.tools import register_dbt_cli_tools
1817
from dbt_mcp.dbt_codegen.tools import register_dbt_codegen_tools
1918
from dbt_mcp.discovery.tools import register_discovery_tools
2019
from dbt_mcp.discovery.tools_multiproject import register_multiproject_discovery_tools
20+
from dbt_mcp.errors.common import MissingHostError
2121
from dbt_mcp.lsp.providers.lsp_connection_provider import LSPConnectionProviderProtocol
2222
from dbt_mcp.lsp.tools import register_lsp_tools
2323
from dbt_mcp.mcp_server_metadata.tools import register_mcp_server_tools
2424
from dbt_mcp.product_docs.tools import register_product_docs_tools
25+
from dbt_mcp.prompts.prompts import get_prompt
2526
from dbt_mcp.proxy.tools import ProxiedToolsManager, register_proxied_tools
2627
from dbt_mcp.semantic_layer.client import DefaultSemanticLayerClientProvider
2728
from dbt_mcp.semantic_layer.tools import register_sl_tools
@@ -339,6 +340,7 @@ async def create_dbt_mcp(config: Config) -> FastMCP:
339340

340341
tool_dispatcher = DbtMCP(
341342
name="dbt",
343+
instructions=get_prompt("mcp/server_instructions").strip(),
342344
config=config,
343345
usage_tracker=DefaultUsageTracker(
344346
credentials_provider=config.credentials_provider.inner_provider,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Use these tools to interact with dbt resources (typically via dbt Platform):
2+
3+
- Understand how the project is structured: what exists in the environment, how objects depend on one another, and where to look when something looks wrong or slow.
4+
- Reason over governed business meaning—named measures and breakdowns the project maintains—and answer questions with validated aggregates or the warehouse logic behind them when that helps.
5+
- Work with platform automation when available: see what runs on a schedule, inspect past outcomes, act on failures or reruns, and dig into logs and outputs.
6+
- Assist with engineering work on dbt projects: take action on the project and reason about the underlying SQL.
7+
8+
Example data-oriented questions (users may not use dbt vocabulary):
9+
10+
- Revenue, ARR, bookings, pipeline, or quota: “how are we doing this quarter?”; “split it by region or product”; “this total doesn’t match finance.”
11+
- Customers, users, signups, or retention: “how many active …?” “is churn getting worse?” “cohorts or segments—whatever we already track.”
12+
- Orders, inventory, SKUs, or fulfillment: “what’s selling?” “stock or backorder questions” when they only describe the business problem.
13+
- Funnel, marketing, or web activity: “conversion from visit to purchase” “campaign performance” with loose wording and no metric names.
14+
- Trust and definitions: “where does this dashboard number come from?” “two reports disagree—help me find why” “what’s the official definition of …?”
15+
- Quality and freshness: “is this table up to date?” “missing yesterday’s data” “something looks stale in our reporting.”
16+
- Orchestration tied to data: “did last night’s refresh finish?” “prod load failed and Finance is blocked” without run or job IDs.
17+
- Engineering on a dbt project: “help me with this model,” “what’s wrong with my project?”

0 commit comments

Comments
 (0)