A personal AI assistant with persistent memory and tool capabilities, powered by Discord. The assistant's name is Clara.
- Discord Interface - Full-featured Discord bot with streaming responses and reply chains
- Persistent Memory - User and project memories via mem0
- MCP Plugin System - Install and use tools from external MCP servers (similar to Claude Code's
/plugins) - Code Execution - Sandboxed Python/Bash via local Docker or remote VPS
- Web Search - Real-time web search via Tavily
- File Management - Local file storage with S3 sync support
- GitHub/Azure DevOps - Repository, issue, PR, and pipeline management
- Google Workspace - Sheets, Drive, Docs, and Calendar via OAuth
- Email Monitoring - Watch for important emails and send Discord alerts
- Claude Code Integration - Delegate complex coding tasks to Claude Code agent
- Multiple LLM Backends - OpenRouter, NanoGPT, Anthropic, or custom OpenAI-compatible endpoints
- Model Tiers - Dynamic model selection via message prefixes (
!high,!mid,!low)
- Python 3.11+
- Poetry
- Docker (optional, for code execution sandbox)
- Discord bot token
# Clone and install
git clone https://github.com/BangRocket/mypalclara.git
cd mypalclara
poetry install
# Configure environment
cp .env.example .env
# Edit .env with your API keys# Run Discord bot locally
poetry run python discord_bot.py
# Or with Docker
docker-compose --profile discord up| Variable | Description |
|---|---|
DISCORD_BOT_TOKEN |
Discord bot token |
OPENAI_API_KEY |
Required for mem0 embeddings |
LLM_PROVIDER |
openrouter, nanogpt, anthropic, or openai |
OpenRouter (default):
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=your-key
OPENROUTER_MODEL=anthropic/claude-sonnet-4Anthropic (native SDK, recommended for Claude proxies like clewdr):
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=your-key
ANTHROPIC_MODEL=claude-sonnet-4-5
ANTHROPIC_BASE_URL=https://custom-proxy.example.com # OptionalNanoGPT:
LLM_PROVIDER=nanogpt
NANOGPT_API_KEY=your-key
NANOGPT_MODEL=moonshotai/Kimi-K2-Instruct-0905Custom OpenAI-compatible:
LLM_PROVIDER=openai
CUSTOM_OPENAI_API_KEY=your-key
CUSTOM_OPENAI_BASE_URL=https://api.openai.com/v1
CUSTOM_OPENAI_MODEL=gpt-4oClara supports dynamic model selection via message prefixes:
!highor!opus- High tier (most capable)!midor!sonnet- Mid tier (balanced) - default!low,!haiku, or!fast- Low tier (fast/cheap)
Configure tier-specific models:
ANTHROPIC_MODEL_HIGH=claude-opus-4-5
ANTHROPIC_MODEL_MID=claude-sonnet-4-5
ANTHROPIC_MODEL_LOW=claude-haiku-4-5| Variable | Description |
|---|---|
TAVILY_API_KEY |
Enable web search |
GITHUB_TOKEN |
Enable GitHub integration |
AZURE_DEVOPS_ORG / AZURE_DEVOPS_PAT |
Enable Azure DevOps integration |
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
Enable Google Workspace integration |
ANTHROPIC_API_KEY |
Enable Claude Code agent |
ENABLE_GRAPH_MEMORY=true |
Enable relationship tracking (Neo4j/Kuzu) |
Clara can extend its capabilities by installing MCP (Model Context Protocol) servers. This is similar to Claude Code's /plugins command.
MCP servers can be installed from multiple sources:
npm packages:
@Clara install the MCP server @modelcontextprotocol/server-everything
GitHub repos:
@Clara install MCP server from github.com/modelcontextprotocol/servers
Docker images:
@Clara install MCP server from ghcr.io/example/mcp-server:latest
Once installed, MCP tools are automatically available. Tools use namespaced names:
- Format:
{server_name}__{tool_name} - Example:
everything__echo,filesystem__read_file
| Command | Description |
|---|---|
mcp_list |
List all installed servers and their tools |
mcp_status |
Get detailed status of servers |
mcp_install |
Install a new MCP server |
mcp_uninstall |
Remove an installed server |
mcp_enable / mcp_disable |
Toggle servers without uninstalling |
mcp_restart |
Restart a running server |
Admin operations (install, uninstall, enable, disable, restart) require one of:
- Discord Administrator permission
- Manage Channels permission
- Clara-Admin role
Clara uses mem0 for persistent memory with vector search (pgvector/Qdrant) and optional graph storage (Neo4j/Kuzu).
# Generate memory JSON (dry run)
poetry run python -m src.bootstrap_memory
# Apply to mem0
poetry run python -m src.bootstrap_memory --applypoetry run python clear_dbs.py # With prompt
poetry run python clear_dbs.py --yes # Skip prompt
poetry run python clear_dbs.py --user <id> # Specific userClara can interact with Google Sheets, Drive, Docs, and Calendar using per-user OAuth.
- Create OAuth 2.0 credentials in Google Cloud Console
- Enable Google Sheets, Drive, Docs, Calendar, and Gmail APIs
- Deploy the API service and configure redirect URI
- Set environment variables:
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=https://your-api.up.railway.app/oauth/google/callback
CLARA_API_URL=https://your-api.up.railway.appUsers connect their Google account via Discord:
@Clara connect my Google account
The repo includes railway.toml for one-click deployment:
- Connect your GitHub repo to Railway
- Set environment variables in Railway dashboard
- Deploy
# Run with PostgreSQL databases
docker-compose --profile discord --profile postgres upSet these for PostgreSQL:
DATABASE_URL=postgresql://user:pass@host:5432/clara_main
MEM0_DATABASE_URL=postgresql://user:pass@host:5432/clara_vectorsThe backup_service/ directory contains an automated backup service for S3-compatible storage:
cd backup_service
docker-compose up -dpoetry run ruff check . # Lint
poetry run ruff format . # Format
poetry run pytest # TestSee CLAUDE.md for detailed development documentation.
PolyForm Noncommercial 1.0.0 - Free for non-commercial use. Commercial use requires a separate license.