🌐 English | 한국어
xaml-styler-mcp is a .NET global tool that exposes XamlStyler through a stdio MCP server. Local coding agents can call it to format XAML strings, format XAML files, or check whether a file would change.
- Format XAML through MCP tools from Codex, Claude Code, GitHub Copilot CLI, Gemini CLI, OpenCode, or any provider that supports stdio MCP servers.
- Register or remove the server with supported provider CLIs using
mcp-install,mcp-remove, ormcp-uninstall. - Edit arbitrary
mcp.jsonfiles directly for providers that do not have a built-in installer command. - Reuse
Settings.XamlStylerconfiguration files and automatically discover them from file paths. - Preserve file encoding when formatting files on disk.
dotnet tool install --global xaml-styler-mcpUpdate an existing install:
dotnet tool update --global xaml-styler-mcpUse a supported provider CLI:
xaml-styler-mcp mcp-install --provider codex
xaml-styler-mcp mcp-install --provider claude
xaml-styler-mcp mcp-install --provider copilot
xaml-styler-mcp mcp-install --provider gemini
xaml-styler-mcp mcp-install --provider opencode
xaml-styler-mcp mcp-install --provider allRemove the registration:
xaml-styler-mcp mcp-remove --provider codex
xaml-styler-mcp mcp-uninstall --provider claude
xaml-styler-mcp mcp-remove --provider allThe default MCP server name is xaml-styler. Override it when needed:
xaml-styler-mcp mcp-install --provider codex --name xaml-stylerThe opencode provider edits ~/.config/opencode/opencode.json directly instead of using a CLI command.
For other providers, pass the target MCP config file directly:
xaml-styler-mcp mcp-install --config "C:\path\to\mcp.json"This adds:
{
"mcpServers": {
"xaml-styler": {
"command": "xaml-styler-mcp",
"args": []
}
}
}The config editor accepts JSON comments and trailing commas when reading. It writes standard formatted JSON and creates a .bak file before modifying an existing config.
format_xaml: Formats a XAML string and returns the formatted content.format_xaml_file: Formats a.xamlor.axamlfile and writes changes by default.format_xaml_directory: Formats.xamland.axamlfiles in a directory. Setrecursiveto include subdirectories, excludingbinandobjfolders.check_xaml_file: Checks whether a.xamlor.axamlfile would change.check_xaml_directory: Checks whether.xamland.axamlfiles in a directory would change. Setrecursiveto include subdirectories, excludingbinandobjfolders.
Each tool accepts an optional configPath pointing to a XamlStyler settings file. File-based tools search parent directories for Settings.XamlStyler when configPath is omitted.
Running without arguments starts the stdio MCP server:
xaml-styler-mcpShow CLI help:
xaml-styler-mcp help
xaml-styler-mcp --helpdotnet restore
dotnet build
dotnet test
dotnet packxaml-styler-mcp is licensed under the MIT License.
XAML formatting is powered by XamlStyler, licensed under Apache-2.0. See THIRD-PARTY-NOTICES.md and licenses/XamlStyler-Apache-2.0.txt.
Created by Howon Lee (airtaxi).
Built with help from OpenAI Codex.