MCP ExplorerExplorer

Clj Kondo Mcp

@Bigsyon a year ago
1 MIT
FreeCommunity
AI Systems
A server providing clj-kondo linting for Clojure/EDN files via MCP.

Overview

What is Clj Kondo Mcp

clj-kondo-MCP is a Model Context Protocol (MCP) server that provides linting capabilities for Clojure, ClojureScript, and EDN files. It is particularly useful in environments where built-in linting tools are not available.

Use cases

Use cases include linting individual Clojure files, recursively linting all Clojure files in a directory, and linting files in a classpath for Leiningen or deps.edn projects.

How to use

To use clj-kondo-MCP, you can quickly install it via npm with ‘npx clj-kondo-mcp’. For manual installation, ensure clj-kondo is installed, then install dependencies and build the server. Run the server using ‘node build/index.js’ and utilize the ‘lint_clojure’ tool to lint your files by providing the absolute path to the file or directory.

Key features

Key features include linting Clojure files through MCP tool calls, support for all clj-kondo analysis capabilities, and optional explicit configuration directory support.

Where to use

clj-kondo-MCP can be used in software development environments, particularly for projects written in Clojure, ClojureScript, or EDN, where developers need linting support.

Content

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:

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

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers