Skip to main content
Glama
bmorphism
by bmorphism

Servidor MCP de Babashka

Un servidor de protocolo de contexto de modelo para interactuar con Babashka , un intérprete nativo de Clojure para scripts.

Características

  • Ejecutar código Babashka mediante herramientas MCP

  • Almacenar en caché los resultados de comandos recientes

  • Acceda al historial de comandos a través de los recursos de MCP

  • Tiempos de espera de comandos configurables

Related MCP server: Claude Code Control MCP

Prerrequisitos

Instalar Babashka

Babashka se puede instalar de varias maneras:

macOS

brew install borkdude/brew/babashka

Linux

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

Ventanas

# Using scoop
scoop install babashka

Para otros métodos de instalación, consulte la guía de instalación oficial de Babashka .

Verificar la instalación

Después de la instalación, verifique que Babashka funcione:

# 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*)'

Instalación

# Install dependencies
npm install

# Build the MCP server
npm run build

Configuración

El servidor se puede configurar a través de variables de entorno:

  • BABASHKA_PATH : Ruta al ejecutable de Babashka (predeterminado: "bb")

Herramientas

ejecutar

Ejecutar código Babashka con tiempo de espera opcional:

{
  name: "execute",
  arguments: {
    code: string;      // Babashka code to execute
    timeout?: number;  // Timeout in milliseconds (default: 30000)
  }
}

Ejemplo:

{
  name: "execute",
  arguments: {
    code: "(+ 1 2 3)",
    timeout: 5000
  }
}

Recursos

El servidor mantiene un caché de ejecuciones de comandos recientes accesible a través de:

  • babashka://commands/{index} - Acceder a resultados de comandos específicos por índice

Características del idioma babashka

Optimización de llamadas de cola (TCO)

Babashka admite la optimización explícita de llamadas finales mediante la forma especial recur , pero no implementa el TCO automático. Por ejemplo:

;; 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))))

Recursos útiles

Recursos oficiales

Herramientas y bibliotecas comunitarias

Herramientas de desarrollo

Desarrollo

Este servidor está diseñado para ser autoalojado, lo que significa que se reescribirá en Babashka. La implementación actual de TypeScript sirve como referencia y punto de partida.

Hoja de ruta

  1. Implementación autoalojada

    • Reescribir el servidor MCP en Babashka

    • Aproveche las capacidades nativas de Babashka para un mejor rendimiento

    • Eliminar la dependencia de Node.js

    • Mantener la compatibilidad total con el protocolo MCP

    • Admite todas las funciones actuales:

      • Ejecución de comandos

      • Gestión de recursos

      • Historial de comandos

      • Manejo del tiempo de espera

  2. Funciones mejoradas

    • Añadir soporte para cápsulas Babashka

    • Implementar capacidades de vigilancia de archivos

    • Añadir integración REPL

    • Compatibilidad con múltiples instancias de Babashka

  3. Optimizaciones de rendimiento

    • Implementar estrategias de almacenamiento en caché

    • Optimizar el uso de recursos

    • Reducir el tiempo de inicio

  4. Pruebas y documentación

    • Conjunto completo de pruebas

    • Documentación de la API

    • Ejemplos de uso

    • Puntos de referencia de rendimiento

Available Tools

1 tool
executeC

Execute Babashka (bb) code

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesBabashka code to execute
timeoutNoTimeout in milliseconds (default: 30000)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('execute') but doesn't describe key behaviors like execution environment, security implications, error handling, or output format. This is a significant gap for a tool that runs arbitrary code.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of executing code and the lack of annotations and output schema, the description is incomplete. It doesn't address critical aspects like what the execution returns, error conditions, or safety considerations, leaving the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters (code and timeout). The description adds no additional meaning beyond what the schema provides, such as examples of valid Babashka code or timeout implications. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('execute') and resource ('Babashka (bb) code'), making the purpose immediately understandable. It doesn't need sibling differentiation since there are no sibling tools, but it could be slightly more specific about what 'execute' entails (e.g., running code in a Babashka environment).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool, such as typical use cases, prerequisites, or alternatives. With no sibling tools, it doesn't need to distinguish from others, but it lacks any context about appropriate scenarios for executing Babashka code.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedexecute

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'execute' has a clear and distinct purpose for running Babashka code.

Naming Consistency5/5

A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The name 'execute' is straightforward and appropriate for its function.

Tool Count2/5

A single tool is too few for most practical server purposes, as it severely limits functionality and flexibility. While it might suffice for a minimal interface, it feels thin and under-scoped for general use.

Completeness3/5

The tool provides basic execution capability, but there are notable gaps such as no tools for managing scripts, handling dependencies, or providing utilities like linting or debugging. This limits the server's usefulness for broader Babashka workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers