A modern, feature-rich AI chat application with comprehensive Model Context Protocol (MCP) server management and artifact system support.
- Multi-Model Support: Seamlessly switch between multiple AI providers including OpenAI, DeepSeek, Anthropic, GLM, OpenRouter, and custom providers
- Real-time Streaming: Experience smooth, real-time conversation streaming with typing indicators
- Chat History Management: Automatically save and organize conversations with easy search and retrieval
- Reasoning Display: View AI model reasoning processes for better understanding of responses
- Message Editing: Edit and regenerate messages for improved conversation flow
- Dynamic Content Creation: AI can create and manage various types of content including code, documents, and interactive elements
- Version Control: Track and manage different versions of artifacts with easy rollback capabilities
- Multiple Preview Types: Support for code previews, HTML rendering, React components, and text artifacts
- Interactive Actions: Copy, download, refresh, and fullscreen viewing options for artifacts
- Real-time Updates: Live streaming updates for artifact creation and modification
- Multi-Protocol Support: Add and configure both SSE (Server-Sent Events) and STDIO type MCP servers
- Real-time Status Monitoring: Track server status with visual indicators (online, offline, error, connecting)
- Flexible Configuration: Customize server settings including URLs, commands, environment variables, and headers
- Connection Management: Start, stop, and restart server operations with ease
- Server Organization: Edit, delete, and organize multiple MCP server configurations
- Provider Management: Unified interface for managing multiple AI providers with API key and endpoint configuration
- Search Functionality: Powerful search capabilities across conversations and artifacts
- Responsive Design: Fully responsive interface that adapts seamlessly to desktop, tablet, and mobile devices
- Dark/Light Theme: Built-in theme support with automatic system preference detection
- Internationalization: Full i18n support with English and Chinese language options
- Code Editor: Integrated code editor with syntax highlighting for various programming languages
- Tool Integration: Support for AI tool use and function calling capabilities
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- UI: React 19, Tailwind CSS 4, shadcn/ui
- State Management: TanStack Query
- Form Handling: React Hook Form + Zod
- Database: PostgreSQL + Drizzle ORM
- AI Integration: AI SDK, multiple providers support
- Development Tools: Biome, PNPM
-
Clone the repository:
git clone <your-repository-url> cd megacloud-chat
-
Install dependencies:
pnpm install
-
Start local PostgreSQL database:
Use the provided script to start a Docker container (if Docker is installed):
./start-database.sh
Or configure a local PostgreSQL instance manually.
-
Set up environment variables:
Copy
.env.example
to.env
and fill in the necessary environment variables:cp .env.example .env
Then edit the
.env
file to configure:- Database connection string (
DATABASE_URL
) - AI model API keys
- Database connection string (
-
Database migration:
pnpm db:push
-
Start development server:
pnpm dev
Open
http://localhost:3000
in your browser. -
Other useful commands:
- Type checking:
pnpm typecheck
- Code linting:
pnpm check
- Code auto-fixing:
pnpm check:write
- Database management UI:
pnpm db:studio
- Type checking:
Multiple deployment options are supported:
- Vercel: Recommended for production environments. Deployment guide
- Netlify: Offers convenient deployment similar to Vercel. Deployment guide
- Docker: Suitable for self-hosting scenarios. Containerization guide
Contributions, issues, and feature requests are welcome. Please ensure you follow the project's code style and commit message conventions.