ClojureMCP is an MCP server that gives coding agents a persistent connection to a Clojure REPL. It connects agents to an nREPL running in a project, enabling agents to explore in the REPL like a Clojure programmer, check hypotheses against the running program, and test changes immediately as they modify code.
Key capabilities
- clojure_eval: evaluates code over a persistent nREPL connection and automatically repairs unbalanced delimiters before evaluation; supports Clojure, ClojureScript (shadow-cljs, Figwheel), Babashka, Basilisp, and Scittle.
- list_nrepl_ports: discovers nREPL servers running on the local machine, making it easy for agents to find and switch between multiple REPLs; it can identify shadow-cljs instances and, together with clojure_eval's port parameter, evaluate on any REPL.
- paren_repair: a safety valve for the rare cases of delimiter confusion that are hard to fix through string editing.
Usage The recommended :repl profile exposes only the three REPL tools above and provides no prompts or resources; agents continue to use their own file reading, editing, search, and shell tools. Installation requires JDK 17 or later and an nREPL in the project (which can be started automatically via :start-nrepl-cmd or :fallback-nrepl). After installing globally with the Clojure tools installer, you can run clojure -Tmcp start in any directory. By default it connects to the port in the project's .nrepl-port file; if there is no persistent REPL, add :fallback-nrepl true to let ClojureMCP start one itself, or use :start-nrepl-cmd '["clojure" "-M:nrepl"]' to specify a start command. Configuration values are passed to clojure -Tmcp start as EDN, supporting :port, :host, :project-dir, :config-file, :nrepl-env-type, :config-profile, :enable-tools, :disable-tools, :add-tools, :Options such as remove-tools can also be configured in .clojure-mcp/config.edn in the project root directory.
Use cases Suitable for users who use command-line coding agents such as Claude Code, Codex, and Gemini CLI for Clojure development, especially those who want the agent to verify changes in a real REPL while retaining the host's built-in editing and search tools. The project also supports building custom MCP servers that combine tools, prompts, and resources as needed.
Limitations and current status The project initially provided a complete coding toolset for Claude Desktop, including a structure-aware editor (clojure_edit, clojure_edit_replace_sexp), a streamlined read_file, file and shell tools, subagents, prompts, and resources; these tools are still available but have entered maintenance mode and are on a long-term deprecation path. The legacy edit-oriented profiles :cli-assist, :cli-assist-agent, and :cli-assist-full are still provided with the project and are mainly intended for models that have difficulty editing Clojure. The complete toolset requires ripgrep for better grep and glob_files performance. The project is licensed under the Eclipse Public License 2.0.