Skip to main content
Glama

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.

Install

Requires Node.js 20+. In 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.

Related MCP server: Code Review Workflow MCP Server

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:

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.

Use

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:

{
  "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

npm install
npm run build
npm test

See architecture, configuration, security, and contributing.

Available Tools

19 tools
polish_analyze_qualityB

Measure line lengths and approximate bracket nesting for one file. Nesting is a documented lexical heuristic.

Inputs: path (required), lineLength.

polish_check_fileB

Check formatting compliance without modifying the file.

Inputs: path (required).

polish_check_projectA

Check formatting for all recognized project files without writing.

Inputs: root (required), exclude.

polish_detect_languageB

Detect language, confidence, ambiguity, and registered formatter/linter for a file.

Inputs: path (required).

polish_doctorB

Diagnose Node and installed core formatter availability without installing tools.

Inputs: root.

polish_format_changedC

Format tracked files changed relative to Git HEAD and untracked, non-ignored files.

Inputs: root (required), dryRun.

polish_format_fileB

Format one safely detected source file with an installed deterministic formatter. Writes atomically; dryRun returns a preview.

Inputs: path (required), backup, dryRun.

polish_format_filesC

Format a bounded collection of files. Each file is independently detected and safely processed.

Inputs: paths (required), dryRun.

polish_format_projectC

Scan and format a project while skipping generated, hidden, protected and ignored directories. Supports dry run.

Inputs: root (required), dryRun, exclude.

polish_format_textA

Format supplied source text without writing to disk. Requires a representative path extension.

Inputs: path (required), text (required), cwd.

polish_get_diffA

Preview formatting changes for one file without modifying it.

Inputs: path (required).

polish_get_project_rulesC

Report recognized project formatter configuration files and configuration precedence.

Inputs: root (required).

polish_install_formatterB

Explain the authorization requirement for installing formatter executables. This version does not perform package installation.

Inputs: name (required).

polish_lint_fileA

Run the installed language-specific linter for a file. Linting does not format or apply fixes.

Inputs: path (required).

polish_lint_projectB

Report linter coverage for a project. No fixes are applied.

Inputs: root (required).

polish_list_languagesB

List known file mappings and adapters. Availability is checked lazily during operations.

Inputs: no named parameters.

polish_restoreC

List available Polish backups for a file. Restore requires manual selection of a backup path.

Inputs: path (required).

polish_statusB

Return server version and operation mode.

Inputs: no named parameters.

polish_validateC

Check formatting and basic UTF-8 readability for files.

Inputs: paths (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants and developers to analyze code for language-specific best practices and idiomatic patterns across programming languages, CI automation, and configuration formats.
      16
      41 PyPI
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables automated code review by reading code files, checking for style issues like console.log and TODOs, and generating formatted reports.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables local code inspection and analysis for clean code practices, best practices, and actionable recommendations without external API calls or modifying the code.
      50 npm
      1
      MIT