🛠️ toolhub - Turn ANY console script into an LLM tool in 2 seconds. Lightweight, self-hosted, tree-structured alternative to MCP & LangChain.
TypeScript
17
3 commits
updated Sep 7, 2026
TOOL HUB is a high-performance, self-hosted, open-source platform for creating, orchestrating, federating, and securely executing tools for AI agents of any kind.
Stop hardcoding functions into system prompts and overloading model context windows with hundreds of API schemas. TOOL HUB provides agents with a structured, distributed skill file system featuring on-the-fly tree navigation and a unified interaction contract.
ToolHub works out-of-the-box with the open-source 🧪 lab (labstudio.tech) web client (GitHub Repo) — an ultra-lightweight, serverless LLM workspace:
| Criterion | ToolHub | MCPJungle / MCPHub (typical MCP gateway) |
|---|---|---|
| Core approach | Execution engine: turns any script (Bun, Python, Go, Bash, etc.) into a tool on the fly | Proxy registry: registers pre-built MCP servers and grants access to them |
| Creating a tool | Write a script → it instantly becomes an agent tool | Requires an already-built MCP server implementing the protocol |
| Navigation | Hierarchical folder tree (listTools("/system")) | Flat list of registered servers/tools, grouped via Tool Groups |
| Federation | Infinitely nested REMOTE nodes (hub → hub → hub) | Single layer: client → gateway → servers, no recursive nesting |
| MCP integration | Supports MCP as one category type (Stateless + Stateful Pool) | MCP is the only supported format |
| MCP → native tool conversion | Yes (MCP Promote) | Not available |
| IDE integration | Yes (Sublime Merge diff, replace-literal, native Ctrl+Z) | Not available |
| Access control | Tool toggles in admin panel, two password tiers (agent/admin) | ACL/RBAC, Tool Groups, per-client tokens (in enterprise mode) |
listTools(), select the target tool, and execute it via callTool(). ┌────────────────────────┐
│ AI AGENT / SDK CLIENT│
└───────────┬────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ TOOL HUB CORE SYSTEM │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Fastify Router & Auth │ │
│ │ • Agent Auth (x-agent-password) • Admin Auth (x-admin-password) │ │
│ └──────┬──────────────────────────────────────────┬─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Agent API │ │ Admin API │ │
│ │ (/*) │ │ (/admin/api/*) │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └────────────────────┬────────────────────┘ │
│ ▼ │
│ UNIFIED ROUTER ENGINE │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ LOCAL │ │ REMOTE │ │ MCP │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Workspace HubSDK Proxy MCP Engine │
│ Execution (Infinite Tree) ┌────────┴────────┐ │
│ (Bun/Py/Go...) ▼ ▼ │
│ Stateless Stateful Pool │
│ (Stdio Spawn) (Persistent PID) │
└─────────────────────────────────────────────────────────────────────────────────────────┘
1. Workspace Isolation → 2. Injection → 3. Build/Install → 4. Run & Telemetry
(/tmp/hub_run_xxx/) (Code & Deps) (installCmd) (runCmd + ENV)
/tmp/hub_run_<timestamp>_<hash>).codeFileName and dependencies into depFileName.input.json and mirrors each key as INPUT_<KEY_NAME> environment variables.installCmd (e.g. pip install -r requirements.txt) if dependencies exist.runCmd with timeout controls, reads output from output.json or stdout, logs execution metrics into Audit Logs.replace-literal): AI targets exact line replacements in ~2ms with zero token waste.Ctrl+Z undo history..toolpack & ToolVersion).toolpack bundles.| Type | Purpose | Operation |
|---|---|---|
LOCAL | Native tool workspace | Executes scripts locally through configured runners. |
REMOTE | ToolHub proxy tunnel | Recursive gateway to remote nodes via HubSDK. |
MCP | External MCP server | Stdio-driven Model Context Protocol server. |
spawn $\rightarrow$ initialize $\rightarrow$ tools/call $\rightarrow$ exit.mcpIsStateful): Keeps processes alive in memory for complex sessions (Puppeteer, SSH). Hot calls execute in 10–30ms. Auto-terminates after 5 minutes of idle (TTL=300s) with auto-recovery on crash./office/home/lights/turn_on).HubSDK handles path normalization and credential forwarding automatically.<hub>listTools("/system")</hub>
<hub>callTool("/sublime/replace-literal", {
"find": "const PORT = 3000;",
"replace": "const PORT = 8080;"
})</hub>
x-agent-password): Protects skill discovery and execution routes (GET /*, POST /*).x-admin-password): Protects management APIs and web console (/admin/*).# 1. Clone repository
git clone https://github.com/Talos-Popcorn/toolhub.git
cd toolhub
# 2. Install dependencies
bun install
# 3. Push Prisma schema to database
bun run db:push
# 4. Interactive Installer & Seed
# (Prompt language: EN/RU/ZH, custom admin/agent passwords)
bun run db:seed
# Non-interactive / CI mode:
# bun run prisma/seed.ts --lang=en --admin-pass=admin --agent-pass=123
# 5. Start development servers
bun run dev
http://localhost:5173/admin/ (or port 3000 in production)http://localhost:3000/docs (Available only in bun run dev mode)admin (or chosen during seed)123 (or chosen during seed)import { HubSDK } from './SDK/JS/sdk';
const hub = new HubSDK('http://localhost:3000', '123');
async function runAgentLoop(userQuery: string) {
const systemPrompt = await hub.getSmartPrompt();
const messages = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userQuery }
];
while (true) {
const aiResponse = await llm.generate(messages);
const action = await hub.processAgentResponse(aiResponse);
if (!action.called) {
console.log('Agent Response:', aiResponse);
break;
}
messages.push({ role: 'assistant', content: aiResponse });
messages.push({
role: 'user',
content: `HUB_RESULT: ${JSON.stringify(action.result)}`
});
}
}
# Build frontend & sync database
bun run build
# Start production server
bun run start
This project is distributed under the AGPL-3.0 License (free for personal use and open-source modifications).
Commercial Use: A commercial license is required to use 🛠️ ToolHub within closed corporate environments or proprietary products without AGPL-3.0 copyleft restrictions.
Contact email: collab@labstudio.tech.
TOOL HUB — это высокопроизводительная self-hosted платформа с открытым исходным кодом для создания, управления, федерации и безопасного исполнения инструментов (tools) для AI-агентов любого типа.
Хватит хардкодить функции в системные промпты и перегружать контекст модели сотнями описаний API. TOOL HUB предоставляет агенту структурированную распределённую файловую систему навыков с навигацией «на лету» и единым контрактом взаимодействия.
ToolHub из коробки интегрирован с открытым веб-клиентом 🧪 lab (labstudio.tech) (GitHub Repo) — легковесным serverless-интерфейсом для общения с LLM:
| Критерий | ToolHub | MCPJungle / MCPHub (типичный MCP-gateway) |
|---|---|---|
| Суть подхода | Движок исполнения: превращает любой скрипт (Bun, Python, Go, Bash и т.д.) в tool на лету | Прокси-реестр: регистрирует уже готовые MCP-серверы и раздаёт к ним доступ |
| Создание tool'а | Пишешь скрипт → он сразу становится инструментом агента | Нужен готовый MCP-сервер, который кто-то уже реализовал по протоколу |
| Навигация | Иерархическое дерево папок (listTools("/system")) | Плоский список зарегистрированных серверов/тулов, группировка через Tool Groups |
| Федерация | Бесконечно вложенные REMOTE-узлы (хаб → хаб → хаб) | Один уровень: клиент → gateway → серверы, без рекурсивной вложенности |
| MCP-интеграция | Поддерживает MCP как один из типов категорий (Stateless + Stateful Pool) | MCP — единственный поддерживаемый формат |
| Конвертация MCP → нативный tool | Есть (MCP Promote) | Отсутствует |
| IDE-интеграция | Есть (Sublime Merge diff, replace-literal, Ctrl+Z) | Отсутствует |
| Контроль доступа | Toggle тулов в админке, два уровня паролей (agent/admin) | ACL/RBAC, Tool Groups, per-client токены (в enterprise-режиме) |
listTools() и запускать нужный инструмент через callTool(). ┌────────────────────────┐
│ AI AGENT / SDK CLIENT│
└───────────┬────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ TOOL HUB CORE SYSTEM │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Fastify Router & Auth │ │
│ │ • Agent Auth (x-agent-password) • Admin Auth (x-admin-password) │ │
│ └──────┬──────────────────────────────────────────┬─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Agent API │ │ Admin API │ │
│ │ (/*) │ │ (/admin/api/*) │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └────────────────────┬────────────────────┘ │
│ ▼ │
│ UNIFIED ROUTER ENGINE │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ LOCAL │ │ REMOTE │ │ MCP │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Workspace HubSDK Proxy MCP Engine │
│ Execution (Infinite Tree) ┌────────┴────────┐ │
│ (Bun/Py/Go...) ▼ ▼ │
│ Stateless Stateful Pool │
│ (Stdio Spawn) (Persistent PID) │
└─────────────────────────────────────────────────────────────────────────────────────────┘
1. Создание Workspace → 2. Инъекция файлов → 3. Инсталляция → 4. Исполнение & Output
(/tmp/hub_run_xxx/) (Code & Deps) (installCmd) (runCmd + ENV)
/tmp/hub_run_<timestamp>_<hash>).codeFileName, а манифест пакетов — в depFileName.input.json в корне воркспейса, а параметры дублируются в переменные окружения INPUT_<KEY_NAME>.installCmd, выполняется сборка (напр., pip install -r requirements.txt).runCmd): Запускается процесс с таймаутом timeoutMs, результат считывается из output.json или stdout, а телеметрия отправляется в Audit Logs.replace-literal): Агент меняет строго конкретные строки кода за 2 мс без перерасхода токенов.Ctrl+Z: Правки от ИИ работают через стандартный Undo-стек редактора..toolpack & ToolVersion).toolpack.| Тип | Назначение | Принцип работы |
|---|---|---|
LOCAL | Локальная папка с инструментами | Исполнение скриптов через встроенный движок раннеров. |
REMOTE | Проксирование на другой ToolHub | Рекурсивный туннель к удаленному узлу через HubSDK. |
MCP | Интеграция стороннего MCP-сервера | Запуск внешнего MCP-сервера через Stdio. |
spawn $\rightarrow$ initialize $\rightarrow$ tools/call $\rightarrow$ kill.mcpIsStateful): Удержание процесса в памяти (Puppeteer, SSH, СУБД). Повторные вызовы исполняются за 10–30 мс. Автозавершение при простое более 5 минут (TTL = 300s) и самовосстановление при сбоях.Tool в 1 клик./office/home/lights/turn_on).HubSDK берет на себя нормализацию путей, проксирование и авторизацию.<hub>listTools("/system")</hub>
<hub>callTool("/sublime/replace-literal", {
"find": "const PORT = 3000;",
"replace": "const PORT = 8080;"
})</hub>
x-agent-password): Защищает агентские API-роуты (GET /* и POST /*).x-admin-password): Защищает административные ручки управления (/admin/api/*).# 1. Клонирование репозитория
git clone https://github.com/Talos-Popcorn/toolhub.git
cd toolhub
# 2. Установка зависимостей
bun install
# 3. Синхронизация схемы БД Prisma
bun run db:push
# 4. Интерактивный инсталлятор и сид
# (Выбор языка системного промпта EN/RU/ZH, настройка паролей админки и агента)
bun run db:seed
# Или в тихом режиме для CI/Docker:
# bun run prisma/seed.ts --lang=ru --admin-pass=admin --agent-pass=123
# 5. Запуск серверов разработки
bun run dev
http://localhost:5173/admin/ (или порт 3000 в прод-сборке)http://localhost:3000/docs (Доступна только в режиме разработки bun run dev)admin (или заданный при сиде)123 (или заданный при сиде)import { HubSDK } from './SDK/JS/sdk';
const hub = new HubSDK('http://localhost:3000', '123');
async function runAgentLoop(userQuery: string) {
const systemPrompt = await hub.getSmartPrompt();
const messages = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userQuery }
];
while (true) {
const aiResponse = await llm.generate(messages);
const action = await hub.processAgentResponse(aiResponse);
if (!action.called) {
console.log('Ответ агента:', aiResponse);
break;
}
messages.push({ role: 'assistant', content: aiResponse });
messages.push({
role: 'user',
content: `HUB_RESULT: ${JSON.stringify(action.result)}`
});
}
}
# Сборка фронтенда и синхронизация БД
bun run build
# Запуск продакшн сервера
bun run start
Проект распространяется под лицензией AGPL-3.0 (бесплатен для личного использования и open-source модификаций).
Для коммерческого использования: Для использования 🛠️ ToolHub внутри закрытых корпоративных контуров или проприетарных продуктов без ограничений AGPL-3.0 требуется коммерческая лицензия.
Почта для связи: collab@labstudio.tech.
TOOL HUB 是一款高性能、支持私有化部署的开源平台,专为各类 AI 智能体设计,提供技能与工具 (Tools) 的创建、编排、联邦化管理与安全执行环境。
告别在系统提示词中硬编码函数以及 API Schema 严重消耗上下文的痛点。TOOL HUB 为智能体构建了结构化的分布式技能文件系统,支持即时目录导航与标准统一的交互契约。
ToolHub 原生无缝集成开源 Web 客户端 🧪 lab (labstudio.tech) (GitHub 仓库) —— 超轻量、无后端的 Serverless 大模型交互工作台:
| 对比项 | ToolHub | MCPJungle / MCPHub(典型 MCP 网关) |
|---|---|---|
| 核心思路 | 执行引擎:将任意脚本(Bun、Python、Go、Bash 等)即时转化为工具 | 代理注册表:注册已实现好的 MCP 服务器并分配访问权限 |
| 创建工具 | 编写脚本 → 立即成为智能体可用的工具 | 需要已按 MCP 协议实现好的服务器 |
| 导航方式 | 层级文件夹树(listTools("/system")) | 已注册服务器/工具的平铺列表,通过 Tool Groups 分组 |
| 联邦架构 | 无限嵌套的 REMOTE 节点(hub → hub → hub) | 单层结构:客户端 → 网关 → 服务器,无递归嵌套 |
| MCP 集成 | 将 MCP 作为分类之一支持(无状态 + 有状态进程池) | MCP 是唯一支持的格式 |
| MCP → 原生工具转换 | 支持(MCP Promote) | 不支持 |
| IDE 集成 | 支持(Sublime Merge 差异对比、replace-literal、原生撤销) | 不支持 |
| 访问控制 | 管理面板中开关工具,双层密码(agent/admin) | ACL/RBAC、Tool Groups、按客户端分配令牌(企业模式下) |
listTools() 浏览目录并通过 callTool() 按需调用。 ┌────────────────────────┐
│ AI AGENT / SDK CLIENT│
└───────────┬────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ TOOL HUB CORE SYSTEM │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Fastify Router & Auth │ │
│ │ • Agent Auth (x-agent-password) • Admin Auth (x-admin-password) │ │
│ └──────┬──────────────────────────────────────────┬─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Agent API │ │ Admin API │ │
│ │ (/*) │ │ (/admin/api/*) │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └────────────────────┬────────────────────┘ │
│ ▼ │
│ UNIFIED ROUTER ENGINE │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ LOCAL │ │ REMOTE │ │ MCP │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Workspace HubSDK Proxy MCP Engine │
│ Execution (Infinite Tree) ┌────────┴────────┐ │
│ (Bun/Py/Go...) ▼ ▼ │
│ Stateless Stateful Pool │
│ (Stdio Spawn) (Persistent PID) │
└─────────────────────────────────────────────────────────────────────────────────────────┘
1. 创建隔离工作区 → 2. 写入文件/参数 → 3. 安装依赖包 → 4. 运行与捕获输出
(/tmp/hub_run_xxx/) (Code & Deps) (installCmd) (runCmd + ENV)
/tmp/hub_run_<timestamp>_<hash>)。codeFileName 与 depFileName。input.json 并同步映射至 INPUT_<KEY_NAME> 环境变量。installCmd(如 pip install -r requirements.txt)。runCmd,捕获 output.json 或 stdout,执行耗时与日志同步存入审计日志。replace-literal): 智能体 2ms 内完成精确行级替换,杜绝全文件重写带来的 Token 浪费。Ctrl+Z 历史记录中。.toolpack & ToolVersion).toolpack。| 分类类型 | 定位 | 运行机制 |
|---|---|---|
LOCAL | 本地工具目录 | 通过内置运行器引擎在本地工作区执行。 |
REMOTE | ToolHub 节点代理 | 通过 HubSDK 递归转发至远程节点。 |
MCP | 外部 MCP 服务端 | 通过 Stdio 进程通信集成 Model Context Protocol。 |
spawn $\rightarrow$ initialize $\rightarrow$ tools/call $\rightarrow$ 退出。mcpIsStateful): 为复杂会话(Puppeteer 浏览器、SSH 等)保持内存常驻。后续调用仅需 10–30ms。空闲 5 分钟自动释放 (TTL=300s),异常退出自动恢复。Tool。<hub>listTools("/system")</hub>
<hub>callTool("/sublime/replace-literal", {
"find": "const PORT = 3000;",
"replace": "const PORT = 8080;"
})</hub>
x-agent-password): 保护技能目录查询与执行接口 (GET /*, POST /*)。x-admin-password): 保护管理控制台及核心配置接口 (/admin/*)。# 1. 克隆代码仓库
git clone https://github.com/Talos-Popcorn/toolhub.git
cd toolhub
# 2. 安装依赖
bun install
# 3. 推送 Prisma 结构至数据库
bun run db:push
# 4. 交互式安装向导与数据库填充 (Seed)
# (支持选择系统提示词语言 EN/RU/ZH 及自定义管理员/智能体密钥)
bun run db:seed
# 自动化/CI 静默模式:
# bun run prisma/seed.ts --lang=zh --admin-pass=admin --agent-pass=123
# 5. 启动开发服务器
bun run dev
http://localhost:5173/admin/ (生产环境为 3000 端口)http://localhost:3000/docs (仅在 bun run dev 开发模式下开启)admin (或安装时所设密码)123 (或安装时所设密钥)import { HubSDK } from './SDK/JS/sdk';
const hub = new HubSDK('http://localhost:3000', '123');
async function runAgentLoop(userQuery: string) {
const systemPrompt = await hub.getSmartPrompt();
const messages = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userQuery }
];
while (true) {
const aiResponse = await llm.generate(messages);
const action = await hub.processAgentResponse(aiResponse);
if (!action.called) {
console.log('智能体响应结果:', aiResponse);
break;
}
messages.push({ role: 'assistant', content: aiResponse });
messages.push({
role: 'user',
content: `HUB_RESULT: ${JSON.stringify(action.result)}`
});
}
}
# 编译前端静态资源并同步数据库
bun run build
# 启动生产服务
bun run start
本项目基于 AGPL-3.0 许可证 开源分发(个人使用与开源衍生修改完全免费)。
商业授权: 若要在不受 AGPL-3.0 传染性开源约束的前提下,将 🛠️ ToolHub 部署于封闭的企业内网或集成至专有商业产品中,需获取商业授权许可证。
联系邮箱:collab@labstudio.tech。
Built for the future of autonomous, distributed AI agents.
3 commits
TypeScript
92.6%
Python
4.3%
JavaScript
1.6%
CSS
1.4%
🛠️ toolhub - Turn ANY console script into an LLM tool in 2 seconds. Lightweight, self-hosted, tree-structured alternative to MCP & LangChain.
TypeScript
17
3 commits
updated Sep 7, 2026
TOOL HUB is a high-performance, self-hosted, open-source platform for creating, orchestrating, federating, and securely executing tools for AI agents of any kind.
Stop hardcoding functions into system prompts and overloading model context windows with hundreds of API schemas. TOOL HUB provides agents with a structured, distributed skill file system featuring on-the-fly tree navigation and a unified interaction contract.
ToolHub works out-of-the-box with the open-source 🧪 lab (labstudio.tech) web client (GitHub Repo) — an ultra-lightweight, serverless LLM workspace:
| Criterion | ToolHub | MCPJungle / MCPHub (typical MCP gateway) |
|---|---|---|
| Core approach | Execution engine: turns any script (Bun, Python, Go, Bash, etc.) into a tool on the fly | Proxy registry: registers pre-built MCP servers and grants access to them |
| Creating a tool | Write a script → it instantly becomes an agent tool | Requires an already-built MCP server implementing the protocol |
| Navigation | Hierarchical folder tree (listTools("/system")) | Flat list of registered servers/tools, grouped via Tool Groups |
| Federation | Infinitely nested REMOTE nodes (hub → hub → hub) | Single layer: client → gateway → servers, no recursive nesting |
| MCP integration | Supports MCP as one category type (Stateless + Stateful Pool) | MCP is the only supported format |
| MCP → native tool conversion | Yes (MCP Promote) | Not available |
| IDE integration | Yes (Sublime Merge diff, replace-literal, native Ctrl+Z) | Not available |
| Access control | Tool toggles in admin panel, two password tiers (agent/admin) | ACL/RBAC, Tool Groups, per-client tokens (in enterprise mode) |
listTools(), select the target tool, and execute it via callTool(). ┌────────────────────────┐
│ AI AGENT / SDK CLIENT│
└───────────┬────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ TOOL HUB CORE SYSTEM │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Fastify Router & Auth │ │
│ │ • Agent Auth (x-agent-password) • Admin Auth (x-admin-password) │ │
│ └──────┬──────────────────────────────────────────┬─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Agent API │ │ Admin API │ │
│ │ (/*) │ │ (/admin/api/*) │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └────────────────────┬────────────────────┘ │
│ ▼ │
│ UNIFIED ROUTER ENGINE │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ LOCAL │ │ REMOTE │ │ MCP │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Workspace HubSDK Proxy MCP Engine │
│ Execution (Infinite Tree) ┌────────┴────────┐ │
│ (Bun/Py/Go...) ▼ ▼ │
│ Stateless Stateful Pool │
│ (Stdio Spawn) (Persistent PID) │
└─────────────────────────────────────────────────────────────────────────────────────────┘
1. Workspace Isolation → 2. Injection → 3. Build/Install → 4. Run & Telemetry
(/tmp/hub_run_xxx/) (Code & Deps) (installCmd) (runCmd + ENV)
/tmp/hub_run_<timestamp>_<hash>).codeFileName and dependencies into depFileName.input.json and mirrors each key as INPUT_<KEY_NAME> environment variables.installCmd (e.g. pip install -r requirements.txt) if dependencies exist.runCmd with timeout controls, reads output from output.json or stdout, logs execution metrics into Audit Logs.replace-literal): AI targets exact line replacements in ~2ms with zero token waste.Ctrl+Z undo history..toolpack & ToolVersion).toolpack bundles.| Type | Purpose | Operation |
|---|---|---|
LOCAL | Native tool workspace | Executes scripts locally through configured runners. |
REMOTE | ToolHub proxy tunnel | Recursive gateway to remote nodes via HubSDK. |
MCP | External MCP server | Stdio-driven Model Context Protocol server. |
spawn $\rightarrow$ initialize $\rightarrow$ tools/call $\rightarrow$ exit.mcpIsStateful): Keeps processes alive in memory for complex sessions (Puppeteer, SSH). Hot calls execute in 10–30ms. Auto-terminates after 5 minutes of idle (TTL=300s) with auto-recovery on crash./office/home/lights/turn_on).HubSDK handles path normalization and credential forwarding automatically.<hub>listTools("/system")</hub>
<hub>callTool("/sublime/replace-literal", {
"find": "const PORT = 3000;",
"replace": "const PORT = 8080;"
})</hub>
x-agent-password): Protects skill discovery and execution routes (GET /*, POST /*).x-admin-password): Protects management APIs and web console (/admin/*).# 1. Clone repository
git clone https://github.com/Talos-Popcorn/toolhub.git
cd toolhub
# 2. Install dependencies
bun install
# 3. Push Prisma schema to database
bun run db:push
# 4. Interactive Installer & Seed
# (Prompt language: EN/RU/ZH, custom admin/agent passwords)
bun run db:seed
# Non-interactive / CI mode:
# bun run prisma/seed.ts --lang=en --admin-pass=admin --agent-pass=123
# 5. Start development servers
bun run dev
http://localhost:5173/admin/ (or port 3000 in production)http://localhost:3000/docs (Available only in bun run dev mode)admin (or chosen during seed)123 (or chosen during seed)import { HubSDK } from './SDK/JS/sdk';
const hub = new HubSDK('http://localhost:3000', '123');
async function runAgentLoop(userQuery: string) {
const systemPrompt = await hub.getSmartPrompt();
const messages = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userQuery }
];
while (true) {
const aiResponse = await llm.generate(messages);
const action = await hub.processAgentResponse(aiResponse);
if (!action.called) {
console.log('Agent Response:', aiResponse);
break;
}
messages.push({ role: 'assistant', content: aiResponse });
messages.push({
role: 'user',
content: `HUB_RESULT: ${JSON.stringify(action.result)}`
});
}
}
# Build frontend & sync database
bun run build
# Start production server
bun run start
This project is distributed under the AGPL-3.0 License (free for personal use and open-source modifications).
Commercial Use: A commercial license is required to use 🛠️ ToolHub within closed corporate environments or proprietary products without AGPL-3.0 copyleft restrictions.
Contact email: collab@labstudio.tech.
TOOL HUB — это высокопроизводительная self-hosted платформа с открытым исходным кодом для создания, управления, федерации и безопасного исполнения инструментов (tools) для AI-агентов любого типа.
Хватит хардкодить функции в системные промпты и перегружать контекст модели сотнями описаний API. TOOL HUB предоставляет агенту структурированную распределённую файловую систему навыков с навигацией «на лету» и единым контрактом взаимодействия.
ToolHub из коробки интегрирован с открытым веб-клиентом 🧪 lab (labstudio.tech) (GitHub Repo) — легковесным serverless-интерфейсом для общения с LLM:
| Критерий | ToolHub | MCPJungle / MCPHub (типичный MCP-gateway) |
|---|---|---|
| Суть подхода | Движок исполнения: превращает любой скрипт (Bun, Python, Go, Bash и т.д.) в tool на лету | Прокси-реестр: регистрирует уже готовые MCP-серверы и раздаёт к ним доступ |
| Создание tool'а | Пишешь скрипт → он сразу становится инструментом агента | Нужен готовый MCP-сервер, который кто-то уже реализовал по протоколу |
| Навигация | Иерархическое дерево папок (listTools("/system")) | Плоский список зарегистрированных серверов/тулов, группировка через Tool Groups |
| Федерация | Бесконечно вложенные REMOTE-узлы (хаб → хаб → хаб) | Один уровень: клиент → gateway → серверы, без рекурсивной вложенности |
| MCP-интеграция | Поддерживает MCP как один из типов категорий (Stateless + Stateful Pool) | MCP — единственный поддерживаемый формат |
| Конвертация MCP → нативный tool | Есть (MCP Promote) | Отсутствует |
| IDE-интеграция | Есть (Sublime Merge diff, replace-literal, Ctrl+Z) | Отсутствует |
| Контроль доступа | Toggle тулов в админке, два уровня паролей (agent/admin) | ACL/RBAC, Tool Groups, per-client токены (в enterprise-режиме) |
listTools() и запускать нужный инструмент через callTool(). ┌────────────────────────┐
│ AI AGENT / SDK CLIENT│
└───────────┬────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ TOOL HUB CORE SYSTEM │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Fastify Router & Auth │ │
│ │ • Agent Auth (x-agent-password) • Admin Auth (x-admin-password) │ │
│ └──────┬──────────────────────────────────────────┬─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Agent API │ │ Admin API │ │
│ │ (/*) │ │ (/admin/api/*) │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └────────────────────┬────────────────────┘ │
│ ▼ │
│ UNIFIED ROUTER ENGINE │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ LOCAL │ │ REMOTE │ │ MCP │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Workspace HubSDK Proxy MCP Engine │
│ Execution (Infinite Tree) ┌────────┴────────┐ │
│ (Bun/Py/Go...) ▼ ▼ │
│ Stateless Stateful Pool │
│ (Stdio Spawn) (Persistent PID) │
└─────────────────────────────────────────────────────────────────────────────────────────┘
1. Создание Workspace → 2. Инъекция файлов → 3. Инсталляция → 4. Исполнение & Output
(/tmp/hub_run_xxx/) (Code & Deps) (installCmd) (runCmd + ENV)
/tmp/hub_run_<timestamp>_<hash>).codeFileName, а манифест пакетов — в depFileName.input.json в корне воркспейса, а параметры дублируются в переменные окружения INPUT_<KEY_NAME>.installCmd, выполняется сборка (напр., pip install -r requirements.txt).runCmd): Запускается процесс с таймаутом timeoutMs, результат считывается из output.json или stdout, а телеметрия отправляется в Audit Logs.replace-literal): Агент меняет строго конкретные строки кода за 2 мс без перерасхода токенов.Ctrl+Z: Правки от ИИ работают через стандартный Undo-стек редактора..toolpack & ToolVersion).toolpack.| Тип | Назначение | Принцип работы |
|---|---|---|
LOCAL | Локальная папка с инструментами | Исполнение скриптов через встроенный движок раннеров. |
REMOTE | Проксирование на другой ToolHub | Рекурсивный туннель к удаленному узлу через HubSDK. |
MCP | Интеграция стороннего MCP-сервера | Запуск внешнего MCP-сервера через Stdio. |
spawn $\rightarrow$ initialize $\rightarrow$ tools/call $\rightarrow$ kill.mcpIsStateful): Удержание процесса в памяти (Puppeteer, SSH, СУБД). Повторные вызовы исполняются за 10–30 мс. Автозавершение при простое более 5 минут (TTL = 300s) и самовосстановление при сбоях.Tool в 1 клик./office/home/lights/turn_on).HubSDK берет на себя нормализацию путей, проксирование и авторизацию.<hub>listTools("/system")</hub>
<hub>callTool("/sublime/replace-literal", {
"find": "const PORT = 3000;",
"replace": "const PORT = 8080;"
})</hub>
x-agent-password): Защищает агентские API-роуты (GET /* и POST /*).x-admin-password): Защищает административные ручки управления (/admin/api/*).# 1. Клонирование репозитория
git clone https://github.com/Talos-Popcorn/toolhub.git
cd toolhub
# 2. Установка зависимостей
bun install
# 3. Синхронизация схемы БД Prisma
bun run db:push
# 4. Интерактивный инсталлятор и сид
# (Выбор языка системного промпта EN/RU/ZH, настройка паролей админки и агента)
bun run db:seed
# Или в тихом режиме для CI/Docker:
# bun run prisma/seed.ts --lang=ru --admin-pass=admin --agent-pass=123
# 5. Запуск серверов разработки
bun run dev
http://localhost:5173/admin/ (или порт 3000 в прод-сборке)http://localhost:3000/docs (Доступна только в режиме разработки bun run dev)admin (или заданный при сиде)123 (или заданный при сиде)import { HubSDK } from './SDK/JS/sdk';
const hub = new HubSDK('http://localhost:3000', '123');
async function runAgentLoop(userQuery: string) {
const systemPrompt = await hub.getSmartPrompt();
const messages = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userQuery }
];
while (true) {
const aiResponse = await llm.generate(messages);
const action = await hub.processAgentResponse(aiResponse);
if (!action.called) {
console.log('Ответ агента:', aiResponse);
break;
}
messages.push({ role: 'assistant', content: aiResponse });
messages.push({
role: 'user',
content: `HUB_RESULT: ${JSON.stringify(action.result)}`
});
}
}
# Сборка фронтенда и синхронизация БД
bun run build
# Запуск продакшн сервера
bun run start
Проект распространяется под лицензией AGPL-3.0 (бесплатен для личного использования и open-source модификаций).
Для коммерческого использования: Для использования 🛠️ ToolHub внутри закрытых корпоративных контуров или проприетарных продуктов без ограничений AGPL-3.0 требуется коммерческая лицензия.
Почта для связи: collab@labstudio.tech.
TOOL HUB 是一款高性能、支持私有化部署的开源平台,专为各类 AI 智能体设计,提供技能与工具 (Tools) 的创建、编排、联邦化管理与安全执行环境。
告别在系统提示词中硬编码函数以及 API Schema 严重消耗上下文的痛点。TOOL HUB 为智能体构建了结构化的分布式技能文件系统,支持即时目录导航与标准统一的交互契约。
ToolHub 原生无缝集成开源 Web 客户端 🧪 lab (labstudio.tech) (GitHub 仓库) —— 超轻量、无后端的 Serverless 大模型交互工作台:
| 对比项 | ToolHub | MCPJungle / MCPHub(典型 MCP 网关) |
|---|---|---|
| 核心思路 | 执行引擎:将任意脚本(Bun、Python、Go、Bash 等)即时转化为工具 | 代理注册表:注册已实现好的 MCP 服务器并分配访问权限 |
| 创建工具 | 编写脚本 → 立即成为智能体可用的工具 | 需要已按 MCP 协议实现好的服务器 |
| 导航方式 | 层级文件夹树(listTools("/system")) | 已注册服务器/工具的平铺列表,通过 Tool Groups 分组 |
| 联邦架构 | 无限嵌套的 REMOTE 节点(hub → hub → hub) | 单层结构:客户端 → 网关 → 服务器,无递归嵌套 |
| MCP 集成 | 将 MCP 作为分类之一支持(无状态 + 有状态进程池) | MCP 是唯一支持的格式 |
| MCP → 原生工具转换 | 支持(MCP Promote) | 不支持 |
| IDE 集成 | 支持(Sublime Merge 差异对比、replace-literal、原生撤销) | 不支持 |
| 访问控制 | 管理面板中开关工具,双层密码(agent/admin) | ACL/RBAC、Tool Groups、按客户端分配令牌(企业模式下) |
listTools() 浏览目录并通过 callTool() 按需调用。 ┌────────────────────────┐
│ AI AGENT / SDK CLIENT│
└───────────┬────────────┘
│ HTTP Requests
▼
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ TOOL HUB CORE SYSTEM │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Fastify Router & Auth │ │
│ │ • Agent Auth (x-agent-password) • Admin Auth (x-admin-password) │ │
│ └──────┬──────────────────────────────────────────┬─────────────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Agent API │ │ Admin API │ │
│ │ (/*) │ │ (/admin/api/*) │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ └────────────────────┬────────────────────┘ │
│ ▼ │
│ UNIFIED ROUTER ENGINE │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ LOCAL │ │ REMOTE │ │ MCP │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ Workspace HubSDK Proxy MCP Engine │
│ Execution (Infinite Tree) ┌────────┴────────┐ │
│ (Bun/Py/Go...) ▼ ▼ │
│ Stateless Stateful Pool │
│ (Stdio Spawn) (Persistent PID) │
└─────────────────────────────────────────────────────────────────────────────────────────┘
1. 创建隔离工作区 → 2. 写入文件/参数 → 3. 安装依赖包 → 4. 运行与捕获输出
(/tmp/hub_run_xxx/) (Code & Deps) (installCmd) (runCmd + ENV)
/tmp/hub_run_<timestamp>_<hash>)。codeFileName 与 depFileName。input.json 并同步映射至 INPUT_<KEY_NAME> 环境变量。installCmd(如 pip install -r requirements.txt)。runCmd,捕获 output.json 或 stdout,执行耗时与日志同步存入审计日志。replace-literal): 智能体 2ms 内完成精确行级替换,杜绝全文件重写带来的 Token 浪费。Ctrl+Z 历史记录中。.toolpack & ToolVersion).toolpack。| 分类类型 | 定位 | 运行机制 |
|---|---|---|
LOCAL | 本地工具目录 | 通过内置运行器引擎在本地工作区执行。 |
REMOTE | ToolHub 节点代理 | 通过 HubSDK 递归转发至远程节点。 |
MCP | 外部 MCP 服务端 | 通过 Stdio 进程通信集成 Model Context Protocol。 |
spawn $\rightarrow$ initialize $\rightarrow$ tools/call $\rightarrow$ 退出。mcpIsStateful): 为复杂会话(Puppeteer 浏览器、SSH 等)保持内存常驻。后续调用仅需 10–30ms。空闲 5 分钟自动释放 (TTL=300s),异常退出自动恢复。Tool。<hub>listTools("/system")</hub>
<hub>callTool("/sublime/replace-literal", {
"find": "const PORT = 3000;",
"replace": "const PORT = 8080;"
})</hub>
x-agent-password): 保护技能目录查询与执行接口 (GET /*, POST /*)。x-admin-password): 保护管理控制台及核心配置接口 (/admin/*)。# 1. 克隆代码仓库
git clone https://github.com/Talos-Popcorn/toolhub.git
cd toolhub
# 2. 安装依赖
bun install
# 3. 推送 Prisma 结构至数据库
bun run db:push
# 4. 交互式安装向导与数据库填充 (Seed)
# (支持选择系统提示词语言 EN/RU/ZH 及自定义管理员/智能体密钥)
bun run db:seed
# 自动化/CI 静默模式:
# bun run prisma/seed.ts --lang=zh --admin-pass=admin --agent-pass=123
# 5. 启动开发服务器
bun run dev
http://localhost:5173/admin/ (生产环境为 3000 端口)http://localhost:3000/docs (仅在 bun run dev 开发模式下开启)admin (或安装时所设密码)123 (或安装时所设密钥)import { HubSDK } from './SDK/JS/sdk';
const hub = new HubSDK('http://localhost:3000', '123');
async function runAgentLoop(userQuery: string) {
const systemPrompt = await hub.getSmartPrompt();
const messages = [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userQuery }
];
while (true) {
const aiResponse = await llm.generate(messages);
const action = await hub.processAgentResponse(aiResponse);
if (!action.called) {
console.log('智能体响应结果:', aiResponse);
break;
}
messages.push({ role: 'assistant', content: aiResponse });
messages.push({
role: 'user',
content: `HUB_RESULT: ${JSON.stringify(action.result)}`
});
}
}
# 编译前端静态资源并同步数据库
bun run build
# 启动生产服务
bun run start
本项目基于 AGPL-3.0 许可证 开源分发(个人使用与开源衍生修改完全免费)。
商业授权: 若要在不受 AGPL-3.0 传染性开源约束的前提下,将 🛠️ ToolHub 部署于封闭的企业内网或集成至专有商业产品中,需获取商业授权许可证。
联系邮箱:collab@labstudio.tech。
Built for the future of autonomous, distributed AI agents.
3 commits
TypeScript
92.6%
Python
4.3%
JavaScript
1.6%
CSS
1.4%