Open-source general AI agent powered by Claude Agent SDK with sandboxed code execution, in-browser IDE, and extensible capabilities.
Try it live: claudex.pro — add your own API keys and start using it immediately.
- Real-time streaming responses via Server-Sent Events (SSE)
- Multiple Claude models (Haiku, Sonnet, Opus) via Anthropic, Z.AI, and OpenRouter
- Chat history with automatic title generation
- File attachments (images, PDFs, Excel files up to 5MB)
- Token usage tracking and context management
- Live code execution powered by E2B
- Integrated VS Code editor in the browser
- Terminal access with full PTY support
- File system management and port forwarding
- Environment checkpoints and snapshots
- Claude Agent SDK integration for agentic workflows
- Tool use with streaming execution results
- Permission-based modes (plan, ask, auto)
- Extended thinking with configurable token allocation
- Custom Skills - Extensible skill packages (ZIP format with YAML metadata)
- Custom Agents - Define agents with specific tool configurations
- Slash Commands - Built-in commands (
/context,/compact,/review,/init) - MCP Support - Model Context Protocol servers (NPX, BunX, UVX, HTTP)
- Task Scheduling - Automated recurring tasks with Celery
- JWT authentication with refresh tokens
- Encrypted credential storage (Fernet)
- Rate limiting and CORS protection
- Security headers (HSTS, CSP, X-Frame-Options)
- Docker and Docker Compose
git clone https://github.com/Mng-dev-ai/claudex.git
cd claudex
docker compose up -d| Service | Port |
|---|---|
| Frontend | 3000 |
| Backend API | 8080 |
| PostgreSQL | 5432 |
| Redis | 6379 |
All defaults work out of the box for development. For sandbox and AI features, configure these per-user in the settings UI:
| Setting | Description |
|---|---|
| E2B API Key | E2B sandbox API key for code execution |
| Claude OAuth Token | For Anthropic models via Claude Code |
| Z.AI API Key | For models via Z.AI (Anthropic-compatible API) |
| OpenRouter API Key | For models via OpenRouter |
You only need one of the AI provider keys (Claude OAuth, Z.AI, or OpenRouter) depending on which models you want to use.
The permission system uses an MCP server running inside the E2B sandbox that makes HTTP requests back to your backend API. Since E2B sandboxes run remotely, they cannot reach localhost.
For permission prompts to work locally, expose your backend via a tunnel:
# Using ngrok
ngrok http 8080
# Using Cloudflare Tunnel
cloudflared tunnel --url http://localhost:8080Then set the BASE_URL environment variable to your tunnel URL:
BASE_URL=https://your-tunnel-url.ngrok.io docker compose up -d┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │────▶│ FastAPI │────▶│ PostgreSQL │
│ React/Vite │ │ Backend │ │ Database │
└─────────────────┘ └────────┬────────┘ └─────────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Redis │ │ Celery │ │ E2B │
│ Pub/Sub │ │ Workers │ │ Sandbox │
└───────────┘ └───────────┘ └───────────┘
- SSE Streaming - Real-time chat responses via Server-Sent Events
- Redis Pub/Sub - Cross-worker communication for streaming
- Celery Tasks - Background chat processing and task scheduling
- JWT Auth - Access tokens (15min) + refresh tokens (30 days)
- Async SQLAlchemy - Non-blocking database operations
- React 19 with TypeScript 5.7
- Vite for builds
- TailwindCSS for styling
- Zustand for state management
- React Query for server state
- Monaco Editor for code editing
- XTerm.js for terminal emulation
- FastAPI with async/await
- Python 3.13
- SQLAlchemy 2.0 with async PostgreSQL
- Celery for background tasks
- Redis for caching and pub/sub
- Granian ASGI server
claudex/
├── backend/
│ ├── app/
│ │ ├── api/endpoints/ # API route handlers
│ │ ├── core/ # Config, security, middleware
│ │ ├── models/
│ │ │ ├── db_models/ # SQLAlchemy ORM models
│ │ │ └── schemas/ # Pydantic schemas
│ │ ├── services/ # Business logic layer
│ │ ├── tasks/ # Celery background tasks
│ │ └── admin/ # SQLAdmin configuration
│ ├── migrations/ # Alembic migrations
│ └── tests/ # Pytest test suite
├── frontend/
│ └── src/
│ ├── components/ # React components
│ │ ├── chat/ # Chat UI
│ │ ├── editor/ # Code editor
│ │ └── ui/ # Reusable primitives
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Route pages
│ ├── services/ # API clients
│ └── store/ # Zustand stores
└── docker-compose.yml
| Model | Description |
|---|---|
User |
User accounts with profile data |
UserSettings |
API keys, preferences, custom configurations |
Chat |
Conversation containers |
Message |
Individual messages (user/assistant roles) |
MessageAttachment |
File attachments |
AIModel |
Available AI models with provider info |
ScheduledTask |
Recurring automated tasks |
# Start all services
docker compose up -d
# Stop all services
docker compose down
# View logs
docker compose logs -f api
# Run tests
docker compose -f docker-compose.test.yml run --rm backend-test pytestWhen running, access the API docs at http://localhost:8080/api/v1/docs
SQLAdmin panel for database management: http://localhost:8080/admin
Default credentials (seeded on first run):
- Email:
admin@example.com - Password:
admin123
Use the admin panel to manage users, chats, and add AI models (Anthropic, Z.AI, OpenRouter).
To customize admin credentials, set environment variables before first run:
ADMIN_EMAIL=your@email.com ADMIN_USERNAME=yourusername ADMIN_PASSWORD=yourpassword docker compose up -d- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes
- Push to the branch
- Open a Pull Request
MIT - see LICENSE

