babashka-mcp-server
A Model Context Protocol server for interacting with Babashka, a native Clojure interpreter for scripting
Documentation
Babashka MCP Server
A Model Context Protocol server for interacting with Babashka, a native Clojure interpreter for scripting.
Features
- Execute Babashka code through MCP tools
- Cache recent command results
- Access command history through MCP resources
- Configurable command timeouts
Prerequisites
Install Babashka
Babashka can be installed in several ways:
macOS
brew install borkdude/brew/babashkaLinux
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)Windows
# Using scoop
scoop install babashkaFor other installation methods, see the official Babashka installation guide.
Verify Installation
After installation, verify Babashka works:
# Check version
bb --version
# Try a simple expression
bb -e '(+ 1 2 3)'
# Run a script from string
bb -e '(defn hello [x] (str "Hello, " x "!")) (hello "World")'
# Use -i flag to process lines of input
ls | bb -i '(take 2 *input*)'Installation
# Install dependencies
npm install
# Build the MCP server
npm run buildConfiguration
The server can be configured through environment variables:
- `BABASHKA_PATH`: Path to the Babashka executable (default: "bb")
Tools
execute
Execute Babashka code with optional timeout:
{
name: "execute",
arguments: {
code: string; // Babashka code to execute
timeout?: number; // Timeout in milliseconds (default: 30000)
}
}Example:
{
name: "execute",
arguments: {
code: "(+ 1 2 3)",
timeout: 5000
}
}Resources
The server maintains a cache of recent command executions accessible through:
- `babashka://commands/{index}` - Access specific command results by index
Babashka Language Features
Tail Call Optimization (TCO)
Babashka supports explicit tail call optimization through the `recur` special form, but does not implement automatic TCO. For example:
;; This will cause stack overflow
(defn countdown [n]
(if (zero? n)
:done
(countdown (dec n))))
;; This works with TCO using recur
(defn countdown [n]
(if (zero? n)
:done
(recur (dec n))))Useful Resources
Official Resources
- Babashka GitHub Repository - The main Babashka project
- Babashka Book - Official documentation
- Babashka Examples - Collection of example scripts
Community Tools & Libraries
- pod-babashka-buddy - Cryptographic API for Babashka
- bb-clis - Collection of useful Babashka CLI scripts
- bb-scripts - Various utility scripts for Babashka
Development Tools
- setup-babashka - GitHub Actions for installing Babashka
- babashka-docker-action - Run Babashka scripts in GitHub Actions
Development
This server is designed to eventually become self-hosting, meaning it will be rewritten in Babashka itself. The current TypeScript implementation serves as a reference and starting point.
Roadmap
1. Self-Hosted Implementation
2. Enhanced Features
3. Performance Optimizations
4. Testing & Documentation
Frequently asked questions
What is babashka-mcp-server?
babashka-mcp-server is A Model Context Protocol server for interacting with Babashka, a native Clojure interpreter for scripting
How do I install babashka-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is babashka-mcp-server open source?
Yes — it is hosted on GitHub at https://github.com/bmorphism/babashka-mcp-server and has 15 stars.
Related MCP tools
The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.
An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others. Built for the Model Context Protocol to enhance AI capabiliti
Fay是一个帮助数字人(2.5d、3d、移动、pc、网页)或大语言模型(openai兼容、deepseek)连通业务系统的mcp框架。 JavaScript-based implementation. Trusted by 12000+ developers.
CTTF: MCP integration between Cursor and Figma, allowing Cursor Agentic AI to communicate with Figma for reading designs and modifying them programmatically.
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients. JavaScript-based implementation.
This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities JavaScript-based implementation.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP