Basilisp nREPL

by cat-state

1 stars
140 downloads
Not rated
GitHub

About

Bridges Anthropic's Model Control Protocol with Basilisp's nREPL server, enabling direct execution of Basilisp code, documentation retrieval, namespace exploration, and Python interoperability.

Details

Author
cat-state
Repository
cat-state/nrepl-mcp
GitHub stars
1
Downloads
140
Categories
AI, Workplace, Developer Tools, File Management, Knowledge Base, Infrastructure
Tags
#integration

- 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

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Basilisp nREPL
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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

eval_code

Evaluate Basilisp code. Parameters: code (string)

get_docs

Get documentation for a symbol. Parameters: symbol (string)

find_namespace_vars

List variables in a namespace. Parameters: namespace (string)

list_namespaces

List all available namespaces.

check_connection

Verify nREPL connectivity.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "basilisp nrepl": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

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

- uv - basilisp

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

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.