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.namespace
- Inspect 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
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.
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:
- 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:
Manual Installation
- Clone the repository
- Install dependencies
- Build the project (transpiles TypeScript to JavaScript)
- Run the server
- Production Mode: Runs from compiled output.
- Development Mode: Uses ts-node for live changes.
- Production Mode: Runs from compiled output.
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.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables interaction with a running Clojure nREPL instance for evaluating Clojure code, inspecting namespaces, and retrieving connection statuses, compatible with MCP clients like Claude Desktop and CLine in VSCode.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityMCP Server for the Notion API, enabling Claude to interact with Notion workspaces.Last updated -181,398699TypeScriptMIT License
- -securityAlicense-qualityConnects Reaper projects to an MCP client like Claude Desktop, allowing users to ask questions and retrieve parsed information about the projects using natural language.Last updated -11PythonMIT License
- -securityFlicense-qualityAn MCP server that connects to your Notion knowledge base, allowing you to query and retrieve information directly from VSCode using the Cline extension.Last updated -Python
- -securityAlicense-qualityAn MCP server that provides seamless integration with the Neo N3 blockchain, allowing Claude to interact with blockchain data, manage wallets, transfer assets, and invoke smart contracts.Last updated -223MIT License