LabscoMCP early access ↗
bhaumanMCP SERVER · OFFICIAL PROJECT

Clojure MCP

REPL-driven development with an assistant — evaluate Clojure in your running nREPL and edit code as forms, with delimiters repaired before evaluation.

by bhauman ↗Sandboxed Code Execution✓ Official

LABSCO SUMMARY

Parentheses stop being the thing that breaks the edit.

Text-based editing tools fail on Clojure in a specific and repetitive way. Repairing delimiters before evaluation and editing at the level of forms is the fix — and the REPL connection means the change gets tried, not just written.

What it is

An MCP server that connects an LLM client to a Clojure project through nREPL, plus editing tools that understand Clojure's structure instead of treating it as text. Parinfer, cljfmt and clj-rewrite do the work under the hood.

What you get

  • Code evaluation: clojure_eval runs in the current namespace, with an optional port for multi-REPL workflows, and list_nrepl_ports discovers running nREPL servers on the machine
  • Clojure-aware editing: clojure_edit for structure-aware changes to forms including defmethod, and clojure_edit_replace_sexp for modifying expressions inside a function
  • General editing that repairs itself: file_edit runs parinfer repair after the edit when needed, and file_write writes complete files with safety checks
  • Read-only exploration: LS for a recursive tree, read_file with a collapsed view showing only function signatures for large Clojure files, grep and glob_files
  • bash for running tests, git commands and file operations on the host
  • Agent tools that need their own API keys: dispatch_agent launches read-only agents for multi-step exploration, and architect handles technical planning
  • Experimental additions: scratch_pad as a persistent structured workspace, and code_critique for iterative review

Requirements

Clojure and Java — JDK 17 or later. Ripgrep is optional but highly recommended for grep and glob_files performance. Install with clojure -Ttools install-latest :lib io.github.bhauman/clojure-mcp :as mcp, which makes clojure -Tmcp start available from any directory. An nREPL must be running in your project for the evaluation tools to connect to. How much of the toolchain you use depends on your client: with a CLI assistant that already has good file editing and shell tools, keep those and use this mainly for REPL integration and Clojure-aware edits; with a desktop chat app, use the full set. The agent tools require LLM API keys of their own.

Setup effort

One command — clojure -Ttools install-latest :lib io.github.bhauman/clojure-mcp :as mcp