Claude Code - bhauman/clojure-mcp GitHub Wiki

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. Set Up a Home for the Clojure MCP Server

See the README for instructions.

2. Configure Your Target Project

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 (for the current project only). Change /path/to/clojure-mcp to the directory where you cloned clojure-mcp in the previous step.

claude mcp add clojure-mcp -- /bin/sh -c 'PORT=$(cat .nrepl-port); cd /path/to/clojure-mcp && clojure -X:mcp :port $PORT'

4. Configure Claude Code

It's recommended to disable Claude Code's built-in tools when using the Clojure MCP server. This is possible using a project config:

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

{
  "permissions": {
    "allow": [],
    "deny": [
      "Agent",
      "Bash",
      "Edit",
      "Glob",
      "Grep",
      "LS",
      "MultiEdit",
      "NotebookEdit",
      "NotebookRead",
      "Read",
      "Task",
      "TodoRead",
      "TodoWrite",
      "WebFetch",
      "WebSearch",
      "Write"
    ]
  }
}

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.