Skip to main content
Glama
nREPL MCP Server

nREPL MCP Server

by JohanCodinha

nREPL MCP 服务器

专为 MCP 客户端(例如Claude Desktop或 VSCode 中的CLine )设计的模型上下文协议 (MCP)服务器。此服务器与 CLine 配合使用时,可与任何 LLM 配合使用。此服务器支持与正在运行的Clojure nREPL 实例进行交互,从而允许通过 MCP 执行 Clojure 代码评估、检查命名空间以及其他实用程序。


特征

  • 通过指定主机和端口连接到正在运行的 nREPL 服务器。

  • 在给定的命名空间或当前命名空间中评估 Clojure 代码。

  • 使用tools.namespace列出项目命名空间。

  • 检索 nREPL 连接状态,包括主机、端口和会话详细信息。

  • 检查任何 Clojure 命名空间中的公共变量,显示元数据,例如文档字符串和值。


Related MCP server: Claude Code Manager WAN

安装和设置

在 CLine (VSCode) 或 Claude Desktop 中安装

要将此服务器与CLine或Claude Desktop一起使用,请按照以下步骤操作:

  1. 在 VSCode 或Claude Desktop中打开CLine 。

  2. 导航至MCP 设置。

  3. 添加一个新的 MCP 服务器,配置如下:

    {
      "mcpServers": {
        "nrepl-mcp-server": {
          "command": "npx",
          "args": [
            "nrepl-mcp-server"
          ],
          "disabled": false,
          "autoApprove": []
        }
      }
    }
  4. 保存并重新启动客户端以应用更改。

这将允许客户端通过标准输入/输出与 nREPL MCP 服务器通信。

通过npx安装

要快速运行服务器而不克隆存储库:

npx nrepl-mcp-server

手动安装

  1. 克隆存储库

  2. 安装依赖项

    npm install
  3. 构建项目(将 TypeScript 转换为 JavaScript)

    npm run build
  4. 运行服务器

    • 生产模式:从编译输出运行。

      npm start
    • 开发模式:使用 ts-node 进行实时更改。

      npm run dev

这将启动服务器,并在STDIO上监听 MCP 请求。Mcp 客户端将自动启动服务器。


行动

连接到 nREPL

允许通过指定主机和端口建立与 nREPL 服务器的连接。

评估 Clojure 代码

在默认命名空间或指定命名空间中执行任意 Clojure 表达式。

检索命名空间信息

使用tools.namespace列出当前项目目录中的所有命名空间。

检查公共变量

获取指定命名空间中所有公共变量的元数据和当前值。

获取 nREPL 连接状态

提供有关当前 nREPL 连接的详细信息,包括主机、端口、会话 ID 和最后一个错误(如果有)。


资源

nrepl://status

提供有关当前 nREPL 连接的信息,包括:

  • 主机和端口

  • 连接状态

  • 活动会话 ID

nrepl://namespaces

列出在项目目录中检测到的所有命名空间。


贡献

欢迎贡献!如果您有功能建议或错误报告,请提交问题或拉取请求。

执照

本项目遵循MIT 许可证。请根据其条款随意修改和分发。

Available Tools

3 tools
connectB

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

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness2/5

    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

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Delegates coding tasks to the local Claude Code CLI via MCP, offering run, review, and status tools for MCP-compatible agents.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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.
      8
      GPL 3.0