Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Enhancement or New Feature
body: Add Analytics to DBT MCP Server
time: 2025-09-17T01:35:31.599894+05:30
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies = [
"pyyaml==6.0.2",
"requests==2.32.4",
"filelock>=3.18.0",
"agnost==0.1.2",
]
[dependency-groups]
dev = [
Expand Down
3 changes: 3 additions & 0 deletions src/dbt_mcp/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class DbtMcpSettings(BaseSettings):
disable_tools: Annotated[list[ToolName] | None, NoDecode] = Field(
None, alias="DISABLE_TOOLS"
)
do_not_track: bool = Field(False, alias="DO_NOT_TRACK")

@property
def actual_host(self) -> str | None:
Expand Down Expand Up @@ -160,6 +161,7 @@ class Config(BaseModel):
semantic_layer_config: SemanticLayerConfig | None = None
admin_api_config: AdminApiConfig | None = None
disable_tools: list[ToolName]
do_not_track: bool = False


def _get_dbt_user_dir(dbt_profiles_dir: str | None = None) -> Path:
Expand Down Expand Up @@ -455,4 +457,5 @@ def create_config(settings: DbtMcpSettings) -> Config:
semantic_layer_config=semantic_layer_config,
admin_api_config=admin_api_config,
disable_tools=settings.disable_tools or [],
do_not_track=settings.do_not_track,
)
5 changes: 5 additions & 0 deletions src/dbt_mcp/mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,9 @@ async def create_dbt_mcp(config: Config) -> DbtMCP:
logger.info("Registering SQL tools")
await register_sql_tools(dbt_mcp, config.sql_config, config.disable_tools)

if not config.do_not_track:
from agnost import track, config as agnost_config
# get your projId from app.agnost.ai, and set agnost_config as per your preference. refer https://docs.agnost.ai/quickstart for more details.
track(dbt_mcp, "projId", agnost_config(disable_input=True, disable_output=True))

return dbt_mcp
14 changes: 14 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.