clojure code linting via mcp protocol
Exposes clj-kondo linting capabilities through the Model Context Protocol (MCP), allowing AI models and tools to invoke static analysis on Clojure code without direct subprocess management. Implements MCP server transport layer that wraps clj-kondo's analysis engine, translating linting results into structured JSON responses that conform to MCP resource and tool schemas for seamless integration with Claude, other LLMs, and MCP-compatible clients.
Unique: Bridges clj-kondo (a mature Clojure linter) into the MCP ecosystem, enabling AI models to invoke linting as a first-class tool without subprocess management boilerplate. Uses MCP's resource and tool schemas to expose linting as callable functions rather than requiring models to parse raw CLI output.
vs alternatives: Provides standardized MCP integration for Clojure linting, whereas direct clj-kondo CLI usage requires models to handle subprocess spawning and output parsing, and existing Clojure IDE plugins are editor-specific rather than AI-model-agnostic.
real-time clojure syntax and style validation
Performs on-demand static analysis of Clojure code to detect syntax errors, style violations, and common mistakes using clj-kondo's rule engine. Parses Clojure source text, applies configurable linting rules (unused variables, incorrect function arity, deprecated APIs, etc.), and returns diagnostics with precise line/column positions and severity levels (error, warning, info). Configuration is read from .clj-kondo/config.edn if present, allowing per-project customization.
Unique: Exposes clj-kondo's mature rule engine (covering 100+ linting rules) through MCP, enabling AI models to validate Clojure code with the same rigor as IDE plugins, but in a model-agnostic, protocol-standardized way. Respects project-level .clj-kondo/config.edn for rule customization.
vs alternatives: More comprehensive than regex-based linting and more accessible than requiring IDE integration; clj-kondo itself is the de-facto Clojure linter, so this MCP wrapper provides the industry standard in an AI-friendly format.
mcp tool schema exposure for clojure linting
Registers clj-kondo linting as a callable MCP tool with a defined JSON schema, allowing MCP clients (like Claude) to discover, invoke, and handle linting requests as first-class tool calls. Implements MCP's tools/list and tools/call handlers, translating tool invocation parameters (code text, file paths) into clj-kondo subprocess calls and marshaling results back as structured JSON responses. Enables natural language requests like 'lint this code' to be routed to the linting engine without explicit model prompting.
Unique: Implements MCP's tools/list and tools/call protocol handlers to expose clj-kondo as a discoverable, invokable tool. Uses JSON schema to describe tool parameters, enabling clients to understand and invoke linting without hardcoded knowledge of clj-kondo's CLI interface.
vs alternatives: Standardizes linting as an MCP tool, making it discoverable and callable by any MCP client; direct clj-kondo CLI usage requires models to know the exact invocation syntax, whereas MCP schema-based discovery is self-documenting and client-agnostic.
configurable linting rule application
Respects project-level .clj-kondo/config.edn configuration files to customize which linting rules are enabled, disabled, or configured with specific parameters. Reads configuration from the project directory, merges it with clj-kondo's defaults, and applies the resulting rule set during analysis. Supports rule-level configuration such as severity overrides, exclusion patterns, and rule-specific options (e.g., max function arity warnings).
Unique: Leverages clj-kondo's native configuration system (.clj-kondo/config.edn) to allow per-project rule customization without modifying the MCP server. Configuration is read at linting time, enabling teams to enforce project-specific standards.
vs alternatives: Provides configuration flexibility comparable to IDE-based linting, whereas hardcoded linting rules would require server code changes to customize; respects the Clojure ecosystem's standard configuration format.
batch file and directory linting
Accepts file paths or directory paths as input and performs linting on multiple Clojure files in a single MCP call. Recursively traverses directories, identifies .clj, .cljs, and .cljc files, and returns aggregated diagnostics for all files with file-level grouping. Enables efficient bulk analysis of codebases without requiring separate tool calls per file.
Unique: Wraps clj-kondo's batch analysis capability in MCP, allowing single tool calls to lint entire directories. Aggregates results with file-level grouping, enabling efficient codebase-wide analysis without per-file MCP overhead.
vs alternatives: More efficient than invoking linting separately for each file; provides codebase-wide analysis in a single MCP call, reducing latency and simplifying client logic compared to manual file enumeration and sequential linting.
structured diagnostic output with severity levels
Returns linting results as structured JSON with detailed diagnostic objects including file path, line number, column number, rule name, message, and severity level (error, warning, info). Each diagnostic is a discrete object with all metadata needed for programmatic handling, enabling clients to filter, sort, or aggregate violations by severity, rule type, or file. Severity levels align with LSP (Language Server Protocol) conventions for compatibility with IDE tooling.
Unique: Exposes clj-kondo's diagnostic output as structured JSON with LSP-compatible severity levels, enabling programmatic filtering and aggregation. Each diagnostic includes full metadata (file, line, column, rule name, message) for rich client-side handling.
vs alternatives: More structured than raw CLI output; JSON format enables easy parsing and filtering, whereas plain-text linting output requires regex parsing and is fragile to format changes.