MCP server and CLI tool for normalizing whitespace — convert tabs to spaces or spaces to tabs.
go build -o notab && codesign -s - notab
cp notab /usr/local/bin/Default mode — communicates over stdin/stdout using JSON-RPC (MCP protocol).
notabAdd to Claude Code:
claude mcp add --transport stdio notab -- notab| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file |
string | yes | Absolute path to the file to normalize | |
spaces |
integer | no | 4 | Number of spaces per tab |
tabs |
boolean | no | false | Inverse mode: convert leading spaces to tabs |
# Tabs to spaces (default)
notab --cli --file /path/to/file.go
# Custom spacing
notab --cli --file /path/to/file.py --spaces 2
# Spaces to tabs (for Makefiles, etc.)
notab --cli --file /path/to/Makefile --tabs| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | No changes |
JSON with normalization results:
{
"file": "/path/to/file.go",
"replacements": 12,
"lines_affected": 5,
"direction": "tabs_to_spaces"
}- Tabs to spaces (default): Replaces all tab characters with the configured number of spaces.
- Spaces to tabs (
--tabs/tabs: true): Replaces leading space groups with tabs. Only converts complete groups at the start of lines — inline spaces are preserved.
File permissions are preserved during writes.
MIT