JIT Tool Synthesis
JIT 工具合成 v4
基于 LLM 的按需工具生成系统,具备人工审核机制和安全执行环境。
概述
本系统利用 LLM 动态生成 TypeScript 工具,在执行前需要人工批准,并运行在沙箱环境中。
Related MCP server: Code Mode MCP Server
架构
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Synthesizer │────▶│ Approval │────▶│ Sandbox │
│ (LLM) │ │ (Human Gate) │ │ (Execution) │
└─────────────┘ └──────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
Generates TS Waits for Runs in
tool code human approval isolated env组件
文件 | 用途 |
| 使用任何兼容 OpenAI 的 LLM 生成工具代码 |
| 人工审核门控 — 执行前必须获得批准 |
| 生成代码的安全执行环境 |
| 工具持久化与存储 |
| MCP 服务器集成 |
| 运行时配置管理 |
提供商无关性
本工具适用于任何兼容 OpenAI 的 LLM API:
OpenRouter — 100+ 模型 (Claude, GPT, Llama 等)
OpenAI — GPT-4o, o3 等
Ollama — 本地模型 (Llama, Qwen 等)
LM Studio — 带 GUI 的本地模型
Groq — 快速推理
任何其他兼容 OpenAI 的 API
设置
# Install dependencies
npm install
# Copy environment template
cp .env.example .env配置您的 LLM 提供商
编辑 .env 文件并填入您的提供商详情:
# Option 1: OpenRouter (default - 100+ models)
LLM_API_KEY=your-openrouter-key
LLM_BASE_URL=https://openrouter.ai/api/v1
LLM_MODEL=anthropic/claude-sonnet-4-6
# Option 2: OpenAI direct
LLM_API_KEY=sk-...
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL=gpt-5.4
# Option 3: Ollama (local)
LLM_BASE_URL=http://localhost:11434/v1
LLM_MODEL=llama-3.3
# Option 4: Groq
LLM_API_KEY=gsk_...
LLM_BASE_URL=https://api.groq.com/openai/v1
LLM_MODEL=llama-3.3-70b-versatile使用方法
构建
npm run build使用 MCP Inspector 测试
验证一切是否正常的快捷方式:
npx @modelcontextprotocol/inspector node dist/server.js连接到 MCP 客户端
本服务器适用于任何 MCP 客户端。配置示例:
Claude Desktop — 添加到您的 Claude Desktop MCP 设置中:
{
"mcpServers": {
"jit-tool-synthesis": {
"command": "node",
"args": ["/absolute/path/to/jit-tool-synthesis/dist/server.js"],
"env": {
"LLM_API_KEY": "your-api-key",
"LLM_BASE_URL": "https://openrouter.ai/api/v1",
"LLM_MODEL": "anthropic/claude-sonnet-4-6"
}
}
}
}Claude Code:
claude mcp add jit-tools node /absolute/path/to/jit-tool-synthesis/dist/server.jsVS Code (Copilot):
code --add-mcp '{"name":"jit-tools","type":"stdio","command":"node","args":["/absolute/path/to/jit-tool-synthesis/dist/server.js"]}'Cursor — 添加到 .cursor/mcp.json:
{
"mcpServers": {
"jit-tools": {
"command": "node",
"args": ["/absolute/path/to/jit-tool-synthesis/dist/server.js"],
"env": { "LLM_API_KEY": "your-api-key" }
}
}
}运行时配置
您无需重启即可更改 LLM 提供商:
# View current config
get_config
# Change model at runtime
set_config model=openai/gpt-5.4MCP 工具
工具 | 描述 |
| 通过自然语言生成新工具 |
| 在批准前使用示例参数测试待定工具 |
| 激活待定工具 |
| 丢弃待定工具 |
| 运行已批准的工具 |
| 列出所有已批准的工具 |
| 查看工具详情 |
| 删除工具 |
| 列出等待批准的工具 |
| 查看 LLM 配置 |
| 在运行时更改 LLM 提供商/模型 |
工作流程
请求 — 用户提出工具需求(例如:“创建一个颜色转换器”)
合成 — LLM 生成工具代码
测试 — 在提交前使用示例参数进行验证
批准 — 人工审查并批准代码
执行 — 工具在沙箱环境中运行
存储 — 已批准的工具在会话间持久保存
环境变量
变量 | 描述 | 默认值 |
| 提供商的 API 密钥 | (云端必需) |
| API 端点 | |
| 使用的模型 | anthropic/claude-sonnet-4-6 |
同时支持(旧版):OPENROUTER_API_KEY, OPENAI_API_KEY, OPENAI_BASE_URL, SYNTHESIZER_MODEL
安全性
生成的代码运行在隔离的 VM 沙箱中
拦截模式可防止危险代码(process, require, eval 等)
API 密钥不会存储在配置文件中
状态
生产就绪 — 第一阶段已完成。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables AI models to dynamically create and execute their own custom tools through a meta-function architecture, supporting JavaScript, Python, and Shell runtimes with sandboxed security and human approval flows.510MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with MCP servers by writing TypeScript/JavaScript code instead of direct tool calls. Provides a code execution sandbox that accesses MCP servers through HTTP proxy endpoints.20123Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI-powered generation of production-ready CTP (ConveniencePro Tool Protocol) tools from natural language descriptions, including tool definitions, implementations, tests, and TypeScript validation.512MIT
Related MCP Connectors
Runtime permission, approval, and audit layer for AI agent tool execution.
Create and manage AI agents that collaborate and solve problems through natural language interacti…
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/EyeSeeThru/jit-tool-synthesis'
If you have feedback or need assistance with the MCP directory API, please join our Discord server