{"id":23960852,"url":"https://github.com/bmorphism/babashka-mcp-server","last_synced_at":"2025-04-23T06:11:38.795Z","repository":{"id":271084945,"uuid":"912358777","full_name":"bmorphism/babashka-mcp-server","owner":"bmorphism","description":"A Model Context Protocol server for interacting with Babashka, a native Clojure interpreter for scripting","archived":false,"fork":false,"pushed_at":"2025-01-05T11:09:42.000Z","size":5076,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T13:03:08.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmorphism.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-05T11:02:41.000Z","updated_at":"2025-04-03T14:44:39.000Z","dependencies_parsed_at":"2025-01-05T15:00:28.227Z","dependency_job_id":null,"html_url":"https://github.com/bmorphism/babashka-mcp-server","commit_stats":null,"previous_names":["bmorphism/babashka-mcp-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmorphism%2Fbabashka-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmorphism%2Fbabashka-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmorphism%2Fbabashka-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmorphism%2Fbabashka-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmorphism","download_url":"https://codeload.github.com/bmorphism/babashka-mcp-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250379807,"owners_count":21420841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-06T19:57:06.749Z","updated_at":"2025-04-23T06:11:38.760Z","avatar_url":"https://github.com/bmorphism.png","language":"JavaScript","funding_links":[],"categories":["Code Execution","🌐 Web Development"],"sub_categories":["How to Submit"],"readme":"# Babashka MCP Server\n\nA Model Context Protocol server for interacting with [Babashka](https://github.com/babashka/babashka), a native Clojure interpreter for scripting.\n\n## Features\n\n- Execute Babashka code through MCP tools\n- Cache recent command results\n- Access command history through MCP resources\n- Configurable command timeouts\n\n## Prerequisites\n\n### Install Babashka\n\nBabashka can be installed in several ways:\n\n#### macOS\n```bash\nbrew install borkdude/brew/babashka\n```\n\n#### Linux\n```bash\nbash \u003c \u003c(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)\n```\n\n#### Windows\n```powershell\n# Using scoop\nscoop install babashka\n```\n\nFor other installation methods, see the [official Babashka installation guide](https://github.com/babashka/babashka#installation).\n\n### Verify Installation\n\nAfter installation, verify Babashka works:\n```bash\n# Check version\nbb --version\n\n# Try a simple expression\nbb -e '(+ 1 2 3)'\n\n# Run a script from string\nbb -e '(defn hello [x] (str \"Hello, \" x \"!\")) (hello \"World\")'\n\n# Use -i flag to process lines of input\nls | bb -i '(take 2 *input*)'\n```\n\n## Installation\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the MCP server\nnpm run build\n```\n\n## Configuration\n\nThe server can be configured through environment variables:\n\n- `BABASHKA_PATH`: Path to the Babashka executable (default: \"bb\")\n\n## Tools\n\n### execute\n\nExecute Babashka code with optional timeout:\n\n```typescript\n{\n  name: \"execute\",\n  arguments: {\n    code: string;      // Babashka code to execute\n    timeout?: number;  // Timeout in milliseconds (default: 30000)\n  }\n}\n```\n\nExample:\n```typescript\n{\n  name: \"execute\",\n  arguments: {\n    code: \"(+ 1 2 3)\",\n    timeout: 5000\n  }\n}\n```\n\n## Resources\n\nThe server maintains a cache of recent command executions accessible through:\n\n- `babashka://commands/{index}` - Access specific command results by index\n\n## Babashka Language Features\n\n### Tail Call Optimization (TCO)\n\nBabashka supports explicit tail call optimization through the `recur` special form, but does not implement automatic TCO. For example:\n\n```clojure\n;; This will cause stack overflow\n(defn countdown [n]\n  (if (zero? n)\n    :done\n    (countdown (dec n))))\n\n;; This works with TCO using recur\n(defn countdown [n]\n  (if (zero? n)\n    :done\n    (recur (dec n))))\n```\n\n## Useful Resources\n\n### Official Resources\n- [Babashka GitHub Repository](https://github.com/babashka/babashka) - The main Babashka project\n- [Babashka Book](https://book.babashka.org) - Official documentation\n- [Babashka Examples](https://github.com/babashka/babashka/blob/master/doc/examples.md) - Collection of example scripts\n\n### Community Tools \u0026 Libraries\n- [pod-babashka-buddy](https://github.com/babashka/pod-babashka-buddy) - Cryptographic API for Babashka\n- [bb-clis](https://github.com/cldwalker/bb-clis) - Collection of useful Babashka CLI scripts\n- [bb-scripts](https://github.com/vedang/bb-scripts) - Various utility scripts for Babashka\n\n### Development Tools\n- [setup-babashka](https://github.com/turtlequeue/setup-babashka) - GitHub Actions for installing Babashka\n- [babashka-docker-action](https://github.com/tzafrirben/babashka-docker-action) - Run Babashka scripts in GitHub Actions\n\n## Development\n\nThis 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.\n\n## Roadmap\n\n1. **Self-Hosted Implementation**\n   - Rewrite the MCP server in Babashka\n   - Leverage Babashka's native capabilities for better performance\n   - Remove Node.js dependency\n   - Maintain full compatibility with MCP protocol\n   - Support all current features:\n     - Command execution\n     - Resource management\n     - Command history\n     - Timeout handling\n\n2. **Enhanced Features**\n   - Add support for Babashka pods\n   - Implement file watching capabilities\n   - Add REPL integration\n   - Support for multiple Babashka instances\n\n3. **Performance Optimizations**\n   - Implement caching strategies\n   - Optimize resource usage\n   - Reduce startup time\n\n4. **Testing \u0026 Documentation**\n   - Comprehensive test suite\n   - API documentation\n   - Usage examples\n   - Performance benchmarks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmorphism%2Fbabashka-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmorphism%2Fbabashka-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmorphism%2Fbabashka-mcp-server/lists"}