Basilisp nREPL MCP Bridge logo

Basilisp nREPL MCP Bridge

by cat-state

This project bridges Anthropic's Model Control Protocol (MCP) with Basilisp's nREPL server, enabling Claude Code to interact with a Basilisp REPL. It allows Claude to execute code and receive results directly from the REPL.

View on GitHub

Last updated: N/A

What is Basilisp nREPL MCP Bridge?

The Basilisp nREPL MCP Bridge allows Claude Code to interact with a Basilisp REPL through Anthropic's Model Control Protocol (MCP). It provides a set of tools for executing code, retrieving documentation, and managing namespaces within the REPL environment.

How to use Basilisp nREPL MCP Bridge?

  1. Start a Basilisp nREPL server. 2. Add the MCP bridge to Claude Code using claude mcp add. 3. Connect with Claude and use the available tools like eval_code(code), get_docs(symbol), etc.

Key features of Basilisp nREPL MCP Bridge

  • Execute code and receive pretty-printed results

  • Get documentation for symbols

  • List available namespaces

  • Find variables in a namespace

  • Check nREPL server connectivity

  • Basilisp: Python interop with proper syntax

Use cases of Basilisp nREPL MCP Bridge

  • Interactively debugging Basilisp code with Claude

  • Exploring Basilisp libraries and APIs using Claude

  • Automating Basilisp code execution through Claude

  • Using Claude to generate and test Basilisp code

  • Integrating Basilisp with other systems via Claude

FAQ from Basilisp nREPL MCP Bridge

Does this work with nREPL servers other than Basilisp?

While the prompts are currently Basilisp focused, it should theoretically work with any nREPL server.

What are the requirements for using this bridge?

You need uv and basilisp installed.

How do I import a Python module in Basilisp using this bridge?

Use the (import [module :as alias]) syntax, e.g., (import [math :as math]).

How do I access a Python attribute?

Use the (. object attribute) or (.-attribute object) syntax.

How do I call a Python method?

Use the (. object method arg1 arg2 ...) syntax, e.g., (.sin math 0).