Show HN: Lootbox – CLI that unifies MCP and custom functions for Claude Code (github.com)

🤖 AI Summary
Lootbox is a local-first TypeScript WebSocket RPC server and CLI that lets LLMs (and developers) call your functions by writing TypeScript code instead of using synthetic “tool-calling” tokens. Inspired by Cloudflare’s MCP and "Code Mode" ideas, it auto-discovers exported TS functions, generates a typed client (via ts-morph), and exposes an injected tools object so scripts and LLMs can chain real API calls with full TypeScript types and IntelliSense. That approach leverages the abundance of real-world TS in model training, reduces token/formatting friction, and improves developer ergonomics and composability for complex multi-call workflows. Technically, Lootbox runs on Deno, exposes ws://localhost:8080/ws and a React UI, and ships a CLI (lootbox script.ts or lootbox -e '...') for one-shot executions. RPC functions must be exported, accept 0 or 1 object parameter, and return a value or Promise; types are namespace-prefixed and exposed via /types and generated client.ts. Execution uses persistent Deno worker pools for fast RPC, sandboxed separate processes for user scripts (--allow-net only), a 10s script timeout, OpenAPI docs, file watching, and optional MCP server integration (configured by mcp-servers.json) to run external MCP tools. It’s intended for trusted localhost use (no built-in auth), so production deployments should manage permissions and code trust carefully.
Loading comments...
loading comments...