Lisp MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/hanshuebner/lisp-mcp
cd lisp-mcp

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add lisp-mcp -- node "<FULL_PATH_TO_LISP_MCP>/dist/index.js"

Replace <FULL_PATH_TO_LISP_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

An MCP server that gives LLMs the ability to evaluate Common Lisp expressions.

lisp-mcp

An MCP (Model Context Protocol) server that gives LLMs the ability to evaluate Common Lisp expressions. It provides up to three tools depending on configuration:

  • eval_host_cl -- always available; evaluates expressions in the MCP server's own SBCL process
  • eval_swank -- connects to a running Lisp via the Swank protocol (the backend used by SLIME and Sly)
  • eval_genera -- bridges to a Symbolics Genera machine over TCP

Prerequisites

  • SBCL on the host machine
  • Quicklisp installed in SBCL (the MCP server loads usocket and yason via Quicklisp)

MCP configuration

Add the following to your .mcp.json (or the MCP configuration of your client):

{
    "mcpServers": {
        "lisp": {
            "command": "/path/to/lisp-mcp.sh",
            "env": {
                "SWANK_PORT": "4005",
                "GENERA_HOST": "192.168.11.2"
            }
        }
    }
}

Only command is required. The environment variables enable the optional tools.

Tools

eval_host_cl

Evaluate a Common Lisp expression in the MCP server's own SBCL process. Always available, no configuration needed. Stdout, stderr, and the return value are captured and returned.

eval_swank

Evaluate a Common Lisp expression on a running Lisp that has a Swank server. This is the most useful tool for development -- it lets the LLM interact with your live Lisp image, load systems, inspect state, and run tests.

The Swank client implements the Swank wire protocol, handles debugger entry by automatically invoking the *ABORT restart and returning the error description, and responds to interactive prompts (e.g. y-or-n-p during compilation).

Start a Swank server in your target Lisp:

(swank:create-server :port 4005 :dont-close t)

The :dont-close t argument keeps the server listening after the first connection disconnects, so the MCP server can reconnect between requests.

To have Swank automatically start an additional server on a fixed port whenever you launch SLIME from Emacs with M-x slime, add the following to your Emacs configuration:

(add-hook 'slime-connected-hook
          (lambda ()
            (slime-eval-async '(swank:create-server :port 4005 :dont-close t))))

Then set SWANK_PORT in the MCP configuration to enable the tool.

Variable Default Description
SWANK_PORT (unset) TCP port of the Swank server. When set, enables eval_swank.
SWANK_HOST 127.0.0.1 Hostname or IP of the Swank server
SWANK_PACKAGE COMMON-LISP-USER Package in which expressions are evaluated

eval_genera

Evaluate a Lisp expression on a Symbolics Genera machine. Requires eval-server.lisp running on the Genera side.

Set GENERA_HOST in the MCP configuration to enable the tool.

Variable Default Description
GENERA_HOST (unset) Hostname or IP of the Genera machine. When set, enables eval_genera.
GENERA_PORT 8888 TCP port of the eval server
GENERA_TIMEOUT 300 Timeout in seconds for each evaluation
Setting up the Genera side

Copy eval-server.lisp to the Genera SYS:SITE; directory on the host filesystem:

cp eval-server.lisp /opt/symbolics/lib/sys.sct/site/eval-server.lisp

Then load it from the Genera Lisp Listener:

Load File SYS:SITE;eval-server.lisp

The file must be loaded once per boot. It defines a TCP server (:mcp-server) on port 8888 that accepts connections, reads length-prefixed Lisp expressions, evaluates them, and returns the result, stdout, and stderr as length-prefixed fields.

To verify it is running:

echo -n '11 (+ 1 2 3 4)' | nc -w 2 192.168.11.2 8888 | cat -v

Tools (3)

eval_host_clEvaluate a Common Lisp expression in the MCP server's own SBCL process.
eval_swankEvaluate a Common Lisp expression on a running Lisp that has a Swank server.
eval_generaEvaluate a Lisp expression on a Symbolics Genera machine.

Environment Variables

SWANK_PORTTCP port of the Swank server to enable eval_swank
SWANK_HOSTHostname or IP of the Swank server
SWANK_PACKAGEPackage in which expressions are evaluated
GENERA_HOSTHostname or IP of the Genera machine to enable eval_genera
GENERA_PORTTCP port of the eval server on Genera
GENERA_TIMEOUTTimeout in seconds for each evaluation

Configuration

claude_desktop_config.json
{"mcpServers": {"lisp": {"command": "/path/to/lisp-mcp.sh", "env": {"SWANK_PORT": "4005", "GENERA_HOST": "192.168.11.2"}}}}

Try it

Evaluate (+ 1 2 3 4) using the host SBCL process.
Connect to my local Swank server on port 4005 and list all loaded systems.
Run a test expression on the Symbolics Genera machine using the eval_genera tool.
Inspect the current state of the Lisp image by evaluating a variable check via Swank.

Frequently Asked Questions

What are the key features of Lisp MCP?

Evaluates Common Lisp expressions in the local SBCL process.. Connects to live Lisp images via the Swank protocol for development.. Bridges evaluation requests to Symbolics Genera machines over TCP.. Captures stdout, stderr, and return values from Lisp evaluations.. Handles debugger entry and interactive prompts automatically via Swank..

What can I use Lisp MCP for?

Interacting with a live Lisp development environment to inspect state or load systems.. Running automated tests or scripts directly from an LLM interface.. Bridging modern AI capabilities to legacy Symbolics Genera hardware.. Executing quick Lisp snippets without leaving the chat interface..

How do I install Lisp MCP?

Install Lisp MCP by running: /path/to/lisp-mcp.sh

What MCP clients work with Lisp MCP?

Lisp MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Lisp MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare