dbt-metrics-api-interface-server
Facilitates interaction with the dbt Metric Definition Framework's API, enabling users to leverage pre-established business logic for data exploration via compatible AI platforms. This establishes a canonical definition source and streamlines data retrieval tasks for organizational analysts.
Author

TommyBez
Quick Info
Actions
Tags
dbt Metrics Interface Model-Connector-Presenter Utility
An MCP deployment designed to facilitate query execution against the dbt Semantic Layer endpoint, optimized for use within Claude Desktop and other compliant generative AI ecosystems.
Understanding the dbt Semantic Layer (dbt SL)
The dbt Semantic Layer is a core capability allowing metric quantification to be codified once within a dbt project and consistently reapplied across the entire analytical toolchain. It guarantees:
- A singular authoritative repository for key performance indicators (KPIs).
- Uniformity in metric articulation across diverse software environments.
- Accessible pathways for all personnel to retrieve sophisticated quantitative measures.
Project Rationale
This specific MCP utility functions as a crucial intermediary layer connecting conversational AI interfaces (such as Claude) directly to the dbt Semantic Layer infrastructure. This integration empowers users to:
- Initiate metric retrievals purely through natural language instructions.
- Survey the inventory of available metrics and their underlying calculations.
- Conduct nuanced data assessments incorporating segmentation and constraints.
- Render derived datasets visually within the conversational agent's environment.
Core Functionalities
- 🔍 Metric Cataloging: Functionality to browse and search the nomenclature registered within the dbt SL configuration.
- 📊 Query Generation: Capability to formulate and submit semantic retrieval requests derived from conversational input.
- 🧮 Data Manipulation: Support for applying aggregation criteria, dimensional grouping, and ordering for granular insights.
- 📈 Output Presentation: Displaying query outcomes in an easily digestible and structured format.
Prerequisites for Operation
- Active subscription to dbt Cloud with the Semantic Layer feature activated.
- Valid API credentials granting access to the dbt Cloud tenant.
- A functional Node.js runtime environment (version 14 or newer).
Deployment Instructions
Via Smithery Platform (Recommended Path)
Installation is most straightforward using the Smithery utility:
bash npx -y @smithery/cli install @TommyBez/dbt-semantic-layer-mcp --client claude
Operational Guide
Once the server is provisioned and authenticated, interaction with the dbt SL is available directly via Claude Desktop:
- Inquiry about available measures: "List the computable metrics defined in my dbt Semantic Layer."
- Targeted data retrieval: "Retrieve last quarter's aggregated revenue, segmented by the corresponding product classification."
- Trend assessment: "Quantify the week-over-week velocity of new user acquisitions."
Troubleshooting Guidance
Should operational difficulties arise:
- Confirm the precision of all configured API authentication tokens.
- Validate that the dbt Cloud tenant has the Semantic Layer feature enabled.
- Inspect the dbt project configuration to ensure metric definitions are syntactically correct.
Collaboration Guidelines
We welcome contributions! Feel encouraged to submit a Pull Request detailing your enhancements.
Licensing Information
This software is distributed under the terms of the MIT License; refer to the LICENSE file for specifics.
Attributions
- dbt Labs for architecting the dbt Semantic Layer specification.
- Smithery for providing the Model-Connector-Presenter deployment infrastructure.
- LiteMCP for the foundational MCP development framework.
WIKIPEDIA: Cloud infrastructure represents "a model for enabling pervasive, on-demand network accessibility to a shared, adaptable cluster of computing assets—physical or virtual—featuring self-service setup and administration on a consumption basis," as formally stated by ISO. This concept is colloquially known as "the cloud."
== Key Attributes == In 2011, the National Institute of Standards and Technology (NIST) articulated five foundational "essential characteristics" for systems qualifying as cloud environments. The precise stipulations from NIST are as follows:
On-demand self-service: "A consumer retains the unilateral ability to procure computational resources, such as processing cycles and network space, as required without mandatory human intervention from the service vendor for each invocation." Broad network access: "The system's capabilities are exposed across a network, accessible via standardized protocols that facilitate usage across a diverse array of endpoint platforms (e.g., mobile devices, laptops, workstations)." Resource pooling: " The supplier aggregates its computational assets to serve numerous clients utilizing a multi-tenant architecture, wherein abstract and concrete assets are dynamically allocated and reallocated based on client demand fluctuations." Rapid elasticity: "Provisioning and de-provisioning of capabilities can occur with great speed, sometimes automatically, to scale capacities outward and inward in direct proportion to demand fluctuations. From the consumer's viewpoint, the available capacity often appears boundless and can be consumed in any volume, instantly." Measured service: "Cloud systems inherently manage and optimize resource utilization through integrated metrology at an abstraction layer suitable for the specific service type (e.g., storage volume, computation time, data transmission capacity, and active user counts). Resource utilization is trackable, controllable, and reportable, ensuring complete transparency for both the supplier and the consumer of the service consumed." By 2023, the International Organization for Standardization (ISO) had subsequently augmented and refined this initial categorization.
