Cover image
Try Now
2025-01-05

Espejo dehttps: //github.com/bmorphism/babashka-mcp-server

3 years

Works with Finder

0

Github Watches

1

Github Forks

0

Github Stars

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/babashka

Linux

bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)

Windows

# Using scoop
scoop install babashka

For 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 build

Configuration

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

Community Tools & Libraries

Development Tools

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

    • Rewrite the MCP server in Babashka
    • Leverage Babashka's native capabilities for better performance
    • Remove Node.js dependency
    • Maintain full compatibility with MCP protocol
    • Support all current features:
      • Command execution
      • Resource management
      • Command history
      • Timeout handling
  2. Enhanced Features

    • Add support for Babashka pods
    • Implement file watching capabilities
    • Add REPL integration
    • Support for multiple Babashka instances
  3. Performance Optimizations

    • Implement caching strategies
    • Optimize resource usage
    • Reduce startup time
  4. Testing & Documentation

    • Comprehensive test suite
    • API documentation
    • Usage examples
    • Performance benchmarks

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Jan Meindl
  • Builds new GPTs

  • XLwebDev.com
  • PR Professional: Guiding You to Get Media Placements and Publicity Quickly and Effectively

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

    Reviews

    3 (1)
    Avatar
    user_YxhzT3U9
    2025-04-16

    As a loyal user of bmorphism_babashka-mcp-server by MCP-Mirror, I highly recommend this robust server application. It simplifies operations and executes with impressive efficiency. Perfect for managing Babashka scripts seamlessly, this tool is an absolute game-changer. Check it out here: https://github.com/MCP-Mirror/bmorphism_babashka-mcp-server.