nrepl-mcp-server
The nREPL MCP Server is a Model Context Protocol server that facilitates interaction with a Clojure nREPL instance for evaluating code and inspecting namespaces. It is compatible with MCP clients like Claude Desktop and CLine in VSCode, providing powerful Clojure integration.
nREPL MCP Server
A Model Context Protocol (MCP) server designed for MCP clients such as Claude Desktop or CLine in VSCode. It allows interaction with a running Clojure nREPL instance to evaluate Clojure code, list namespaces, and inspect public vars.
Features
- Connect to an nREPL server by specifying host and port.
- Evaluate Clojure code in the current namespace.
- List project namespaces.
- Retrieve nREPL connection status.
- Inspect public vars in any Clojure namespace.
Installation & Setup
Installing in CLine or Claude Desktop
- Open CLine in VSCode or Claude Desktop.
- Add a new MCP server in MCP Settings.
- Save and restart the client.
Manual Installation
- Clone the repository
- Install dependencies
- Build the project
- Run the server
Actions
Connecting to nREPL
Specify a host and port to connect to an nREPL server.
Evaluating Clojure Code
Execute Clojure expressions in the specified namespace.
Retrieving Namespace Information
List all namespaces in the project directory.
Inspecting Public Vars
Fetch metadata and current values for public vars.
Fetching nREPL Connection Status
Get details on the nREPL connection, including host, port, and session ID.
Resources
nrepl://status
: Provides information about the current connection.nrepl://namespaces
: Lists all namespaces detected in the project directory.