Skip to content
Bruce Hauman edited this page Oct 31, 2025 · 28 revisions

Warning

While you can use these tools alongside Claude Code and other code assistants with their own tooling, we recommend trying the Clojure MCP tools independently first to experience their full capabilities.

See the README for more details.

Setup

1. Configure Your Target Project nREPL server

See the README for instructions

2. Install Clojure MCP Server

See the README for instructions

3. Add the MCP Server to Claude Code

The following command registers the Clojure MCP server with claude so it will connect to the nREPL.

This command needs to be executed in the project directory of the Clojure project you want to work with.

This assumes you have setup clojure-mcp in your ~/.clojure/deps.edn file

claude mcp add --transport stdio clojure-mcp -- clojure -X:mcp :port 7888

You can use whatever port you have setup for your nREPL server.

4. Configure Claude Code

It's recommended to disable some of Claude Code's built-in tools along with some of ClojureMCP's tools so that you get an optimal set of tools for working with Clojure.

Disabling tools is possible using a project config:

/your/project/dir/.claude/settings.json (project configuration)

{
  "permissions": {
    "deny": [
      "Write",
      "Read",
      "Task",
      "Edit",
      "mcp__clojure-mcp__LS",
      "mcp__clojure-mcp__grep",
      "mcp__clojure-mcp__glob_files",
      "mcp__clojure-mcp__bash",
      "mcp__clojure-mcp__think",
      "mcp__clojure-mcp__scratch_pad"
    ]
  }
}

5. Start the nREPL for Your Project

Make sure your project's nREPL server is running before moving to the next step. You should have an nREPL configuration set up after step 2 in the README.

6. Start Claude Code

Run the claude command in your project directory to start Claude Code and run the Clojure MCP server as a subprocess. Since it may take some time to start the MCP server and connect to the project's nREPL, you can check the status with the /mcp command:

> /mcp
  ⎿  MCP Server Status

     • clojure-mcp: connected

Once you see it's connected, you're ready to use Claude Code with the Clojure MCP server.

7. Starting a new conversation

See the corresponding section in the main README for details. Below are Claude Code specific commands to add resources and prompts from within the chat window.

Add resources via @:

  • @PROJECT_SUMMARY.md or @clojure-mcp:custom://project-summary
  • @Clojure Project Info or @clojure-mcp:custom://project-info
  • @LLM_CODE_STYLE.md or @clojure-mcp:custom://llm-code-style
  • @CLAUDE.md or @clojure-mcp:custom://claude

Example:

@PROJECT_SUMMARY.md
  ⎿  Read PROJECT_SUMMARY.md (210 lines)

⏺ I can see you have a comprehensive Clojure project with MCP (Model Context
  Protocol) integration. [...rest removed...]

Add prompts via /:

  • /clojure-mcp:clojure_repl_system_prompt (clojure_repl_system_prompt contains instructions on how to code)
  • Additional commands are available. Start typing / to see all available commands, including those from MCP servers. Commands provided by clojure-mcp are prefixed with /clojure-mcp.

Example:

> /clojure-mcp:clojure_repl_system_prompt

⏺ I'm ready to help you with Clojure development tasks. I have access to REPL
  evaluation, specialized Clojure editing tools, and can assist with REPL-driven
  development workflows.

  What would you like to work on?

8. Add a /initclj slash command to improve initialization

Create a ~/.claude/commands/initclj.md

---
description: Initialize Clojure project context
---
@PROJECT_SUMMARY.md
@clojure-mcp:custom://project-info

You can then restart claude and type /initclj and get a quick context setup.

Clone this wiki locally