MCP Hub
Back to servers

JIT Tool Synthesis

Enables on-demand generation of TypeScript tools using an LLM with human-in-the-loop approval and safe sandboxed execution. It allows users to create and persist custom functionality through natural language requests.

Updated
Feb 20, 2026

JIT Tool Synthesis v2

LLM-powered on-demand tool generation with human-in-the-loop approval and safe execution.

Overview

This system generates TypeScript tools dynamically using an LLM, requires human approval before execution, and runs them in a sandboxed environment.

Architecture

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│ Synthesizer │────▶│   Approval   │────▶│  Sandbox    │
│   (LLM)     │     │ (Human Gate) │     │ (Execution) │
└─────────────┘     └──────────────┘     └─────────────┘
       │                   │                    │
       ▼                   ▼                    ▼
  Generates TS        Waits for            Runs in
  tool code          human approval       isolated env

Components

FilePurpose
synthesizer.tsGenerates TypeScript code using OpenRouter LLM
approval.tsHuman-in-the-loop gate — requires approval before execution
sandbox.tsSafe execution environment for generated code
registry.tsTool persistence and storage
server.tsMCP server integration

Setup

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Add your OpenRouter API key to .env
OPENROUTER_API_KEY=your_key_here

Usage

Start the MCP Server

npm run dev

Claude Desktop Integration

Import the config:

# Copy Claude Desktop config
cat claude-desktop-config.json

Add the JSON to your Claude Desktop settings under mcpServers.

CLI Commands

# Generate and approve a tool
npm run cli -- synthesize "Create a weather tool that fetches from wttr.in"

# List available tools
npm run cli -- list

# Execute a tool
npm run cli -- execute <tool-id>

Workflow

  1. Request — User asks for a tool (e.g., "create a weather fetcher")
  2. Synthesize — LLM generates TypeScript code
  3. Approve — Human reviews and approves the code
  4. Execute — Tool runs in sandboxed environment
  5. Store — Approved tools persist in registry

Environment Variables

VariableDescription
OPENROUTER_API_KEYAPI key for LLM tool generation
PORTServer port (default: 3000)

Status

In Progress — MVP complete, end-to-end testing in progress.

Reviews

No reviews yet

Sign in to write a review