@sqlbi/daxformatter-mcp
v0.1.4-beta
Published
Model Context Protocol (MCP) server for the DAX Formatter service.
Readme
@sqlbi/daxformatter-mcp
A Model Context Protocol (MCP) server that formats and validates DAX from any MCP-enabled AI client — Claude Code, Claude Desktop, Cursor, VS Code, and others — using the SQLBI DAX Formatter service.
Installation guide
The server runs locally on your machine — no install step, no account, no API key, no login. It exposes a single tool, format_dax. Find your app below and follow the short steps; afterwards, just ask your assistant to "format this DAX".
Visual Studio Code
Click a badge above — VS Code opens and asks you to confirm. That's it.
code --add-mcp "{\"name\":\"DaxFormatter\",\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"@sqlbi/daxformatter-mcp\"]}"Claude
Claude Desktop — add it through the config file:
- Open Settings → Developer → Edit Config to reveal
claude_desktop_config.json. - Inside
mcpServers, add the standardDaxFormatterentry shown in Any MCP client below. - Restart Claude Desktop, then confirm the server appears under Settings → Developer.
The format_dax tool is now available in chat. The same connector is automatically shared with Claude Code, so you set it up once for both.
# -s user enables it in every project; omit -s for the current project only
claude mcp add -s user DaxFormatter -- npx -y @sqlbi/daxformatter-mcp
# check it was added
claude mcp get DaxFormatterCodex
In the Codex app:
- Open Settings → Integrations → MCP servers → Add.
- Choose the command (STDIO) type and give it a name (e.g.
DaxFormatter). - Set the command to
npx, then use Add argument to add the two arguments separately: first-y, then@sqlbi/daxformatter-mcp. - Click Save.
The format_dax tool is now available in your threads. The app and the CLI share the same settings, so this also covers the Codex CLI and IDE extension.
Add it from the terminal:
# add it to the user-level Codex configuration (available in every project)
codex mcp add DaxFormatter -- npx -y @sqlbi/daxformatter-mcp
# check it was added
codex mcp get DaxFormatter
codex mcp listBoth the app and the CLI write the same entry to ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml), which you can also edit by hand:
[mcp_servers.DaxFormatter]
command = "npx"
args = ["-y", "@sqlbi/daxformatter-mcp"]To scope the server to one repository, put the same table in a project-scoped .codex/config.toml at the repo root instead. Codex loads it only for trusted projects and prompts for trust on first use.
Any MCP client
Don't see your app above? Most MCP-aware tools read a standard JSON config. Add this entry to your client's configuration file — or to a .mcp.json at the root of a project to share it with everyone working on that repo:
{
"mcpServers": {
"DaxFormatter": {
"command": "npx",
"args": ["-y", "@sqlbi/daxformatter-mcp"]
}
}
}What it does
The server exposes a single tool, format_dax — just ask your assistant to format or check some DAX and it will use it:
- Formats one or more DAX expressions in a single call.
- Reports syntax errors with their line and column, so the same call both formats and validates (an expression that can't be parsed comes back unformatted, with the errors).
- Optional formatting controls: line style, spacing, and the list/decimal separators.
Privacy
Your DAX is sent to the DAX Formatter web service (daxformatter.com), where the formatting happens. If you provide server or database names, they are SHA-256 hashed before being sent — they never leave your machine in clear text.
