Skip to main content
Glama
Babashka MCP Server
by bmorphism

ババシュカ MCP サーバー

スクリプト用のネイティブ Clojure インタープリターであるBabashkaと対話するためのモデル コンテキスト プロトコル サーバー。

特徴

  • MCPツールを通じてBabashkaコードを実行する

  • 最近のコマンド結果をキャッシュする

  • MCP リソースを通じてコマンド履歴にアクセスする

  • 設定可能なコマンドタイムアウト

Related MCP server: Claude Code Control MCP

前提条件

Babashkaをインストールする

Babashka はいくつかの方法でインストールできます。

macOS

brew install borkdude/brew/babashka

リナックス

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

ウィンドウズ

# Using scoop
scoop install babashka

その他のインストール方法については、公式の Babashka インストール ガイドを参照してください。

インストールの確認

インストール後、Babashka が動作することを確認します。

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

インストール

# Install dependencies
npm install

# Build the MCP server
npm run build

構成

サーバーは環境変数を通じて設定できます:

  • BABASHKA_PATH : Babashka 実行ファイルへのパス (デフォルト: "bb")

ツール

実行する

オプションのタイムアウト付きで Babashka コードを実行します。

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

例:

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

リソース

サーバーは、以下を通じてアクセスできる最近のコマンド実行のキャッシュを保持します。

  • babashka://commands/{index} - インデックスで特定のコマンド結果にアクセスします

ババシュカ語の特徴

末尾呼び出し最適化 (TCO)

Babashkaは、 recur特殊形式による明示的な末尾呼び出し最適化をサポートしていますが、自動TCOは実装していません。例えば、

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

役立つリソース

公式リソース

コミュニティツールとライブラリ

  • pod-babashka-buddy - Babashka 用の暗号化 API

  • bb-clis - 便利な Babashka CLI スクリプトのコレクション

  • bb-scripts - Babashka 用のさまざまなユーティリティ スクリプト

開発ツール

発達

このサーバーは最終的にセルフホスティングとなるように設計されており、Babashka 自体で書き換えられる予定です。現在の TypeScript 実装はリファレンスおよび出発点として機能します。

ロードマップ

  1. セルフホスト実装

    • BabashkaのMCPサーバーを書き換える

    • Babashka のネイティブ機能を活用してパフォーマンスを向上

    • Node.jsへの依存を削除する

    • MCPプロトコルとの完全な互換性を維持

    • 現在のすべての機能をサポートします:

      • コマンド実行

      • リソース管理

      • コマンド履歴

      • タイムアウト処理

  2. 強化された機能

    • Babashkaポッドのサポートを追加

    • ファイル監視機能を実装する

    • REPL統合を追加する

    • 複数の Babashka インスタンスのサポート

  3. パフォーマンスの最適化

    • キャッシュ戦略を実装する

    • リソース使用の最適化

    • 起動時間を短縮

  4. テストとドキュメント

    • 包括的なテストスイート

    • APIドキュメント

    • 使用例

    • パフォーマンスベンチマーク

Available Tools

1 tool
executeC

Execute Babashka (bb) code

Inputs: code (required), timeout.

Tool Schema Changelog

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

Loading tool schema changelog…

    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 recent community issues

    Related MCP Connectors

    Related MCP Servers