mcpField
C
Clj Kondo

Clj Kondo

Local
github.com/BigsyDeveloper Tools4Updated 82w ago

About Clj Kondo

Clj Kondo is an MCP server for linting Clojure, ClojureScript, and EDN files with clj-kondo. It lets coding assistants and other MCP clients run lint checks on files, directories, or classpaths.

Key features

  1. 01Lint Clojure, ClojureScript, and EDN
  2. 02Analyze files, directories, or classpaths
  3. 03Use clj-kondo analysis capabilities
  4. 04Set an optional configuration directory

Use cases

  1. 01Lint edited Clojure files from an MCP client
  2. 02Check a source directory recursively
  3. 03Lint files found through a project classpath

MCP support

Exposes a `lint_clojure` tool to MCP clients. The tool accepts a file, directory, or classpath, plus optional configuration directory and severity level.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"clj-kondo-MCP": {
"command": "npx",
"args": [
"-y",
"clj-kondo-mcp"
]
}
}
}
Run commandnpx -y clj-kondo-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmclj-kondo-mcp

Tools

1

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
filestringYesCan be: 1) Absolute path to a file, 2) Directory path (will lint all .clj/.cljs/.cljc files recursively), or 3) Classpath string (obtained via `lein classpath` or `clojure -Spath`)
levelenumNoOptional linting level. By default all lints are errors. Set to "warning" to use warning level instead.warning
configDirstringNoOptional absolute path to .clj-kondo config directory (e.g. /Users/name/project/.clj-kondo). If not provided, clj-kondo will look for .clj-kondo directory in the current and parent directories.

Details

From the project README

clj-kondo MCP Server npm version

A Model Context Protocol (MCP) server that provides clj-kondo linting capabilities for Clojure/ClojureScript/EDN files. Handy for Claude code and desktop where there are no built in linting capabilities. You may want to consider editing your CLAUDE.md asking it to lint after editing.

Features

  • Lint Clojure files via MCP tool calls
  • Supports all clj-kondo analysis capabilities
  • Optional explicit configuration directory support

Installation

Quick Install
npx clj-kondo-mcp

or IDE config

{
  "mcpServers": {
    "clj-kondo": {
      "command": "npx",
      "args": ["clj-kondo-mcp"],
      "disabled": false,
      "autoApprove": []
    }
  }
}
Manual Installation
  1. Install clj-kondo: Make sure you have clj-kondo installed and available on your system PATH. See the installation instructions for your platform.

  2. Install dependencies:

npm install
  1. Build the server:
npm run build

Usage

Running the Server
node build/index.js
MCP Tool Calls

The server provides one tool:

lint_clojure - Lint Clojure/ClojureScript/EDN content

Parameters:

{
  "file": "/absolute/path/to/file.clj", // Must be absolute path - can be a file, directory, or classpath
  "configDir": "/absolute/path/to/config/dir", // Optional, must be absolute path if provided
  "level": "warning" // Optional, defaults to error level
}

The file parameter accepts:

  • A single file path (e.g. "/path/to/src/my_file.clj")
  • A directory path (e.g. "/path/to/src") - will lint all .clj, .cljs and .cljc files recursively
  • A classpath string - will lint all Clojure files in the classpath
    • For Leiningen projects: Use output of lein classpath
    • For deps.edn projects: Use output of clojure -Spath

Note: Both file and configDir parameters must be absolute paths since the MCP server runs as a separate process. Relative paths will not work correctly.

By default, clj-kondo will automatically look for configuration in the .clj-kondo directory in the current and parent directories. You can override this by specifying the configDir parameter to point to a specific configuration directory.

For more information about clj-kondo configuration, see the official documentation.

Configuration

Add to your MCP settings file (for Cline, located at ~/Library/Application Support/Code - Insiders/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "clj-kondo": {
      "command": "npx",
      "args": ["clj-kondo-mcp"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

For manual builds, use:

{
  "mcpServers": {
    "clj-kondo": {
      "command": "node",
      "args": ["build/index.js"],
      "disabled": false,
      "autoApprove": []
    }
  }
}
Build
npm run build
Watch Mode
npm run dev

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.