|
| 1 | +# @sqlbi/daxformatter-mcp |
| 2 | + |
| 3 | +A [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that formats and |
| 4 | +validates DAX from any MCP-enabled AI client — Claude Code, |
| 5 | +Claude Desktop, Cursor, VS Code, and others — using the SQLBI DAX Formatter service. |
| 6 | + |
| 7 | +Requires [Node.js](https://nodejs.org) 18+. |
| 8 | + |
| 9 | +## Add it to your client |
| 10 | + |
| 11 | +**Claude Code** (CLI): |
| 12 | + |
| 13 | +```bash |
| 14 | +claude mcp add daxformatter -- npx -y @sqlbi/daxformatter-mcp |
| 15 | +``` |
| 16 | + |
| 17 | +**Other clients** — add this to the client's MCP configuration (e.g. `.mcp.json`, |
| 18 | +`claude_desktop_config.json`): |
| 19 | + |
| 20 | +```json |
| 21 | +{ |
| 22 | + "mcpServers": { |
| 23 | + "daxformatter": { |
| 24 | + "command": "npx", |
| 25 | + "args": ["-y", "@sqlbi/daxformatter-mcp"] |
| 26 | + } |
| 27 | + } |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +No separate install step: `npx` downloads and runs the server on demand. |
| 32 | + |
| 33 | +## What it does |
| 34 | + |
| 35 | +The server exposes a single tool, **`format_dax`** — just ask your assistant to format or check |
| 36 | +some DAX and it will use it: |
| 37 | + |
| 38 | +- Formats one or more DAX expressions in a single call. |
| 39 | +- Reports syntax errors with their line and column, so the same call both **formats** and |
| 40 | + **validates** (an expression that can't be parsed comes back unformatted, with the errors). |
| 41 | +- Optional formatting controls: line style, spacing, and the list/decimal separators. |
| 42 | + |
| 43 | +## Privacy |
| 44 | + |
| 45 | +Your DAX is sent to the DAX Formatter web service (`daxformatter.com`), where the formatting |
| 46 | +happens. If you provide server or database names, they are **SHA-256 hashed** before being sent — |
| 47 | +they never leave your machine in clear text. |
| 48 | + |
| 49 | +## License |
| 50 | + |
| 51 | +[MIT](https://github.com/sql-bi/DaxFormatter/blob/master/LICENSE.md) |
0 commit comments