nREPL MCP Server

eval_form

Evaluate Clojure code in a specified or current namespace using the nREPL MCP Server. Supports code execution, namespace switching, file loading, and function definition, ideal for dynamic Clojure development and testing.

Instructions

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"})

Input Schema

NameRequiredDescriptionDefault
codeYesClojure code to evaluate
nsNoOptional namespace to evaluate in. Changes persist for subsequent evaluations.

Input Schema (JSON Schema)

{ "properties": { "code": { "description": "Clojure code to evaluate", "type": "string" }, "ns": { "description": "Optional namespace to evaluate in. Changes persist for subsequent evaluations.", "type": "string" } }, "required": [ "code" ], "type": "object" }

You must be authenticated.

Other Tools from nREPL MCP Server

Related Tools

ID: st66euqse7