nREPL MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
nREPL Connection StatusReturns the current nREPL connection status including port and session information
Project NamespacesReturns a list of all namespaces in the current project

Tools

Functions exposed to the LLM to take actions

NameDescription
connect

Connect to an nREPL server. Example: (connect {:host "localhost" :port 1234})

eval_form

Evaluate Clojure code in a specific namespace or the current one. Examples:

  • Get current namespace: (eval_form {:code "(str ns)"})
  • Change namespace: (eval_form {:code "(+ 1 2)" :ns "my.namespace"})
  • Load a file: (eval_form {:code "(load-file "src/my_file.clj")"})
  • Define and call functions: (eval_form {:code "(defn add [a b] (+ a b))" :ns "math"} then (eval_form {:code "(add 1 2)" :ns "math"})
get_ns_vars

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