nREPL MCP Server
The nREPL MCP Server enables interaction with a running Clojure nREPL instance via the Model Context Protocol (MCP). With this server, you can:
Connect to an nREPL server by specifying host and port
Evaluate arbitrary Clojure expressions in a specific namespace or the current one
List all namespaces in the current project directory using
tools.namespaceInspect public vars in any namespace, including their metadata, docstrings, and values
Manage nREPL sessions for operations like loading files and defining functions
Retrieve connection status details including host, port, session ID, and any errors
Enables interaction with a running Clojure nREPL instance, allowing evaluation of Clojure code, namespace inspection, and retrieving metadata for public vars in Clojure namespaces
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nREPL MCP Server evaluate (+ 1 2 3) in the user namespace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
nREPL MCP Server
A Model Context Protocol (MCP) server designed for MCP clients, such as Claude Desktop or CLine in VSCode. This server can be used with any LLM when used with CLine. This server enables interaction with a running Clojure nREPL instance, allowing evaluation of Clojure code, namespace inspection, and other utilities via MCP.
Features
Connect to a running nREPL server by specifying host and port.
Evaluate Clojure code in a given namespace or the current one.
List project namespaces using
tools.namespace.Retrieve nREPL connection status, including host, port, and session details.
Inspect public vars in any Clojure namespace, displaying metadata such as docstrings and values.
Related MCP server: Claude Code Manager WAN
Installation & Setup
Installing in CLine (VSCode) or Claude Desktop
To use this server with CLine or Claude Desktop, follow these steps:
Open CLine in VSCode or Claude Desktop.
Navigate to the MCP Settings.
Add a new MCP server with the following configuration:
{ "mcpServers": { "nrepl-mcp-server": { "command": "npx", "args": [ "nrepl-mcp-server" ], "disabled": false, "autoApprove": [] } } }Save and restart the client to apply changes.
This will allow the client to communicate with the nREPL MCP server via standard input/output.
Install via npx
To quickly run the server without cloning the repository:
npx nrepl-mcp-serverManual Installation
Clone the repository
Install dependencies
npm installBuild the project (transpiles TypeScript to JavaScript)
npm run buildRun the server
Production Mode: Runs from compiled output.
npm startDevelopment Mode: Uses ts-node for live changes.
npm run dev
This starts the server, listening on STDIO for MCP requests. Mcp client will start the server for you.
Actions
Connecting to nREPL
Allows establishing a connection to an nREPL server by specifying a host and port.
Evaluating Clojure Code
Executes arbitrary Clojure expressions in either the default namespace or a specified namespace.
Retrieving Namespace Information
Lists all namespaces in the current project directory using tools.namespace.
Inspecting Public Vars
Fetches metadata and current values for all public vars in a specified namespace.
Fetching nREPL Connection Status
Provides details on the current nREPL connection, including host, port, session ID, and last error (if any).
Resources
nrepl://status
Provides information about the current nREPL connection, including:
Host and port
Connection status
Active session ID
nrepl://namespaces
Lists all namespaces detected in the project directory.
Contributing
Contributions are welcome! If you have feature suggestions or bug reports, please open an issue or pull request.
License
This project is licensed under the MIT License. Feel free to modify and distribute according to its terms.
Available Tools
3 toolsconnectB
Connect to an nREPL server. Example: (connect {:host "localhost" :port 1234})
Inputs: host (required), port (required).
eval_formA
Evaluate Clojure code in a specific namespace or the current one. Examples:
Define and call a function: {"code": "(defn greet [name] (str "Hello, " name "!"))(greet "World"))"}
Reload code: {"code": "(clj-reload.core/reload)"}
Evaluate in a specific namespace: {"code": "(clojure.repl.deps/sync-deps)", "ns": "user"}
Inputs: code (required), ns.
get_ns_varsB
Get all public vars (functions, values) in a namespace with their metadata and current values. Example:
List main namespace vars: (get_ns_vars {:ns "main"}) Returns a map where keys are var names and values contain:
:meta - Metadata including :doc string, :line number, :file path
:value - Current value of the var
Inputs: ns (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: connect establishes a connection, eval_form evaluates code, and get_ns_vars inspects namespace variables. There is no overlap or ambiguity between these three functions.
The naming follows a consistent snake_case pattern (connect, eval_form, get_ns_vars), with all tools using descriptive verb-noun combinations. The minor deviation is that 'connect' is a single verb while others are compound, but this is reasonable given its action.
With only 3 tools, the set feels thin for an nREPL server, which typically involves more operations like disconnecting, listing sessions, or handling side effects. However, it covers basic connectivity, evaluation, and inspection, which are core functions.
The tool surface has significant gaps for an nREPL server: there is no way to disconnect or manage sessions, handle errors or interrupts, load files, or perform other common REPL operations. This limits agents to basic tasks and may cause failures in more complex workflows.
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceExposes Claude Code's file editing, command execution, and test running capabilities as composable MCP tools for any MCP-compatible host, enabling code operations via a stateless bridge.-
- FlicenseNot gradedqualityCmaintenanceEnables ISLI agents and MCP clients to dispatch natural-language coding and terminal tasks to a locally-installed Claude Code CLI, supporting both one-shot execution and persistent sessions with workspace and security controls.-
- AlicenseNot gradedqualityDmaintenanceDelegates coding tasks to the local Claude Code CLI via MCP, offering run, review, and status tools for MCP-compatible agents.MIT
- AlicenseNot gradedqualityBmaintenanceEnables voice assistants to start, monitor, message, and approve local Claude Code sessions on your computer, including sessions already open in a terminal. It exposes session management, recaps, approvals, and history search as MCP tools.8GPL 3.0