Better Chatbot
Откройте для себя Better Chatbot — интуитивного ИИ-ассистента, интегрирующего Model Context Protocol (MCP) для продвинутого выполнения инструментов. Создавайте собственные визуальные рабочие процессы, используйте голосовое управление в реальном времени и получайте детальный контроль над инструментами ИИ для максимальной продуктивности.
Better Chatbot стремится обеспечить непревзойденный пользовательский опыт, уделяя первостепенное внимание интуитивному взаимодействию с инструментами ИИ. Построенный на базе Vercel AI SDK и Next.js, он глубоко интегрируется с Model Context Protocol (MCP), обеспечивая бесшовное включение внешних инструментов. Пользователи также могут создавать собственные визу
Our goal is to create the best possible chatbot UX — focusing on the joy and intuitiveness users feel when calling and interacting with AI tools.
See the experience in action in the preview below!
Built with Vercel AI SDK and Next.js, this app adopts modern patterns for building AI chat interfaces. It leverages the power of the Model Context Protocol (MCP) to seamlessly integrate external tools into your chat experience. You can also create custom workflows that become callable tools in chat, allowing you to chain multiple MCP tools, LLM interactions, and logic into powerful automated sequences.
# 1. Clone the repository
git clone https://github.com/cgoinglove/better-chatbot.git
cd better-chatbot
# 2. (Optional) Install pnpm if you don't have it
npm install -g pnpm
# 3. Install dependencies
pnpm i
# 4. Create the environment variable file and fill in your .env values
pnpm initial:env # This runs automatically in postinstall, so you can usually skip it.
# 5. (Optional) If you already have PostgreSQL running and .env is configured, skip this step
pnpm docker:pg
# 6. Run database migrations
pnpm db:migrate
# 7. Start the development server
pnpm dev
# 8. (Optional) Build & start for local production-like testing
pnpm build:local && pnpm start
# Use build:local for local start to ensure correct cookie settings⚠️ Important: When updating to a new version of the project (after
git pull), always runpnpm db:migrateto ensure your database schema is up to date.
Open http://localhost:3000 in your browser to get started.
- Table of Contents
- Preview
- Getting Started
- 📘 Guides
- 💡 Tips
- 🗺️ Roadmap
- 🙌 Contributing
- 💬 Join Our Discord
This project is evolving at lightning speed! ⚡️ We're constantly shipping new features and smashing bugs. Star this repo to join the ride and stay in the loop with the latest updates!
Get a feel for the UX — here's a quick look at what's possible.
Example: Control a web browser using Microsoft's playwright-mcp tool.
- The LLM autonomously decides how to use tools from the MCP server, calling them multiple times to complete a multi-step task and return a final message.
Sample prompt:
1. Use the @tool('web-search') to look up information about “modelcontetprotocol.”
2. Then, using : @mcp("playwright")
- navigate Google (https://www.google.com)
- Click the “Login” button
- Enter my email address (neo.cgoing@gmail.com)
- Clock the "Next" button
- Close the browser
Example: Create custom workflows that become callable tools in your chat conversations.
- Build visual workflows by connecting LLM nodes (for AI reasoning) and Tool nodes (for MCP tool execution)
- Publish workflows to make them available as
@workflow_nametools in chat - Chain complex multi-step processes into reusable, automated sequences
demo-video.mov
This demo showcases a realtime voice-based chatbot assistant built with OpenAI's new Realtime API — now extended with full MCP tool integration. Talk to the assistant naturally, and watch it execute tools in real time.
Quickly call tool during chat by typing @toolname.
No need to memorize — just type @ and pick from the list!
Tool Selection vs. Mentions (@) — When to Use What:
- Tool Selection: Make frequently used tools always available to the LLM across all chats. Great for convenience and maintaining consistent context over time.
- Mentions (
@): Temporarily bind only the mentioned tools for that specific response. Since only the mentioned tools are sent to the LLM, this saves tokens and can improve speed and accuracy.
Each method has its own strengths — use them together to balance efficiency and performance.
You can also create tool presets by selecting only the MCP servers or tools you need. Switch between presets instantly with a click — perfect for organizing tools by task or workflow.
Control how tools are used in each chat with Tool Choice Mode — switch anytime with ⌘P.
- Auto: The model automatically calls tools when needed.
- Manual: The model will ask for your permission before calling a tool.
- None: Tool usage is disabled completely.
This lets you flexibly choose between autonomous, guided, or tool-free interaction depending on the situation.
Built-in web search powered by Tavily API. Search the web and extract content from URLs directly in your chats.
- Optional: Add
TAVILY_API_KEYto.envto enable web search - Free Tier: 1,000 requests/month at no cost
- Easy Setup: Get your API key with one click at app.tavily.com
It is a simple JS execution tool.
Additionally, many basic tools are provided, such as visualization tools for drawing charts and tables, and an HTTP tool.
…and there's even more waiting for you. Try it out and see what else it can do!
This project uses pnpm as the recommended package manager.
# If you don't have pnpm:
npm install -g pnpm# 1. Install dependencies
pnpm i
# 2. Enter only the LLM PROVIDER API key(s) you want to use in the .env file at the project root.
# Example: The app works with just OPENAI_API_KEY filled in.
# (The .env file is automatically created when you run pnpm i.)
# 3. Build and start all services (including PostgreSQL) with Docker Compose
pnpm docker-compose:up
# 1. Install dependencies
pnpm i
# 2. Create the environment variable file and fill in your .env values
pnpm initial:env # This runs automatically in postinstall, so you can usually skip it.
# 3. (Optional) If you already have PostgreSQL running and .env is configured, skip this step
pnpm docker:pg
# 4. Run database migrations
pnpm db:migrate
# 5. Start the development server
pnpm dev
# 6. (Optional) Build & start for local production-like testing
pnpm build:local && pnpm start
# Use build:local for local start to ensure correct cookie settingsOpen http://localhost:3000 in your browser to get started.
The pnpm i command generates a .env file. Add your API keys there.
# === LLM Provider API Keys ===
# You only need to enter the keys for the providers you plan to use
GOOGLE_GENERATIVE_AI_API_KEY=****
OPENAI_API_KEY=****
XAI_API_KEY=****
ANTHROPIC_API_KEY=****
OPENROUTER_API_KEY=****
OLLAMA_BASE_URL=http://localhost:11434/api
# Secret for Better Auth (generate with: npx @better-auth/cli@latest secret)
BETTER_AUTH_SECRET=****
# (Optional)
# URL for Better Auth (the URL you access the app from)
BETTER_AUTH_URL=
# === Database ===
# If you don't have PostgreSQL running locally, start it with: pnpm docker:pg
POSTGRES_URL=postgres://your_username:your_password@localhost:5432/your_database_name
# (Optional)
# === Tools ===
# Tavily for web search and content extraction (optional, but recommended for @web and research features)
TAVILY_API_KEY=your_tavily_api_key_here
# Whether to use file-based MCP config (default: false)
FILE_BASED_MCP_CONFIG=false
# (Optional)
# === OAuth Settings ===
# Fill in these values only if you want to enable Google/GitHub login
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Set this to 1 to disable user sign-ups.
DISABLE_SIGN_UP=
# Set this to 1 to disallow adding MCP servers.
NOT_ALLOW_ADD_MCP_SERVERS=Step-by-step setup guides for running and configuring better-chatbot.
- How to add and configure MCP servers in your environment
- How to self-host the chatbot using Docker, including environment configuration.
- Deploy the chatbot to Vercel with simple setup steps for production use.
- Personalize your chatbot experience with custom system prompts, user preferences, and MCP tool instructions
- Configure Google and GitHub OAuth for secure user login support.
- Adding openAI like ai providers
Advanced use cases and extra capabilities that enhance your chatbot experience.
- Use MCP servers and structured project instructions to build a custom assistant that helps with specific tasks.
- Open lightweight popup chats for quick side questions or testing — separate from your main thread.
Planned features coming soon to better-chatbot:
- File Attach & Image Generation
- Collaborative Document Editing (like OpenAI Canvas: user & assistant co-editing)
- RAG (Retrieval-Augmented Generation)
- Web-based Compute (with WebContainers integration)
💡 If you have suggestions or need specific features, please create an issue!
We welcome all contributions! Bug reports, feature ideas, code improvements — everything helps us build the best local AI assistant.
⚠️ Please read our Contributing Guide before submitting any Pull Requests or Issues. This helps us work together more effectively and saves time for everyone.
For detailed contribution guidelines, please see our Contributing Guide.
Language Translations: Help us make the chatbot accessible to more users by adding new language translations. See language.md for instructions on how to contribute translations.
Let's build it together 🚀
Connect with the community, ask questions, and get support on our official Discord server!
Better Chatbot
Better Chatbot — это открытый шаблон чат-бота на Next.js и Vercel AI SDK, ориентированный на удобство взаимодействия пользователя с AI-инструментами. Проект использует Model Context Protocol (MCP) для интеграции внешних инструментов и позволяет создавать собственные визуальные рабочие процессы, которые становятся вызываемыми инструментами в чате.
Возможности
- Браузерная автоматизация с Playwright MCP — управляйте браузером через MCP-инструмент от Microsoft.
- Визуальные рабочие процессы как кастомные инструменты — создавайте последовательности из LLM-узлов и MCP-инструментов, публикуйте их как
@workflow_name. - Голосовой ассистент в реальном времени — интеграция с OpenAI Realtime API и MCP-инструментами.
- Быстрые упоминания инструментов (@) — введите
@имя_инструментав чате для временного использования. - Пресеты инструментов — группируйте MCP-серверы и инструменты для быстрого переключения.
- Режим выбора инструментов — Auto (автоматический вызов), Manual (запрос разрешения), None (отключено).
- Встроенные инструменты: веб-поиск (Tavily), выполнение JavaScript, визуализация графиков и таблиц, HTTP-запросы.
- Временные окна чата — лёгкие всплывающие окна для быстрых вопросов.
- Агентный чат-бот с проектными инструкциями — используйте MCP-серверы и структурированные инструкции для создания ассистента под конкретные задачи.
Быстрый старт
Через Docker Compose (рекомендуется)
# 1. Установите зависимости
pnpm i
# 2. Заполните .env (создаётся автоматически) — достаточно указать хотя бы один ключ LLM-провайдера
# Пример: OPENAI_API_KEY=ваш_ключ
# 3. Запустите все сервисы (включая PostgreSQL)
pnpm docker-compose:up
Локальный запуск
# 1. Клонируйте репозиторий
git clone https://github.com/cgoinglove/better-chatbot.git
cd better-chatbot
# 2. Установите pnpm (если нет)
npm install -g pnpm
# 3. Установите зависимости
pnpm i
# 4. Создайте .env (обычно выполняется автоматически)
pnpm initial:env
# 5. Запустите PostgreSQL (если нет)
pnpm docker:pg
# 6. Выполните миграции БД
pnpm db:migrate
# 7. Запустите dev-сервер
pnpm dev
Откройте http://localhost:3000 в браузере.
Важно: После обновления проекта (
git pull) всегда выполняйтеpnpm db:migrate.
Переменные окружения
Файл .env создаётся автоматически при pnpm i. Обязательно укажите хотя бы один ключ LLM-провайдера:
# === Ключи LLM-провайдеров ===
GOOGLE_GENERATIVE_AI_API_KEY=****
OPENAI_API_KEY=****
XAI_API_KEY=****
ANTHROPIC_API_KEY=****
OPENROUTER_API_KEY=****
OLLAMA_BASE_URL=http://localhost:11434/api
# Секрет для Better Auth (сгенерировать: npx @better-auth/cli@latest secret)
BETTER_AUTH_SECRET=****
# === База данных ===
POSTGRES_URL=postgres://user:password@localhost:5432/dbname
# === Инструменты ===
# Tavily для веб-поиска (бесплатно 1000 запросов/мес)
TAVILY_API_KEY=ваш_ключ
# === OAuth (опционально) ===
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Отключить регистрацию: DISABLE_SIGN_UP=1
# Запретить добавление MCP-серверов: NOT_ALLOW_ADD_MCP_SERVERS=1
Руководства
- Настройка MCP-серверов и тестирование инструментов
- Хостинг через Docker
- Деплой на Vercel
- Кастомизация системных промптов
- Настройка OAuth (Google/GitHub)
- Добавление провайдеров, совместимых с OpenAI
Планы развития
- Прикрепление файлов и генерация изображений
- Совместное редактирование документов (как OpenAI Canvas)
- RAG (Retrieval-Augmented Generation)
- Веб-вычисления (интеграция с WebContainers)
Участие в разработке
Мы приветствуем любые вклады: баг-репорты, идеи, улучшения кода. Перед отправкой PR или Issue ознакомьтесь с Contributing Guide.
Сообщество
Присоединяйтесь к нашему Discord: https://discord.gg/gCRu69Upnp
Что такое Better Chatbot?
Better Chatbot — это интуитивный AI-чат-бот, созданный для повышения вашей продуктивности благодаря бесшовной интеграции с протоколом MCP (Model Context Protocol) для мощного выполнения внешних инструментов и возможности создания собственных вызываемых визуальных рабочих процессов прямо в чате.
Как Better Chatbot интегрируется с внешними инструментами?
Он использует протокол MCP, чтобы AI мог автономно вызывать внешние инструменты и взаимодействовать с ними. Это позволяет чат-боту выполнять сложные действия, такие как автоматизация браузера, веб-поиск и выполнение пользовательских скриптов, прямо в вашем чате.
Могу ли я создавать собственные рабочие процессы с Better Chatbot?
Да, вы можете создавать и публиковать визуальные рабочие процессы, которые становятся пользовательскими вызываемыми инструментами в ваших чатах. Эти рабочие процессы могут объединять несколько MCP-инструментов, LLM-взаимодействий и пользовательскую логику для автоматизации сложных многошаговых процессов.
Поддерживает ли Better Chatbot голосовое взаимодействие?
Конечно! Better Chatbot поддерживает голосовое взаимодействие в реальном времени, позволяя вам естественно разговаривать с AI-ассистентом и наблюдать, как он выполняет MCP-инструменты в реальном времени, обеспечивая по-настоящему свободный и динамичный опыт.
Better Chatbot — это проект с открытым исходным кодом?
Да, Better Chatbot — это проект с открытым исходным кодом, построенный на Next.js и Vercel AI SDK. Он создан для кастомизации и вклада сообщества, предлагая разработчикам гибкость в хостинге и адаптации.
Комментарии
Комментариев пока нет. Будьте первым.