The DAX Formatter MCP Server (stdio) is a local Model Context Protocol server, published as the npm package @sqlbi/daxformatter-mcp. Your AI client launches it as a local process (over standard input/output) and uses its single tool, format_dax, to format and validate DAX.
- Package:
@sqlbi/daxformatter-mcpon npm - Transport: stdio (the client spawns the server as a child process)
- Tool:
format_daxformats and validates DAX expressions, reporting syntax errors with line and column information. - Requirements: Node.js 18 or later
- License: MIT
- Source: github.com/sql-bi/DaxFormatter (directory
mcp)
Like the HTTP MCP server, this package does not format DAX locally: it forwards expressions to the DAX Formatter service, so an internet connection is required. Choose this stdio server when your client launches MCP tools as local processes; choose the HTTP server when you prefer a hosted endpoint with nothing to install.
The server runs locally on your machine: no install step, no account, no API key, no login. Find your app below, follow the short steps, and afterwards just ask your assistant to “format this DAX”. There is nothing to install ahead of time: the configurations below run the latest version on demand with npx.
Visual Studio Code
Click a badge above: VS Code opens and asks you to confirm. That’s it. Alternatively, add it from the terminal:
code --add-mcp "{\"name\":\"DaxFormatter\",\"type\":\"stdio\",\"command\":\"npx\",\"args\":[\"-y\",\"@sqlbi/daxformatter-mcp\"]}"
Claude (Desktop and Code)
In 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 other 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.
You can also add it from the Claude Code terminal:
# -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 DaxFormatter
Codex (app and CLI)
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.
You can also 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 list
Both 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.tomlat the repo root instead. Codex loads it only for trusted projects and prompts for trust on first use.
Any other 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"]
}
}
}
If your client uses a settings UI instead of a file, configure a stdio server with command npx and arguments -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.
You may want to specify the use of format_dax to avoid the agent trying to format DAX itself.
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.
Related
- MCP Server (HTTP) — the hosted, remote sibling of this server.
- NuGet package
Dax.Formatter— the .NET client for the same service.