Skip to content
Back to search

CarrotAI

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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/xingsandesu--carrotai/badge.svg)](/listings/xingsandesu--carrotai)

HTML

<a href="/listings/xingsandesu--carrotai"><img src="/api/listings/xingsandesu--carrotai/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

> Please make sure that it has been installed. [uv](https://docs.astral.sh/uv/getting-started/installation/)

# 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

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 328 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # CarrotAI
  2. <div align="center">
  3. <img src="public/icon.png" alt="CarrotAI Logo" width="200"/>
  4. <h3>AI Agent with Multi-Server Streaming & Multi-Language Support</h3>
  5. <p>Flutter Frontend + FastAPI Backend</p>
  6. </div>
  7. <p align="center">
  8. 🚀 <a href="https://chat.jintongshu.com/">Experience online now</a> | <a href="https://jintongshu.com/download/">SaaS Client download</a>
  9. </p>
  10. <p align="center">
  11. 🇨🇳 <a href="README_zh.md">阅读中文文档</a>
  12. </p>
  13. ---
  14. ## 🥕 Introduction
  15. 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.
  16. ## 🚀 Features
  17. - **AI Agent**: Real-time chat powered by SSE and MCP adapters for a seamless conversational experience.
  18. - **Multi-Server Support**: Connect to and call multiple SSE MCP servers simultaneously to aggregate intelligent responses.
  19. - **Multi-Language**: Full localization in English, 中文 (Chinese), and 日本語 (Japanese).
  20. - **Deep Thinking Mode**: Advanced analysis for complex or multi-step queries.
  21. - **Authentication**: Secure login/register flow using JWT tokens.
  22. - **Responsive UI**: Adaptive design for mobile, desktop, and web platforms.
  23. - **Theme Customization**: Light/dark mode, custom seed colors, and dynamic Material 3 theming via `dynamic_color`.
  24. - **File Upload**: Attach and parse files within conversations for richer context.
  25. ## 🤖 Supported Model APIs
  26. - **DeepSeek**: Advanced language model with strong reasoning capabilities
  27. ## 🛠️ Tech Stack
  28. ### Frontend
  29. - **Framework**: Flutter
  30. - **State Management**: Provider
  31. - **UI**: Material Design 3
  32. - **Localization**: flutter gen-l10n
  33. - **Theming**: dynamic_color
  34. ### Backend
  35. - **Framework**: FastAPI
  36. - **Streaming**: Server-Sent Events (SSE)
  37. - **AI Integration**: DeepSeek LLM, MCP (Model Control Protocol)
  38. - **Database**: PostgreSQL + SQLAlchemy
  39. - **Authentication**: JSON Web Tokens
  40. - **Migrations**: Alembic
  41. - **Deployment**: Uvicorn & Gunicorn
  42. ## 📋 Prerequisites
  43. - Flutter SDK ^3.7.2
  44. - Python >=3.12
  45. - PostgreSQL
  46. ## ⚡ Quick Start
  47. > Please make sure that it has been installed. [uv](https://docs.astral.sh/uv/getting-started/installation/)
  48. ```bash
  49. # Clone repository
  50. git clone https://github.com/Xingsandesu/CarrotAI.git && cd CarrotAI
  51. # Deal with environment variables
  52. mv backend/.env.example backend/.env && mv .env.example .env
  53. # Edit environment variables
  54. vim .env
  55. vim backend/.env
  56. # Temporarily start PostgreSQL
  57. docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d postgres
  58. # Backend setup
  59. uv run backend/scripts/startup.py --user --email <email> --username <name> --password <password>
  60. # Stop PostgreSQL
  61. docker-compose -f docker-compose.yml -f docker-compose.override.yml down
  62. # Deal with Config
  63. vim config/
  64. # Run Backend
  65. docker compose up -d
  66. ```
  67. ## 🔧 Installation
  68. ### Backend Setup
  69. 1. Navigate to the backend directory:
  70. ```bash
  71. cd backend
  72. ```
  73. 2. Create and activate a virtual environment:
  74. ```bash
  75. uv sync
  76. ```
  77. 3. Copy the example environment file:
  78. ```bash
  79. cp .env.example .env
  80. ```
  81. 4. Apply database migrations:
  82. ```bash
  83. uv run scripts/init_db.py && uv run scripts/init_config.py
  84. ```
  85. 6. Run the server:
  86. ```bash
  87. python main.py # Development mode
  88. python main.py prod # Production mode with Gunicorn
  89. ```
  90. ### Frontend Setup
  91. 1. Return to the project root:
  92. ```bash
  93. cd ..
  94. ```
  95. 2. Fetch Flutter dependencies:
  96. ```bash
  97. flutter pub get
  98. ```
  99. 3. Generate localization files:
  100. ```bash
  101. flutter gen-l10n
  102. ```
  103. 4. Launch the app:
  104. ```bash
  105. flutter run
  106. ```
  107. 5. Build for web:
  108. ```bash
  109. flutter build web --wasm
  110. ```
  111. ## 🌐 Configuration
  112. - **Frontend**: Edit `lib/core/config/app_config.dart` for API endpoints and theming defaults.
  113. - **Backend**: Configure `.env` and `backend/app/core/config.py` for database, and MCP servers.
  114. ### Backend Configuration Files
  115. The backend uses JSON files located in `backend/config/` to define models, MCP servers, and custom adapters. Below is the default folder structure:
  116. ```text
  117. backend/config/
  118. ├── model_configs.json # LLM model definitions and metadata
  119. ├── mcp_servers.json # SSE MCP server endpoints and env settings
  120. └── app/ # Custom adapter definitions
  121. └── duckduckgo-search.json
  122. ```
  123. #### model_configs.json
  124. Defines available LLM models for CarrotAI. Each entry includes:
  125. - `id` (string): Unique model identifier.
  126. - `icon` (string): Icon name for display.
  127. - `translations` (object): Localized names and descriptions (`zh`, `en`, `ja`).
  128. - `exclusiveRules` (object): Toggles and exclusion rules for features.
  129. Example:
  130. ```json
  131. [
  132. {
  133. "id": "deepseek",
  134. "icon": "smart_toy_outlined",
  135. "translations": {
  136. "zh": { "name": "DeepSeek", "description": "专注于深度思考和复杂推理的满血模型" },
  137. "en": { "name": "DeepSeek", "description": "Powerful Chinese large model focused on deep thinking and complex reasoning" },
  138. "ja": { "name": "DeepSeek", "description": "深い思考と複雑な推論に特化した強力な中国語大規模モデル" }
  139. },
  140. "exclusiveRules": {
  141. "deepThinking": { "enabled": true, "excludes": ["mcpServices"] },
  142. "mcpServices": { "enabled": true, "excludes": ["deepThinking"] }
  143. }
  144. }
  145. ]
  146. ```
  147. #### mcp_servers.json
  148. Specifies SSE Model Control Protocol (MCP) endpoints. Format:
  149. - Keys: service names.
  150. - `url` (string): SSE endpoint URL.
  151. - `env` (object): Environment variables for the adapter.
  152. Example:
  153. ```json
  154. {
  155. "serviceA": {
  156. "url": "http://localhost:10000/sse",
  157. "env": {
  158. "API_KEY": "your_api_key"
  159. }
  160. }
  161. }
  162. ```
  163. #### Custom Adapters (`app/*.json`)
  164. Place custom MCP adapters in `backend/config/app/`. Each file defines:
  165. - `id` (string): Adapter identifier.
  166. - `icon` (string): Emoji or icon name.
  167. - `mcpServer` (object): Same structure as entries in `mcp_servers.json`.
  168. - `translations` (object): Localized UI metadata.
  169. Example (`duckduckgo-search.json`):
  170. ```json
  171. {
  172. "id": "duckduckgo-search",
  173. "icon": "🔍",
  174. "mcpServer": {
  175. "url": "http://localhost:10000/duckduckgo-search",
  176. "env": {}
  177. },
  178. "transportType": "sse",
  179. "translations": {
  180. "en": { "name": "DuckDuckGo Search", "type": "Search Tool", "description": "Use DuckDuckGo search engine for secure and private web searches" },
  181. "zh": { "name": "DuckDuckGo搜索", "type": "搜索工具", "description": "使用DuckDuckGo搜索引擎进行安全、私密的网络搜索" },
  182. "ja": { "name": "DuckDuckGo検索", "type": "検索ツール", "description": "DuckDuckGo検索エンジンを使用して安全でプライベートなウェブ検索を行います" }
  183. }
  184. }
  185. ```
  186. #### Usage
  187. 1. Initialize default configurations:
  188. ```bash
  189. uv run scripts/init_config.py
  190. ```
  191. 2. Modify JSON files under `backend/config/` to add or update models and endpoints.
  192. 3. Restart the backend server to apply changes.
  193. ## 🔧 Environment Variables
  194. **Backend (.env)**
  195. | Key | Description | Default |
  196. |----------------------|----------------------------------------|-----------|
  197. | DATABASE_URL | PostgreSQL connection URL | *required*|
  198. | BACKEND_CORS_ORIGINS | Allowed CORS origins (comma-separated) | [] |
  199. | MCP_SERVERS | JSON list of SSE MCP server endpoints | *required*|
  200. | SECRET_KEY | JWT secret key | *required*|
  201. **Frontend (lib/core/config/app_config.dart)**
  202. ```dart
  203. static String get baseUrl => "http://127.0.0.1:8000";
  204. ```
  205. ## 💡 Usage
  206. 1. Launch backend and frontend as shown in Quick Start.
  207. 2. Open the app in your browser or mobile emulator.
  208. 3. Register or login to obtain a JWT token.
  209. 4. Use deep thinking mode or default chat mode to interact with the AI agent.
  210. 5. Switch between MCP servers or add new endpoints under Settings.
  211. ## 🔗 API Reference
  212. Access the interactive Swagger UI at:
  213. ```
  214. http://127.0.0.1:8000/docs
  215. ```
  216. ## 🛣️ Roadmap
  217. - [x] SSE multi-server support
  218. - [x] Multi-language (EN, 中文, 日本語)
  219. - [x] Docker Compose setup
  220. - [x] streamable HTTP support
  221. - [ ] Local Stdio multi-server support
  222. - [ ] Local OCR support
  223. - [ ] Support for more formats of the upload interface
  224. - [ ] Frontend custom prompts
  225. - [ ] More model support
  226. - [ ] More language support
  227. ## 🛡️ Security
  228. - **Authentication**: All backend endpoints secured with JWT; tokens stored securely in encrypted storage.
  229. - **Data Protection**: Use HTTPS in production; configure allowed CORS origins via `BACKEND_CORS_ORIGINS` in `.env`.
  230. - **Secret Management**: Define `SECRET_KEY` in `.env`; ensure no secrets are committed to source control.
  231. ## 🔍 Monitoring & Logging
  232. - **Server Logs**: Configured in `gunicorn.conf.py`; access and error logs in `logs/`.
  233. - **Application Logs**: Uses Loguru for structured logging; frontend disables `debugPrint` in release mode.
  234. ## 🚀 Performance & Optimization
  235. - **Caching**: Frontend caches static assets; backend uses async connection pooling for PostgreSQL.
  236. - **Bundle Size**: Web artifact built with `--wasm` for optimized delivery.
  237. ## 🗂️ Changelog
  238. > All notable changes are documented in [CHANGELOG.md](CHANGELOG.md).
  239. ## 📱 Screenshots
  240. <div align="center">
  241. <img src="images/home.png" width="280"/>
  242. <img src="images/shop.png" width="280"/>
  243. <img src="images/env.png" width="280"/>
  244. <img src="images/chat.png" width="280"/>
  245. <img src="images/myapps.png" width="280"/>
  246. <img src="images/settings.png" width="280"/>
  247. </div>
  248. ## 🤝 Contributing
  249. Contributions are welcome! Please open a Pull Request with your suggestions.
  250. ## 📄 License
  251. This project is licensed under the CarrotAI Open Source License. See the [LICENSE](LICENSE) file for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.