MCP ExplorerExplorer

Nrepl Mcp

@cat-stateon 9 months ago
1 MIT
FreeCommunity
AI Systems
simple MCP server for nREPL

Overview

What is Nrepl Mcp

nrepl-mcp is a simple MCP server that acts as a bridge between Anthropic’s Model Control Protocol (MCP) and the Basilisp nREPL server, enabling direct interaction with the Basilisp REPL.

Use cases

Use cases for nrepl-mcp include evaluating Basilisp code, accessing Python libraries from Lisp, managing namespaces for better code organization, and enhancing error handling in interactive coding sessions.

How to use

To use nrepl-mcp, start a Basilisp nREPL server, add the MCP bridge to Claude Code, and then connect with Claude to utilize various tools for code evaluation, documentation retrieval, and namespace management.

Key features

Key features include executing code with syntax highlighting, retrieving documentation for symbols, listing available namespaces, finding variables in a namespace, checking server connectivity, and enhanced error reporting.

Where to use

nrepl-mcp is primarily used in programming environments where integration between Python and Lisp is required, particularly in data science, AI development, and educational settings.

Content

Basilisp nREPL MCP Bridge

This project provides a bridge between Anthropic’s Model Control Protocol (MCP) and Basilisp’s nREPL server, allowing Claude Code to interact directly with a Basilisp REPL.
Actually, it should work with any nREPL, but the current prompts are Basilisp focused.

Features

  • Execute code and receive pretty-printed, syntax-highlighted results
  • Get documentation for symbols
  • List all available namespaces
  • Find all variables in a namespace
  • Check nREPL server connectivity
  • Basilisp: Python interop with proper syntax for attribute access and method calls
  • Enhanced error reporting and formatting

Requirements

Usage

  1. Start a Basilisp nREPL server:

    basilisp nrepl-server --port 36915
    
  2. Add the MCP bridge to Claude Code:

    claude mcp add /home/a/subjective/snr/basilisp_mcp_bridge.py
    
  3. Connect with Claude and use the available tools:

    • eval_code(code) - Evaluate Basilisp code
    • get_docs(symbol) - Get documentation for a symbol
    • find_namespace_vars(namespace) - List variables in a namespace
    • list_namespaces() - List all available namespaces
    • check_connection() - Verify nREPL connectivity

Python Interop Examples

;; Import a module
(import [math :as math])

;; Access an attribute
(. math -pi)  ;; or (.-pi math)

;; Call a method
(.sin math 0)

;; Create Python data structures
#py{"key" "value"}

Future Improvements

  • Implement a proper bencode parser (beyond regex)
  • Add session management for multiple REPLs
  • Add auto-completion support

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers