Show HN: Lootbox – CLI that unifies MCP and custom functions for Claude Code

Share This Post

Hey HN! I built a CLI that unifies MCP tools and your custom functions under one code execution interface. Think serverless functions for your coding assistant but on your local machine

Installation is a one-liner curl script (see README)

Instead of configuring your AI with dozens of individual tools, drop a ts file in a directory, and give the LLM one capability: execute TypeScript with lootbox.

  // my-functions/example.ts
  export async function analyzeText(args: { text: string }) {
    return {
      length: args.text.length,
      words: args.text.split(' ').length,
      uppercase: args.text.toUpperCase()
    };
  }

  # Run server with your functions + MCP servers
  lootbox-runtime --rpc-dir ./my-functions --mcp-config mcp.json

  # AI writes code that uses both:
  lootbox -e '
    const file = await tools.mcp_github.read_file({repo: "x/y", path: "README.md"});
    const analysis = await tools.myapp.analyzeText({text: file});
    console.log(analysis);
  '

Your custom TypeScript functions auto-discover alongside your MCP servers and get turned into a fully typed ‘tools’ object that the AI can use.

AI gets full type definitions for everything. Writes code that chains operations together instead of doing sequential tool calls.

LLM scripts are executed in a Deno Sandbox with only net access. RPC files get full access.

Based on Cloudflare’s Code Mode research but completely local.

Check the README for some sample rpc files, a workflow, and a much deeper dive on how it all works.

Typically Claude Code will use

  lootbox --help
  lootbox --namespaces
  lootbox --types kv,sqlite // returns the types from the typed client

And will then start writing a script to orchestrate the tools to accomplish the goal.

Lootbox can also run files so you can tell Claude to save the script as a file and later just run it with

  lootbox path/to/script.ts

Built it after continuing to experiment and play with my original take on Code Mode.

https://github.com/jx-codes/lootbox

Original Take:
https://github.com/jx-codes/codemode-mcp


Comments URL: https://news.ycombinator.com/item?id=45467807

Points: 1

# Comments: 0

Source: github.com

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Do You Want To Boost Your Business?

drop us a line and keep in touch

We are here to help

One of our technicians will be with you shortly.