Clojure nREPL Integration
STDIOMCP server for interacting with Clojure nREPL instance, enabling code evaluation and namespace inspection.
MCP server for interacting with Clojure nREPL instance, enabling code evaluation and namespace inspection.
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.
tools.namespace
.To use this server with CLine or Claude Desktop, follow these steps:
{ "mcpServers": { "nrepl-mcp-server": { "command": "npx", "args": [ "nrepl-mcp-server" ], "disabled": false, "autoApprove": [] } } }
This will allow the client to communicate with the nREPL MCP server via standard input/output.
npx
To quickly run the server without cloning the repository:
npx nrepl-mcp-server
Clone the repository
Install dependencies
npm install
Build the project (transpiles TypeScript to JavaScript)
npm run build
Run the server
npm start
npm run dev
This starts the server, listening on STDIO for MCP requests. Mcp client will start the server for you.
Allows establishing a connection to an nREPL server by specifying a host and port.
Executes arbitrary Clojure expressions in either the default namespace or a specified namespace.
Lists all namespaces in the current project directory using tools.namespace
.
Fetches metadata and current values for all public vars in a specified namespace.
Provides details on the current nREPL connection, including host, port, session ID, and last error (if any).
nrepl://status
Provides information about the current nREPL connection, including:
nrepl://namespaces
Lists all namespaces detected in the project directory.
Contributions are welcome! If you have feature suggestions or bug reports, please open an issue or pull request.
This project is licensed under the MIT License. Feel free to modify and distribute according to its terms.