You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove :parse-nrepl-port option for simpler nREPL auto-start
BREAKING CHANGE: The :parse-nrepl-port configuration option has been removed.
Port parsing is now automatic based on the presence of :port.
Simplifications:
- When :start-nrepl-cmd is used WITHOUT :port, automatically parse from output
- When :start-nrepl-cmd is used WITH :port, use that fixed port
- Eliminates confusing configuration combinations
- Makes the feature more intuitive for users
Migration:
- Remove :parse-nrepl-port from all configurations
- Old: :start-nrepl-cmd [...] :parse-nrepl-port true
- New: :start-nrepl-cmd [...]
Documentation:
- Added Claude Desktop limitations (requires :project-dir)
- Emphasized Claude Code compatibility
- Provided clear examples for different use cases
Copy file name to clipboardExpand all lines: CHANGELOG.md
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,71 @@
1
1
# Changelog
2
2
3
+
## [Unreleased]
4
+
5
+
### Simplified nREPL Auto-Start 🚀
6
+
7
+
**Launching an nREPL server is now incredibly simple!** Just provide `:start-nrepl-cmd` and the MCP server handles everything else - perfect for Claude Code and other CLI-based AI tools.
This feature is especially valuable for **Claude Code** users who want to start coding immediately without managing separate terminal windows:
33
+
34
+
1. Open Claude Code in your Clojure project directory
35
+
2. The nREPL starts automatically when Claude connects
36
+
3. Start coding with full REPL support!
37
+
38
+
You can also configure this in `.clojure-mcp/config.edn`:
39
+
```edn
40
+
{:start-nrepl-cmd ["clojure""-M:nrepl"]}
41
+
```
42
+
43
+
#### Note for Claude Desktop Users
44
+
45
+
**Important**: Claude Desktop does not start MCP servers from your project directory, so `:start-nrepl-cmd` will not work unless you also provide `:project-dir` pointing to your specific project:
46
+
47
+
```bash
48
+
# For Claude Desktop, you must specify the project directory:
-**Removed `:parse-nrepl-port`**: This confusing option has been eliminated. The MCP server now intelligently determines whether to parse the port based on whether `:port` is provided. Simple!
63
+
64
+
### Migration Note
65
+
If you were using `:parse-nrepl-port`, just remove it:
Copy file name to clipboardExpand all lines: CONFIG.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,12 @@ The timestamp tracking system prevents accidental overwrites when files are modi
44
44
45
45
**Important**: This feature requires the MCP server to be launched from your project directory (where your `deps.edn` or `project.clj` is located). The nREPL server will be started in the current working directory. This makes it ideal for use with Claude Code and other command-line LLM clients where you want automatic nREPL startup - you can simply start Claude Code in your project directory and the nREPL will launch automatically.
46
46
47
+
**Note for Claude Desktop users**: Claude Desktop does not start MCP servers from your project directory, so `:start-nrepl-cmd` in your config file will not work by itself. You must also configure the `:project-dir` argument in Claude Desktop's settings to point to your specific project. This limitation does not affect Claude Code or other CLI-based tools that you run from your project directory.
48
+
49
+
**Behavior:**
50
+
- When used without `:port`, the MCP server will automatically parse the port from the command's output
51
+
- When used with `:port`, it will use that fixed port instead of parsing from output
52
+
47
53
**Available values:**
48
54
-`["lein" "repl" ":headless"]` - Start Leiningen REPL in headless mode
49
55
-`["clojure" "-M:nrepl"]` - Start Clojure with nREPL alias
@@ -54,19 +60,6 @@ The timestamp tracking system prevents accidental overwrites when files are modi
54
60
- When you want automatic nREPL server management without separate terminal windows
55
61
- In CI/CD environments where automatic startup is beneficial
56
62
57
-
### `:parse-nrepl-port`
58
-
**Optional** - When `true` and used with `:start-nrepl-cmd`, automatically discovers the nREPL port from the command's stdout output. Defaults to `true` when `:start-nrepl-cmd` is provided. The parser recognizes common nREPL port announcement formats.
59
-
60
-
**Available values:**
61
-
-`true` (default when `:start-nrepl-cmd` is provided) - Parse port from nREPL output
62
-
-`false` - Don't parse port; requires `:port` to be explicitly provided
63
-
64
-
**When to use:**
65
-
-`true` - When the nREPL server announces its port in stdout (most common case)
66
-
-`false` - When using a fixed port configuration or when port is known in advance
67
-
68
-
**Note:** When `:parse-nrepl-port` is `false`, you must provide the `:port` configuration.
69
-
70
63
### `:emacs-notify`
71
64
Boolean flag to enable Emacs integration notifications.
Copy file name to clipboardExpand all lines: README.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -933,7 +933,7 @@ For a quick start: **[Creating Your Own Custom MCP Server](doc/custom-mcp-server
933
933
Using the -X invocation requires EDN values.
934
934
935
935
#### `:port`
936
-
**Optional** - The nREPL server port to connect to. **Required** unless using `:start-nrepl-cmd`with`:parse-nrepl-port`
936
+
**Optional** - The nREPL server port to connect to. When using `:start-nrepl-cmd`without`:port`, the port will be automatically discovered from the command output.
937
937
938
938
`:port 7888`
939
939
@@ -943,16 +943,15 @@ Using the -X invocation requires EDN values.
943
943
`:host "localhost"` or `:host "0.0.0.0"`
944
944
945
945
#### `:start-nrepl-cmd`
946
-
**Optional** - A command to automatically start an nREPL server if one is not already running. Must be specified as a vector of strings. The MCP server will start this process and manage its lifecycle.
946
+
**Optional** - A command to automatically start an nREPL server if one is not already running. Must be specified as a vector of strings. The MCP server will start this process and manage its lifecycle.
947
947
948
-
**Important**: This option requires launching `clojure-mcp` from your project directory (where your `deps.edn` or `project.clj` is located). The nREPL server will be started in the current working directory. This is particularly useful for Claude Code and other command-line LLM clients where you want automatic nREPL startup without manual process management.
948
+
When used without `:port`, the MCP server will automatically parse the port from the command's output. When used with `:port`, it will use that fixed port instead.
949
949
950
-
`:start-nrepl-cmd ["lein" "repl" ":headless"]` or `:start-nrepl-cmd ["clojure" "-M:nrepl"]`
950
+
**Important**: This option requires launching `clojure-mcp` from your project directory (where your `deps.edn` or `project.clj` is located). The nREPL server will be started in the current working directory. This is particularly useful for Claude Code and other command-line LLM clients where you want automatic nREPL startup without manual process management.
951
951
952
-
#### `:parse-nrepl-port`
953
-
**Optional** - When `true` and used with `:start-nrepl-cmd`, automatically discovers the nREPL port from the command's stdout output. Defaults to `false`. The parser recognizes common nREPL port announcement formats.
952
+
**Note for Claude Desktop users**: Claude Desktop does not start MCP servers from your project directory, so `:start-nrepl-cmd` will not work unless you also provide `:project-dir` as a command line argument pointing to your specific project. For example: `:project-dir '"/path/to/your/clojure/project"'`. This limitation does not affect Claude Code or other CLI-based tools that you run from your project directory.
954
953
955
-
`:parse-nrepl-port true`
954
+
`:start-nrepl-cmd ["lein" "repl" ":headless"]` or `:start-nrepl-cmd ["clojure" "-M:nrepl"]`
956
955
957
956
#### `:config-file`
958
957
**Optional** - Specify the location of a configuration file. Must be a path to an existing file.
@@ -982,14 +981,17 @@ clojure -X:mcp :port 7888
982
981
983
982
# With automatic nREPL server startup and port discovery
984
983
# Perfect for Claude Code - run this from your project directory
0 commit comments