dax-query-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dax-query-server run a DAX query showing total sales by month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dax-query-mcp
MCP server for running DAX queries against Power BI semantic models.
Check out making use of skills and extensions for getting better results since the MCP can't do it all
Features
Connection-centric MCP server — discover models, query with DAX, inspect schemas
Relationship-aware context — teach the LLM your model with markdown, structured dictionaries, relationships, and progressive context bundles
Fuzzy search — search columns and measures across tables by name or description
Server-authored follow-ups — every query response includes a durable next-step workflow for exports, charts, scaffolds, and workstation saves
Export anywhere — CSV, clipboard, Power Query M code, Streamlit apps, standalone Python projects
Query builder — save
.dax+.dax.queryBuilderartifacts, open directly in DAX StudioWorkstation session — save, list, and batch-export queries during an exploration session
Durable query packs — turn saved DAX into portable packs with a manifest, batch runner, Streamlit explorer, and Power Query files
Validated query libraries — keep connection-scoped, known-good DAX examples that improve future context without creating a full pack
Related MCP server: powerbi-mcp
Prerequisites
uv — Python package manager. Install with:
winget install astral-sh.uvFor MSOLAP connections: Windows + MSOLAP provider — the default transport uses COM/ADODB. Download from Microsoft — grab the "AMO + ADOMD.NET" or "MSOLAP (OLE DB)" installer. If you already have Power BI Desktop, Excel with Power Pivot, or SSMS installed, you likely have it.
To check: open PowerShell and run:
(New-Object System.Data.OleDb.OleDbEnumerator).GetElements() | Where-Object { $_.SOURCES_NAME -like "*MSOLAP*" }If that returns a row, you're good.
For Power BI REST connections: Azure CLI or access token — REST uses the Power BI
executeQueriesAPI and does not require Windows or MSOLAP.az login --allow-no-subscriptionsOn Windows, the standard Azure CLI install path is auto-detected if
azis not onPATH. For custom installs, setAZURE_CLI_PATHto the fullaz.cmdpath.
Quick start
1. Install
From PyPI (recommended):
uvx --from dax-query-mcp dax-query-serverFrom source (for development or latest changes):
git clone https://github.com/wes-stone/dax-query-mcp.git
cd dax-query-mcp
uv sync2. Add a connection bundle
Each model is represented by a small connection bundle in Connections/.
The YAML file provides access to the model; the companion context files are the
layer that makes Copilot useful because they explain the model in business terms.
Create Connections/my_model.yaml for the connection string and runtime
settings. When transport is omitted, it defaults to msolap, so existing
connection files keep working unchanged:
connection_string: |
Provider=MSOLAP.8;
Data Source=powerbi://api.powerbi.com/v1.0/myorg/MyWorkspace?readonly;
Initial Catalog=MySemanticModel
description: "My semantic model"
command_timeout_seconds: 1800For a REST-backed connection, use transport: powerbi_rest and the Power BI
dataset ID instead of an MSOLAP connection string:
transport: powerbi_rest
dataset_id: "00000000-0000-0000-0000-000000000000"
description: "My semantic model via Power BI REST"
auth_mode: azure_cli
command_timeout_seconds: 1800
max_rows: 50000REST execution always uses the dataset-only executeQueries endpoint:
https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/executeQueries.
Do not put /groups/{workspace_id} in api_base_url; workspace-scoped REST
paths can fail for Build-only access even when the dataset-only endpoint works.
Then add context files with the same connection name:
File | Purpose |
| Required runtime config: MSOLAP connection string or REST dataset ID, plus description, timeouts, and row limits. |
| Optional compact overview used first by |
| Optional full model context; include detailed table notes, business definitions, caveats, relationships, and query patterns. |
| Optional structured dictionary used by |
| Optional validated query library; one metadata file plus one |
Recommended setup flow:
Create the
.yamlconnection file.Add a short
_overview.mdso Copilot can quickly understand the model before writing DAX.Add the fuller
.mdcontext for detailed business logic, naming conventions, and examples.Add or generate the
.data_dictionary.yamlso tools can search fields and measures structurally.After real queries work, save repeated patterns to
.validated_queries/so future sessions can reuse known-good DAX.
You can create the dictionary manually or, for MSOLAP connections, scaffold one
from the live model with the generate_data_dictionary MCP tool. The generator
uses safe MDSCHEMA rowsets for tables, columns, and measures, and includes
high-confidence relationships when optional TMSCHEMA rowsets are available.
Then fill in business-specific definitions and sample values.
3. Wire up MCP
Add to .copilot/mcp.json (or your MCP client config):
Using PyPI (via uvx):
{
"mcpServers": {
"dax-query-server": {
"command": "uvx",
"args": ["--from", "dax-query-mcp", "dax-query-server"],
"env": {
"DAX_QUERY_MCP_CONNECTIONS_DIR": "C:\\absolute\\path\\to\\Connections"
}
}
}
}Using a local clone:
{
"mcpServers": {
"dax-query-server": {
"command": "uv",
"args": ["--directory", "C:\\path\\to\\dax-query-mcp", "run", "--no-sync", "dax-query-server"],
"env": {
"DAX_QUERY_MCP_CONNECTIONS_DIR": "C:\\absolute\\path\\to\\Connections"
}
}
}
}Run uv sync manually after dependency changes. Keep MCP startup on
uv run --no-sync so the server does not try to mutate its virtual environment
while the executable is already running.
Tip:
DAX_QUERY_MCP_CONNECTIONS_DIRlets you share oneConnections/folder across workspaces.
4. Run your first query
Ask Copilot (or any MCP client):
"List connections, then run a DAX query against my model."
The server returns plain markdown — results render as tables directly in chat.
Demo without Power BI: Mock Contoso
The repo includes a safe, deterministic mock_contoso connection for README
screenshots, demos, tests, and local development. It uses MOCK://contoso, so
it does not require Azure login, Power BI permissions, MSOLAP server access, or
private dataset IDs.
Use it to show the full MCP workflow:
Step | Prompt to capture | Feature shown |
1 |
| Connection discovery with |
2 |
| Overview/context layer |
3 |
| Structured data dictionary search |
4 |
| Column search across model metadata |
5 |
| DAX execution and markdown result table |
6 |
| Live schema inspection via safe MDSCHEMA rowsets |
7 |
| Export workflow |
Mock Contoso context layer
The demo connection is a complete connection bundle. This is the feature worth showing in screenshots: the model is not just a connection string, it includes LLM-readable context and structured metadata.
Connections/
mock_contoso.yaml
mock_contoso_overview.md
mock_contoso.md
mock_contoso.data_dictionary.yamlFile | Used by | What it teaches the agent |
|
| Connection name, connection type, runtime settings |
|
| Fast summary: tables, measures, demo queries, screenshot prompts |
|
| Deeper guidance and the end-to-end demo walkthrough |
|
| Searchable tables, columns, measures, filters, relationships, descriptions, and sample values |
Connection YAML:
connection_string: "MOCK://contoso"
description: "Mock Contoso Sales cube for testing and development"
connection_timeout_seconds: 30
command_timeout_seconds: 300Overview excerpt:
## Tables
| Table | Purpose | Useful columns |
| --- | --- | --- |
| `Sales` | Transaction fact table | `SalesKey`, `ProductKey`, `DateKey`, `Quantity`, `Amount` |
| `Products` | Product dimension | `ProductKey`, `ProductName`, `Category`, `Price` |
| `Calendar` | Date dimension for 2025 | `DateKey`, `Date`, `Month`, `MonthNum`, `Year`, `Weekday` |Data dictionary excerpt:
measures:
- name: Total Sales
expression: SUM(Sales[Amount])
description: Sum of all sales amounts
format_string: "$#,##0.00"
filters:
- name: Category Filter
column: Products[Category]
description: Filter by product category
suggested_values: ["Bikes", "Accessories"]
relationships:
- from_table: Sales
from_column: ProductKey
to_table: Products
to_column: ProductKey
cardinality: many-to-one
cross_filter_direction: single
is_active: true
description: Sales transactions roll up to product attributes through ProductKey
source: curated
confidence: highGood screenshot query:
EVALUATE
SUMMARIZE(
Sales,
"Total Sales", [Total Sales],
"Total Quantity", [Total Quantity]
)Expected result shape:
Total_Sales | Total_Quantity |
178390.0 | 290 |
Connection YAML
transport: "msolap" # optional — "msolap" (default) or "powerbi_rest"
connection_string: "..." # required for MSOLAP connections
dataset_id: "..." # required for powerbi_rest connections
description: "..." # human-readable label
auth_mode: "azure_cli" # REST auth: "azure_cli" (default) or "env"
access_token_env: "POWERBI_ACCESS_TOKEN" # env var used when auth_mode="env"
api_base_url: "https://api.powerbi.com/v1.0/myorg" # optional REST override
impersonated_user_name: "..." # optional REST impersonation UPN
command_timeout_seconds: 1800 # DAX query timeout
connection_timeout_seconds: 300 # connection open timeout
max_rows: null # row cap (null = unlimited)
suggested_skill: "..." # optional — hint an MCP client toward a specific skill
suggested_skill_reason: "..." # optional — why that skill is relevantConnection context layer
The context layer is what turns a raw semantic model connection into an LLM-friendly workspace. Keep the filenames aligned to the connection name:
Connections/
my_model.yaml
my_model_overview.md
my_model.md
my_model.data_dictionary.yamlget_connection_context reads the overview first when it exists, falling back to
the full markdown context. Use the overview for the shortest useful description:
key tables, trusted measures, common filters, grain, date handling, and a few
known-good DAX examples.
Use the full .md file for deeper guidance: business definitions, metric
caveats, relationship notes, security/filtering assumptions, common query
patterns, and examples of what not to do.
Use the data dictionary YAML when you want structured metadata that tools can search and return precisely:
version: "1.0"
tables:
- name: Sales
description: Fact table with booked transactions
columns:
- name: Amount
data_type: decimal
description: Transaction amount in USD
sample_values: ["100.00", "250.50"]
measures:
- name: Total Sales
expression: SUM(Sales[Amount])
description: Sum of booked sales amount
format_string: "$#,##0.00"
filters:
- name: Fiscal Year
column: Calendar[FiscalYear]
description: Filter by fiscal year
suggested_values: ["FY25", "FY26"]
relationships:
- from_table: Sales
from_column: DateKey
to_table: Calendar
to_column: DateKey
cardinality: many-to-one
cross_filter_direction: single
is_active: true
description: Sales rows filter through Calendar by date key
source: curated
confidence: highFor agent workflows, start with get_connection_context(detail="overview"),
then use get_context_bundle(detail="overview") for structured counts and
relationship hints. Fetch scoped context only when needed with
get_table_detail, get_measure_detail, get_relationships, and
get_filter_suggestions. check_context_staleness compares the dictionary to
live metadata when the transport supports it; check_ai_readiness highlights
missing descriptions, ambiguous columns, undocumented relationships, and other
context gaps.
For powerbi_rest connections, the context layer is especially important:
Power BI executeQueries supports DAX query execution, but not DMV/MDSCHEMA
metadata queries. inspect_connection and live dictionary generation are
available for MSOLAP connections; REST connections should rely on the overview,
full markdown context, and .data_dictionary.yaml. If a model only works
through REST with Build access, document trusted tables/measures and known-good
queries in the context layer so agents do not try workspace-scoped metadata
paths.
MCP tools
Tool | Purpose |
Discovery | |
| Discover available connections as a markdown table ( |
| Curated markdown context (tables, columns, measures) |
| Search context docs for specific terms |
| Live schema via safe |
| Progressive structured context with counts, tables, measures, filters, and relationships |
| Scoped table context plus related relationships |
| Scoped measure context |
| Relationship topology, optionally filtered by table |
| Suggested filters and allowed values from the dictionary |
| Compare dictionary names/counts against live metadata |
| Flag missing/ambiguous context before query writing |
| Check optional high-fidelity TMSCHEMA relationship access |
Querying | |
| Run DAX against a named connection |
| Run DAX against a raw connection string |
Search | |
| Fuzzy-search columns across tables |
| Fuzzy-search measures by name or expression |
Export | |
| Export results to a timestamped CSV |
| Copy results to clipboard (TSV or markdown) |
| Generate Power Query M code for Excel |
| Generate a live single-query Streamlit explorer |
| Scaffold a standalone Python project |
| Render a bar/line/pie chart as PNG |
Query builder | |
| Save |
| Load a saved query builder definition |
| Get the expected JSON payload shape |
Workstation | |
| Save a query to the session workstation |
| List saved workstation queries |
| Batch-export workstation as scaffold or |
Query packs | |
| Create an empty durable query-pack folder |
| Add or update a DAX query in |
| Summarize a saved pack and its query metadata |
| Check manifest shape, safe DAX, parameters, and connections |
| Generate a markdown pack summary for review and sharing |
| Generate runner, Streamlit, Power Query, and README artifacts |
Validated query libraries | |
| Save a reusable DAX example under a connection-scoped library |
| List saved examples, tags, parameters, and validation status |
| Retrieve known-good DAX examples for future query authoring |
| Smoke-test saved examples and persist status, columns, and row counts |
Admin queries are blocked.
INFO.*()and$SYSTEM.DISCOVER_*require server admin rights. General query execution only allows safeMDSCHEMArowsets. OptionalTMSCHEMAaccess is isolated behind dedicated metadata tools and may be unavailable depending on XMLA permissions.
Python scaffolds
scaffold_dax_workspace exports one query as a standalone Python project.
export_workstation(format="scaffold") exports every query saved in the
session workstation as one multi-query query-pack project.
Generated projects include transport-aware connection config:
Connection type | Generated behavior |
| Uses the embedded Power BI / SSAS connection string through ADODB |
| Uses Power BI REST |
| Runs the deterministic demo data path without Power BI or ADODB |
The generated scripts use a CONNECTION or CONNECTIONS dict instead of a
connection-string-only placeholder, so follow-through exports keep dataset ID,
auth mode, timeout, and mock/REST metadata aligned with the named connection.
Do not commit generated workspaces that contain private dataset IDs, workspace
names, connection strings, or tokens.
Query packs
A query pack is a portable, human-editable DAX workspace:
my-query-pack/
pack.yaml
connections.json
queries/
monthly_arr.dax
results/
monthly_arr.csv
monthly_arr.schema.json
run_log.json
power_query/
monthly_arr.pq
streamlit_app.py
run_queries.py
pyproject.toml
README.mdUse query packs when an exploration becomes reusable. The in-memory workstation
is still best for scratch work; export_workstation(format="scaffold") now makes
that scratch work durable as a query pack. For curated projects, use
create_query_pack, save_query_to_pack, validate_query_pack,
describe_query_pack, and export_query_pack directly.
Generated run_queries.py supports batch execution with --list, --only,
--tag, --param name=value, --output, --format csv|json, --max-rows,
--continue-on-error, and --fail-fast. Each run writes one result file per
query plus schema sidecars and results/run_log.json. Generated workspaces also
include pyproject.toml so uv run and uv sync manage the environment from
the project manifest.
Generated streamlit_app.py is the full interactive explorer for a pack. It
includes query catalog search, tag and connection filters, typed parameter
controls, editable rendered DAX, cached execution, an Explore tab that keeps
run/results/charts/pivots together, session run history, column filters,
drag-and-drop CSV/JSON upload exploration, profiling, and CSV/JSON/schema/DAX
downloads. Use it when you want a DAX
Studio-like exploration surface over curated queries:
cd .\my-workspace
uv run streamlit run streamlit_app.pyGenerated power_query/*.pq is first-class for MSOLAP connections. REST-backed
connections produce an explicit stub until Excel Power Query token refresh is
safe enough to automate. Query packs never store tokens or passwords.
The project also includes a Copilot CLI extension in
.github/extensions/dax-query-pack/extension.mjs. After extensions_reload, it
adds dax_pack_* tools that wrap the same query-pack library and return
copyable commands for batch execution and Streamlit.
Validated query libraries
Validated query libraries are connection-scoped context artifacts, not runnable
workspace projects. Use them for recurring patterns that should guide future DAX
generation: common measures, period grains, required filters, and safe
SUMMARIZECOLUMNS shapes. Use query packs when you need a shareable project
with batch execution, Streamlit, Power Query, and result artifacts.
Each library lives beside the connection config and stores one metadata file plus one DAX file per query:
Connections/
sales.yaml
sales.validated_queries/
monthly_revenue.yaml
monthly_revenue.daxThe metadata stores intent, tags, declared parameters, sample validation
parameters, output defaults, validation status, row count, returned columns, and
a rendered DAX hash. It never stores result rows or secrets. If the DAX file
changes after validation, list/search/context calls mark the entry as stale.
Typical MCP workflow:
search_validated_queries → run_connection_query → save_validated_query → validate_query_library(max_rows=1)max_rows caps returned rows but may not make the server-side DAX plan cheap, so
keep validation examples intentionally small and well-filtered. Required
parameters need defaults or sample_parameters_json before an entry can pass
validation.
get_context_bundle includes compact metadata-only summaries from the library so
agents can discover that reusable patterns exist without loading every DAX file.
Use search_validated_queries or list_validated_queries(include_dax=True) when
you need the actual DAX template for query authoring.
CLI usage
# List configured queries
dax-query --list --config-dir queries
# Run a query
dax-query --query my_query --preview --config-dir queries
# Inspect a connection schema
dax-query --inspect-connection my_model --connections-dir Connections
# Save a query builder artifact
dax-query-builder --save-query-builder-from builder.json --config-dir queries
# Create and export a durable query pack
dax-query-pack create --output-dir .\my-pack --name revenue-exploration
dax-query-pack add-query --pack-path .\my-pack --connection-name arr_connection --query "EVALUATE ROW(\"Example\", 1)" --description "Example query"
dax-query-pack validate --pack-path .\my-pack --connections-dir Connections
dax-query-pack describe --pack-path .\my-pack --connections-dir Connections
dax-query-pack export --pack-path .\my-pack --output-dir .\my-workspace --connections-dir Connections
# Get commands to run the generated workspace
dax-query-pack run-command --workspace-dir .\my-workspace --only example-query --format csv
dax-query-pack streamlit-command --workspace-dir .\my-workspaceSaved .dax files open directly in DAX Studio. See docs/ for detailed CLI documentation.
validate_query_pack can also run a live smoke test through the MCP with
dry_run=True and a low max_rows cap. Structural validation runs first; live
execution is skipped until manifest, query, connection, and parameter checks are
clean.
The query result menu preserves the original flat 1-11 compatibility contract
and adds option 12 to save successful queries to the Validated query library.
Agents that need machine-readable scope can read followup://menu/grouped to
separate This query actions from durable Current pack and Validated
query library actions.
Copilot guard hook
A pre-commit hook reviews staged changes for private content (real workspace URIs, local paths, non-sample connection files).
Connection files are ignored by default, and the guard blocks likely real Power BI workspace URIs or dataset IDs. Keep real REST dataset IDs in local, untracked connection files; use all-zero sample IDs in docs and tests.
# Install
powershell -ExecutionPolicy Bypass -File .\scripts\install-git-hooks.ps1
# Runs automatically on commit:
dax-query-guard --mode stagedAdd repo-specific patterns via .copilot-guard.local.json:
{
"blocked_content_patterns": [
{
"pattern": "PrivateWorkspace|InternalDataset",
"reason": "Internal identifiers"
}
]
}Fails closed by default. Set COPILOT_GUARD_FAIL_OPEN=1 to allow commits when Copilot CLI is unavailable.
Requirements
Windows + MSOLAP for the default
msolaptransport (COM/ADODB)Azure CLI or access token for the optional
powerbi_resttransportPython 3.12+ (handled automatically by
uvx)uv (
winget install astral-sh.uv)
Available Tools
50 toolscheck_ai_readinessCRead-only
Assess whether context is descriptive enough for reliable DAX generation.
Inputs: connection_name (required), connections_dir. Returns: result
check_context_stalenessCRead-only
Compare live model metadata against the data dictionary for drift.
Inputs: connection_name (required), connections_dir, command_timeout_seconds. Returns: result
clear_workstationBDestructive
Clear all queries from the workstation.
Removes every saved query from the in-memory workstation and returns the count of removed items.
Inputs: connections_dir. Returns: result
copy_to_clipboardB
Run a DAX query and copy the full result to the system clipboard.
Use format="tsv" (default) to paste into Excel, or format="markdown" for a markdown table. Returns a JSON summary with row_count and a short preview.
Inputs: query (required), connection_name (required), format, max_rows, +1 more. Returns: result
create_query_packC
Create an empty durable query pack with a versioned pack.yaml manifest.
Inputs: output_dir (required), name, overwrite, description. Returns: result
describe_query_packCRead-only
Generate a shareable markdown description of a query pack.
Inputs: pack_path (required), connections_dir, include_validation. Returns: result
diff_data_dictionaryBRead-only
Compare two data dictionary YAML files and return added/removed metadata.
Inputs: base_path (required), candidate_path (required). Returns: result
export_query_packC
Export a query pack as a runnable Python/Streamlit/Power Query workspace.
Inputs: pack_path (required), overwrite, output_dir, connections_dir, +2 more. Returns: result
export_to_csvC
Export DAX query results to a timestamped CSV file.
Returns JSON with file_path, row_count, and column_count.
Inputs: query (required), output_dir (required), connection_name (required), max_rows, +2 more. Returns: result
export_workstationA
Export all workstation queries as a scaffold workspace or .dax files.
This is the "make it permanent" step — writes the in-memory workstation to disk as a portable project.
Parameters: output_dir: Directory to write the exported files. connections_dir: Unused (kept for API compat). format: "scaffold" creates a full project (run_queries.py, pyproject.toml, README, and queries/ dir). "dax" writes only .dax files.
Inputs: output_dir (required), format, connections_dir. Returns: result
generate_data_dictionaryA
Generate a data dictionary YAML from live schema inspection.
Queries MDSCHEMA_MEASUREGROUPS, MDSCHEMA_MEASURES, MDSCHEMA_DIMENSIONS, and MDSCHEMA_LEVELS to discover tables, columns, and measures, then builds a DataDictionary scaffold. If optional TMSCHEMA rowsets are available, it also includes high-confidence relationship metadata.
Required parameters: connection_name. Optional parameters: connections_dir, output_path — when provided the YAML is written to disk.
Returns JSON with yaml_content, table_count, measure_count, and file_path (when output_path is given).
Inputs: connection_name (required), output_path, connections_dir. Returns: result
get_connection_contextARead-only
Return metadata and context for a named connection.
This is the PRIMARY way to discover tables, columns, measures, and filters. Always call this FIRST before writing any DAX query.
detail levels:
"overview" (default): Returns the compact overview with key tables, measures, and a few example queries. Fast and concise — use this first.
"full": Returns the complete context markdown. Only use if overview is insufficient and you need deep detail on filters, column values, etc.
Inputs: connection_name (required), detail, connections_dir. Returns: result
get_context_bundleARead-only
Return a progressive, structured context bundle for a connection.
detail="overview" returns compact counts and key names; "schema" returns structured tables, measures, filters, and relationships; "full" also includes available markdown context. Use table_names as a comma-separated allowlist to scope table-heavy schema output.
Inputs: connection_name (required), detail, table_names, connections_dir. Returns: result
get_data_dictionaryBRead-only
Return the data dictionary for a named connection as JSON.
The data dictionary describes tables, columns, measures, and filters with human-readable descriptions and sample values.
Inputs: connection_name (required), connections_dir. Returns: result
get_filter_suggestionsCRead-only
Return suggested filters and values from the data dictionary.
Inputs: connection_name (required), filter_name, connections_dir. Returns: result
get_measure_detailCRead-only
Return detailed structured context for a single measure.
Inputs: measure_name (required), connection_name (required), connections_dir. Returns: result
get_query_builderBRead-only
Load a saved query builder definition and generated DAX text by query name.
Inputs: query_name (required), queries_dir. Returns: result
get_query_builder_schemaBRead-only
Return the expected JSON shape and a copyable example payload for save_query_builder.
Inputs: connection_name. Returns: result
get_relationshipsBRead-only
Return relationship topology, optionally filtered to one table.
Inputs: connection_name (required), table_name, connections_dir. Returns: result
get_schemaARead-only
Return schema information for a connection, enriched with data dictionary descriptions when available.
If a data dictionary file exists for the connection, the response
includes table, column, measure, and filter descriptions. Otherwise
a basic payload is returned suggesting inspect_connection for
live schema discovery.
Inputs: connection_name (required), connections_dir. Returns: result
get_table_detailCRead-only
Return detailed structured context for a single table.
Inputs: table_name (required), connection_name (required), connections_dir. Returns: result
inspect_connectionARead-only
Inspect model metadata using non-admin MDSCHEMA rowsets.
Prefer get_connection_context first — it returns curated documentation without hitting the server. Use this only for live schema discovery.
Inputs: connection_name (required), preview_rows, connections_dir, command_timeout_seconds. Returns: result
inspect_model_metadataCRead-only
Backward-compatible metadata probe for raw connection strings. Present previews as markdown tables.
Inputs: connection_string (required), preview_rows, command_timeout_seconds. Returns: result
list_connectionsARead-only
List configured connections as a markdown table by default.
Call get_connection_context on a connection with overview/full context before writing DAX queries. Set output_format="json" for machine-readable output.
Inputs: output_format, connections_dir. Returns: result
list_queriesCRead-only
Backward-compatible helper for the older query-centric workflow.
Inputs: config_dir. Returns: result
list_query_packBRead-only
List query-pack metadata and query entries from pack.yaml.
Inputs: pack_path (required). Returns: result
list_validated_queriesARead-only
List connection-scoped validated query metadata.
Set include_dax=True only when you need the actual DAX examples; context bundles intentionally include metadata only.
Inputs: connection_name (required), include_dax, connections_dir. Returns: result
list_workstationBRead-only
List all queries saved in the current session workstation.
Returns a JSON array of saved queries with their names, descriptions, connection names, and timestamps. Shows a helpful message if the workstation is empty.
Inputs: connections_dir. Returns: result
merge_data_dictionaryC
Merge regenerated metadata with curated descriptions and optionally write YAML.
Inputs: curated_path (required), generated_path (required), output_path. Returns: result
probe_tmschema_capabilitiesCRead-only
Probe optional TMSCHEMA metadata access without requiring it.
Inputs: connection_name (required), connections_dir. Returns: result
quick_chartB
Generate a chart (bar, line, or pie) from DAX query results.
Returns JSON with file_path, chart_type, and row_count. If output_path is not provided, the chart is saved to a temp file.
Inputs: query (required), x_column (required), y_column (required), chart_type (required), +4 more. Returns: result
remove_from_workstationADestructive
Remove a saved query from the workstation by name.
Parameters: query_name: The slug name of the query to remove. connections_dir: Unused (kept for API compat).
Inputs: query_name (required), connections_dir. Returns: result
review_data_dictionary_updateARead-only
Preview diff and merged output before replacing a curated data dictionary.
Inputs: curated_path (required), generated_path (required). Returns: result
run_ad_hoc_queryBRead-only
Run a DAX query against a raw connection string.
IMPORTANT: This tool returns a COMPLETE, pre-formatted response for the user. Output the returned string as your ENTIRE response — do NOT summarize, truncate, or convert the table to bullet points. The output includes a data table and a numbered follow-up menu that must both appear.
Inputs: query (required), connection_string (required), profile, max_rows, +2 more. Returns: result
run_connection_queryCRead-only
Run a DAX query against a named connection.
IMPORTANT: This tool returns a COMPLETE, pre-formatted response for the user. Output the returned string as your ENTIRE response — do NOT summarize, truncate, or convert the table to bullet points. The output includes a data table and a numbered follow-up menu that must both appear.
Inputs: query (required), connection_name (required), profile, max_rows, +2 more. Returns: result
run_named_queryBRead-only
Run a pre-configured named query and return a preview.
IMPORTANT: This tool returns a COMPLETE, pre-formatted response for the user. Output the returned string as your ENTIRE response — do NOT summarize, truncate, or convert the table to bullet points. The output includes a data table and a numbered follow-up menu that must both appear.
Inputs: query_name (required), config_dir, preview_rows. Returns: result
save_query_builderA
Save .dax and .dax.queryBuilder artifacts from a structured query builder JSON payload.
STOP — before calling this tool you MUST:
Ask the user: "Where should I save the query files?" and wait for their answer.
Call get_query_builder_schema to see the required JSON shape.
Use the user's answer as queries_dir. If queries_dir is empty this tool will error.
The JSON payload requires these fields:
"name": a slug for the query (e.g. "copilot_acr")
"connection_name": the connection to use
"columns": list of column expressions like "'Calendar'[Fiscal Month]"
"measures": list of {caption, expression} objects
"filters": list of filter definitions
"order_by": list of sort definitions
Inputs: query_builder_json (required), overwrite, queries_dir. Returns: result
save_query_to_packB
Save a DAX query into a durable query pack on disk.
Unlike the session workstation, durable query packs reject duplicate query IDs unless overwrite=True is explicitly provided.
Inputs: query (required), pack_path (required), description (required), connection_name (required), +6 more. Returns: result
save_to_workstationA
Save a DAX query to the session workstation for iterative exploration.
The workstation is ephemeral — it resets when the server restarts (i.e. each new chat session starts fresh). Use export_workstation to persist queries permanently as a scaffold project or .dax files.
Parameters: connection_name: Name of the connection this query targets. query: The DAX query text. description: Human-readable description of what the query does. query_name: Optional slug name; auto-generated from description if blank. connections_dir: Connections directory (unused for storage, kept for API compat).
Inputs: query (required), description (required), connection_name (required), query_name, +1 more. Returns: result
save_validated_queryB
Save a known-good DAX pattern to a connection-scoped validated query library.
This creates two files under <connection_name>.validated_queries/:
a metadata YAML file and a sibling .dax file. Validation metadata is not
marked passed until validate_query_library executes the query successfully.
Inputs: query (required), description (required), connection_name (required), tags, +7 more. Returns: result
scaffold_dax_workspaceB
Scaffold a portable DAX workspace folder with a bare-bones executor script.
Creates: run_query.py, notebook.ipynb, queries/.dax, pyproject.toml, README.
STOP — before calling this tool you MUST:
Ask the user: "Where should I save the Python workspace?" and wait for their answer.
Use their answer as output_dir. Do NOT invent a path.
After scaffolding, explain to the user:
What files were created and what each one does
How to run it:
cd <output_dir> && uv run run_query.pyThat they can copy execute_dax() / dax_to_pandas() from run_query.py into any notebook
To edit CONNECTION in run_query.py if it shows placeholder connection values
Inputs: output_dir (required), query_text (required), query_name, project_name, +2 more. Returns: result
scaffold_power_queryC
Generate Power Query M code for importing DAX query results into Excel.
Returns JSON with the generated M code, table name, and paste instructions.
Inputs: query (required), connection_name (required), table_name, connections_dir. Returns: result
scaffold_streamlit_appA
Generate a Streamlit Python app for visualizing DAX query results.
Creates a standalone .py file that uses Streamlit to execute the embedded DAX query, display results, filter columns, build charts/pivots, download artifacts, and drag/drop CSV or JSON exports for offline exploration.
Parameters: connection_name: Name of the DAX connection (embedded in the generated app). query: The DAX query to embed in the generated app. title: Page title shown in the Streamlit app. output_path: If provided, write the generated code to this file path. connections_dir: Directory containing named DAX connection YAML files.
Inputs: query (required), connection_name (required), title, output_path, +1 more. Returns: result
search_columnsARead-only
Fuzzy-search columns across all tables for a connection.
Searches column names (case-insensitive substring match) and also column descriptions when a data dictionary exists. Returns a JSON array sorted by relevance: exact match > starts-with > contains.
Inputs: search_term (required), connection_name (required), max_results, connections_dir. Returns: result
search_connection_contextARead-only
Search the full connection context markdown for specific terms.
Use this instead of loading the full context when you need to find specific information about tables, columns, filters, or query patterns. Returns matching lines with surrounding context.
Inputs: search_term (required), connection_name (required), max_lines, connections_dir. Returns: result
search_measuresARead-only
Search measures for a connection by name, description, or expression.
Performs a case-insensitive substring match on measure names and, when a data dictionary exists, measure descriptions and DAX expressions. Returns a JSON array sorted by relevance: exact match > starts-with > contains. Expressions are truncated to 100 characters.
Required parameters: connection_name, search_term. Optional parameters: connections_dir, max_results (default 20).
Use this when the user asks "which measure calculates revenue?" or similar discovery questions.
Inputs: search_term (required), connection_name (required), max_results, connections_dir. Returns: result
search_validated_queriesBRead-only
Search saved known-good DAX examples for a connection.
Search matches id, display name, description, tags, grain, and DAX text. Results include DAX by default because this is an explicit retrieval tool.
Inputs: connection_name (required), tags, include_dax, max_results, +2 more. Returns: result
server_infoBRead-only
Return package, runtime, path, template, and follow-up diagnostics.
Inputs: connections_dir. Returns: result
validate_query_libraryB
Execute saved query-library examples and persist validation metadata.
max_rows caps returned rows but does not guarantee a cheap server-side DAX plan; keep validation queries intentionally small and well-filtered.
Inputs: connection_name (required), max_rows, query_id, connections_dir, +1 more. Returns: result
validate_query_packCRead-only
Validate a query pack structurally and optionally smoke-test each query.
Inputs: pack_path (required), dry_run, max_rows, connections_dir, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 50 tools
Several clusters overlap heavily: get_connection_context, get_context_bundle, get_schema, get_data_dictionary, and inspect_connection all return model metadata, and save_to_workstation / save_query_to_pack / save_query_builder / save_validated_query differ mainly by storage plane. The descriptions do give explicit routing guidance ("call get_connection_context FIRST", "prefer X over Y"), which rescues most cases, but legacy entries like list_queries and run_ad_hoc_query add real ambiguity.
Most tools follow a clear verb_noun pattern (get_*, list_*, save_*, run_*, search_*, export_*, scaffold_*, check_*, validate_*). Minor deviations exist, notably quick_chart (adjective_noun) and server_info (noun_noun), but overall the convention is predictable and scannable.
Fifty tools for a DAX query server is a severe mismatch; the surface is bloated with parallel execution paths (run_connection_query, run_named_query, run_ad_hoc_query, copy_to_clipboard, export_to_csv, quick_chart) and four separate persistence mechanisms. Several tools are explicitly labeled backward-compatible helpers, meaning they exist only for legacy reasons rather than earning their place.
Individual workflows are covered end to end (discovery, execution, validation, export, scaffolding), but the lifecycle is inconsistent across storage types: query packs and validated-query libraries have create/save/list but no update or delete, while only the ephemeral workstation supports removal. The result is an uneven surface where agents will hit dead ends depending on which persistence path they chose.
Maintenance
Related MCP Connectors
Governed BI MCP. Ask questions of live company data and list workspace sources via OAuth.
Run SOQL queries against your Salesforce org to explore and retrieve data. Quickly iterate on filt…
Forge designed Power BI projects (.pbip) from your agent, bound to your own semantic model.
Run SOQL queries to explore and retrieve Salesforce data. Inspect records, fields, and relationshi…
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables exploring Microsoft Fabric / Power BI workspaces and semantic models, and executing ad-hoc DAX queries.57MIT
- AlicenseNot gradedqualityDmaintenanceEnables discovery of Power BI workspaces and datasets, retrieval of semantic model definitions (TMDL), and execution of DAX queries through the Power BI and Microsoft Fabric REST APIs, using MSAL/WAM authentication for secure token caching.MIT
- AlicenseAqualityDmaintenanceEnables discovery of Fabric/Power BI workspaces and semantic models, execution of DAX queries, and generation of executive HTML reports with visualizations.11MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying open Power BI Desktop models locally, including discovering instances, listing tables and measures, and running DAX queries without cloud login or publishing.MIT