Get the FREE Ultimate OpenClaw Setup Guide →

babashka

A Model Context Protocol server for interacting with Babashka, a native Clojure interpreter for scripting

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bmorphism-babashka-mcp-server node build/server.js

How to use

This MCP server exposes Babashka scripting capabilities via the MCP protocol, allowing clients to execute Babashka code, cache results, and access a history of commands. It leverages Babashka as the scripting runtime and provides a simple execute tool that accepts code strings and optional timeouts. Clients can submit code snippets to be evaluated by Babashka, and the server returns results, with recent results accessible through a lightweight URI scheme (babashka://commands/{index}). The system is designed to be configurable through environment variables, notably the BABASHKA_PATH, to locate the Babashka runtime on the host machine.

How to install

Prerequisites:

  • Node.js (LTS) installed on your system
  • npm or PNPM for package management

Installation steps:

  1. Clone or download the repository

  2. Install dependencies npm install

  3. Build the MCP server npm run build

  4. Run the server (example) npm start

If you need to customize the Babashka path, set BABASHKA_PATH in your environment before starting the server, e.g.: export BABASHKA_PATH=/path/to/babashka npm start

Additional notes

Tips:

  • Ensure Babashka is installed and accessible at the path specified by BABASHKA_PATH; the default is typically 'bb'.
  • The server caches recent results; if you run many queries, monitor cache size and eviction behavior as needed.
  • Timeouts for execute calls can be customized via the timeout field in the execute tool payload (default 30000 ms).
  • If you upgrade Babashka or switch environments, verify that BABASHKA_PATH points to a compatible binary (Babashka version compatibility may affect syntax support).
  • The babashka://commands/{index} resource path allows you to fetch specific command results by index for reuse or inspection.

Related MCP Servers

Sponsor this space

Reach thousands of developers