Skip to main content
Glama
README.md
# Polish

Polish is a Codex plugin package with a local-first MCP server and CLI for detecting source files, invoking installed deterministic formatters, and reviewing formatting and basic readability. It never sends source to a network service and never installs formatter tools automatically.

This initial implementation deliberately reports its limits: detection has broad language coverage, while formatter execution only works for the adapters listed below. A linter is never presented as a formatter. See [supported languages](docs/SUPPORTED.md).

## Install

Requires Node.js 20+. In PowerShell:

```powershell
Set-Location C:\Projects\PolishMCP
npm install
npm run build
npm link
polish doctor
```

Run these commands in the project directory. `npm link` modifies the global npm command link and should be run only when you intend to make the CLI globally available. To remove it, run `npm unlink -g polish-mcp`.

## Codex plugin

The repo includes a Codex plugin manifest, a bundled local tool server, and the `polish-code-quality` skill. Install the plugin marketplace from GitHub:

```powershell
codex plugin marketplace add ahmoodiamorii-boop/polish-mcp --ref main
codex plugin marketplace list
```

The plugin bundles its runtime, so plugin users do not need to install npm packages or build the project. Node.js 20 or newer and formatter executables for the languages they use are still required. See [plugin setup](docs/PLUGIN.md).

## Use

```powershell
polish format . --dry-run
polish format src\app.ts --backup
polish check .
polish analyze .
polish languages
polish mcp
```

JSON output is available with `--json`. Formatter binaries must already be installed and available on PATH or in the project's `node_modules/.bin`. Polish uses project-local Prettier, Biome, Ruff, or Black first when found. It does not execute project formatter plugins by installing them.

## MCP client setup

Configure the client manually after reviewing its config format:

```json
{
  "mcpServers": {
    "polish": {
      "command": "node",
      "args": ["C:/path/to/PolishMCP/dist/cli.js", "mcp"]
    }
  }
}
```

This package does not currently modify global agent configuration or instruction files. Do not add the example to a client until `npm run build` has completed and the path is correct.

## Safety model

Polish skips symlinks, binary files, secret-like names, lockfiles, files over 2 MiB, unknown or ambiguous formats, and common generated directories. Formatter calls use argument arrays (no shell), time out, and receive source via stdin when supported. Writes check the file hash again, preserve UTF-8 BOM and CRLF/LF, write a temporary file, and atomically rename it. `--backup` stores an original beside the file in `.polish-backups`. Review `--dry-run` before bulk changes.

## Development

```powershell
npm install
npm run build
npm test
```

See [architecture](docs/ARCHITECTURE.md), [configuration](docs/CONFIGURATION.md), [security](docs/SECURITY.md), and [contributing](CONTRIBUTING.md).

TDQS

C2.9/5.0

Scored across 19 tools

Disambiguation3/5

Most tools have distinct scopes (format vs check vs lint vs project-level variants), but polish_validate overlaps heavily with polish_check_file/polish_check_project since both assess formatting compliance, and polish_get_diff duplicates the preview behavior of polish_format_file's dryRun. These overlaps will cause occasional misselection despite detailed descriptions.

Naming Consistency4/5

Nearly all tools follow a consistent polish_verb_noun snake_case pattern (format_file, check_project, lint_file, get_project_rules). A few outliers break the pattern (validate, doctor, restore, status), but the shared prefix and readable verbs keep it predictable.

Tool Count3/5

19 tools is on the heavy side for a formatting/linting server, landing in the borderline 16-25 range. The surface is broad (format, check, lint, analyze, detect, diff, config, status), but a couple of entries feel like padding.

Completeness3/5

Core formatting, checking, linting, and language detection workflows are well covered, but two tools are explicit stubs: polish_install_formatter performs no installation and polish_restore only lists backups rather than restoring. These dead ends mean agents cannot complete install or restore workflows without manual intervention.