CarrotAI is a cutting-edge AI agent application that delivers real-time streaming chat via Server-Sent Events (SSE) with built-in Model Control Protocol (MCP) integration. It supports concurrent connections to multiple SSE MCP servers and provides user interfaces in English, Chinese, and Japanese.
Flutter Frontend + FastAPI Backend
🚀 Experience online now | SaaS Client download
🇨🇳 阅读中文文档
CarrotAI is a cutting-edge AI agent application that delivers real-time streaming chat via Server-Sent Events (SSE) and streamable HTTP with built-in Model Control Protocol (MCP) integration. It supports concurrent connections to multiple SSE MCP servers and provides user interfaces in English, Chinese, and Japanese.
dynamic_color
.Please make sure that it has been installed. uv
# Clone repository
git clone https://github.com/Xingsandesu/CarrotAI.git && cd CarrotAI
# Deal with environment variables
mv backend/.env.example backend/.env && mv .env.example .env
# Edit environment variables
vim .env
vim backend/.env
# Temporarily start PostgreSQL
docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d postgres
# Backend setup
uv run backend/scripts/startup.py --user --email <email> --username <name> --password <password>
# Stop PostgreSQL
docker-compose -f docker-compose.yml -f docker-compose.override.yml down
# Deal with Config
vim config/
# Run Backend
docker compose up -d
cd backend
uv sync
cp .env.example .env
uv run scripts/init_db.py && uv run scripts/init_config.py
python main.py # Development mode
python main.py prod # Production mode with Gunicorn
cd ..
flutter pub get
flutter gen-l10n
flutter run
flutter build web --wasm
lib/core/config/app_config.dart
for API endpoints and theming defaults..env
and backend/app/core/config.py
for database, and MCP servers.The backend uses JSON files located in backend/config/
to define models, MCP servers, and custom adapters. Below is the default folder structure:
backend/config/
├── model_configs.json # LLM model definitions and metadata
├── mcp_servers.json # SSE MCP server endpoints and env settings
└── app/ # Custom adapter definitions
└── duckduckgo-search.json
Defines available LLM models for CarrotAI. Each entry includes:
id
(string): Unique model identifier.icon
(string): Icon name for display.translations
(object): Localized names and descriptions (zh
, en
, ja
).exclusiveRules
(object): Toggles and exclusion rules for features.Example:
[
{
"id": "deepseek",
"icon": "smart_toy_outlined",
"translations": {
"zh": { "name": "DeepSeek", "description": "专注于深度思考和复杂推理的满血模型" },
"en": { "name": "DeepSeek", "description": "Powerful Chinese large model focused on deep thinking and complex reasoning" },
"ja": { "name": "DeepSeek", "description": "深い思考と複雑な推論に特化した強力な中国語大規模モデル" }
},
"exclusiveRules": {
"deepThinking": { "enabled": true, "excludes": ["mcpServices"] },
"mcpServices": { "enabled": true, "excludes": ["deepThinking"] }
}
}
]
Specifies SSE Model Control Protocol (MCP) endpoints. Format:
url
(string): SSE endpoint URL.env
(object): Environment variables for the adapter.Example:
{
"serviceA": {
"url": "http://localhost:10000/sse",
"env": {
"API_KEY": "your_api_key"
}
}
}
app/*.json
)Place custom MCP adapters in backend/config/app/
. Each file defines:
id
(string): Adapter identifier.icon
(string): Emoji or icon name.mcpServer
(object): Same structure as entries in mcp_servers.json
.translations
(object): Localized UI metadata.Example (duckduckgo-search.json
):
{
"id": "duckduckgo-search",
"icon": "🔍",
"mcpServer": {
"url": "http://localhost:10000/duckduckgo-search",
"env": {}
},
"transportType": "sse",
"translations": {
"en": { "name": "DuckDuckGo Search", "type": "Search Tool", "description": "Use DuckDuckGo search engine for secure and private web searches" },
"zh": { "name": "DuckDuckGo搜索", "type": "搜索工具", "description": "使用DuckDuckGo搜索引擎进行安全、私密的网络搜索" },
"ja": { "name": "DuckDuckGo検索", "type": "検索ツール", "description": "DuckDuckGo検索エンジンを使用して安全でプライベートなウェブ検索を行います" }
}
}
uv run scripts/init_config.py
backend/config/
to add or update models and endpoints.Backend (.env)
Key | Description | Default |
---|---|---|
DATABASE_URL | PostgreSQL connection URL | required |
BACKEND_CORS_ORIGINS | Allowed CORS origins (comma-separated) | [] |
MCP_SERVERS | JSON list of SSE MCP server endpoints | required |
SECRET_KEY | JWT secret key | required |
Frontend (lib/core/config/app_config.dart)
static String get baseUrl => "http://127.0.0.1:8000";
Access the interactive Swagger UI at:
http://127.0.0.1:8000/docs
BACKEND_CORS_ORIGINS
in .env
.SECRET_KEY
in .env
; ensure no secrets are committed to source control.gunicorn.conf.py
; access and error logs in logs/
.debugPrint
in release mode.--wasm
for optimized delivery.All notable changes are documented in CHANGELOG.md.
Contributions are welcome! Please open a Pull Request with your suggestions.
This project is licensed under the CarrotAI Open Source License. See the LICENSE file for details.
No configuration available
Related projects feature coming soon
Will recommend related projects based on sub-categories