Skip to content

mofa-org/mofaclaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mofaclaw

mofaclaw: Ultra-Lightweight Personal AI Assistant

Rust License

🐈 mofaclaw is an ultra-lightweight personal AI assistant inspired by nanobot

⚑️ Written in Rust for maximum performance, safety, and efficiency β€” 99% smaller than Clawdbot's 430k+ lines.

πŸ“’ News

  • 2026-02-04 πŸŽ‰ mofaclaw inspired by nanobot, rewritten in Rust! Blazing fast performance with memory safety.

Key Features of mofaclaw:

πŸ¦€ Rust-Powered: Memory-safe, zero-cost abstractions, and fearless concurrency for rock-solid stability.

πŸͺΆ Ultra-Lightweight: Minimal dependencies and clean architecture β€” easy to understand and modify.

πŸ”¬ Research-Ready: Clean, readable code that's easy to understand, modify, and extend for research.

⚑️ Lightning Fast: Compiled performance with instant startup, minimal memory footprint, and efficient execution.

πŸ’Ž Easy-to-Use: Simple installation and setup β€” you're ready to go in minutes.

πŸ—οΈ Architecture

mofaclaw architecture

πŸ“¦ Install

Prerequisites

Rust (1.85+ required)

Quick install (China mirror):

# Visit https://rsproxy.cn/ for the latest installation command
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/install.sh | sh

Install from source (recommended)

# Install the CLI binary
cargo install --path cli/

# Or build and run directly
cargo run --release -- onboard

Build manually

cargo build --release
# The binary will be at target/release/mofaclaw

Install with cargo (from crates.io, coming soon)

cargo install mofaclaw

πŸš€ Quick Start

Tip

Set your API key in ~/.mofaclaw/config.json. Get API keys: OpenRouter (LLM) Β· Brave Search (optional, for web search) You can also change the model to minimax/minimax-m2 for lower cost.

1. Initialize

mofaclaw onboard

2. Configure (~/.mofaclaw/config.json)

{
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-xxx"
    }
  },
  "agents": {
    "defaults": {
      "model": "anthropic/claude-opus-4-5"
    }
  },
  "webSearch": {
    "apiKey": "BSA-xxx"
  }
}

3. Chat

mofaclaw agent -m "What is 2+2?"

That's it! You have a working AI assistant in 2 minutes.

πŸ–₯️ Local Models (vLLM)

Run mofaclaw with your own local models using vLLM or any OpenAI-compatible server.

1. Start your vLLM server

vllm serve meta-llama/Llama-3.1-8B-Instruct --port 8000

2. Configure (~/.mofaclaw/config.json)

{
  "providers": {
    "vllm": {
      "apiKey": "dummy",
      "apiBase": "http://localhost:8000/v1"
    }
  },
  "agents": {
    "defaults": {
      "model": "meta-llama/Llama-3.1-8B-Instruct"
    }
  }
}

3. Chat

mofaclaw agent -m "Hello from my local LLM!"

Tip

The apiKey can be any non-empty string for local servers that don't require authentication.

πŸ’¬ Chat Apps

Talk to your mofaclaw through DingTalk or Feishu β€” anytime, anywhere.

Channel Status
DingTalk tested
Feishu not test

Python Dependencies

DingTalk and Feishu channels require Python 3.11+ with the following packages:

DingTalk:

pip install dingtalk-stream websockets certifi

Feishu:

pip install lark-oapi websockets cryptography

Note: The gateway will automatically check and install these packages on first run. However, you may need to install them manually if you don't have write permissions to the Python environment, or prefer to manage dependencies explicitly.

To check your Python version:

python3 --version

If Python is not installed:

  • Download from: https://www.python.org/downloads/
  • On macOS: brew install python3
  • On Ubuntu/Debian: sudo apt-get install python3 python3-pip
  • On Windows: Use the Python Installer from python.org
DingTalk Configuration

1. Create a DingTalk App

2. Configure (~/.mofaclaw/config.json)

{
  "channels": {
    "dingtalk": {
      "enabled": true,
      "client_id": "YOUR_CLIENT_ID",
      "client_secret": "YOUR_CLIENT_SECRET"
    }
  }
}

3. Run

mofaclaw gateway

βš™οΈ Configuration

Config file: ~/.mofaclaw/config.json

Providers

Note

Groq provides free voice transcription via Whisper. If configured, Telegram voice messages will be automatically transcribed.

Provider Purpose Get API Key
openrouter LLM (recommended, access to all models) openrouter.ai
anthropic LLM (Claude direct) console.anthropic.com
openai LLM (GPT direct) platform.openai.com
groq LLM + Voice transcription (Whisper) console.groq.com
gemini LLM (Gemini direct) aistudio.google.com
Full config example
{
  "agents": {
    "defaults": {
      "workspace": "~/.mofaclaw/workspace",
      "model": "glm-4.7-flash",
      "max_tokens": 16000,
      "temperature": 0.7,
      "max_tool_iterations": 5
    }
  },
  "channels": {
    "dingtalk": {
      "enabled": true,
      "client_id": "YOUR_CLIENT_ID",
      "client_secret": "YOUR_CLIENT_SECRET"
    },
    "feishu": {
      "enabled": false,
      "app_id": "",
      "app_secret": "",
      "encrypt_key": "",
      "verification_token": ""
    }
  },
  "providers": {
    "anthropic": {
      "api_key": ""
    },
    "openai": {
      "api_key": ""
    },
    "openrouter": {
      "api_key": ""
    },
    "zhipu": {
      "api_base": "https://open.bigmodel.cn/api/paas/v4",
      "api_key": ""
    },
    "vllm": {
      "api_key": ""
    },
    "gemini": {
      "api_key": ""
    },
    "groq": {
      "api_key": ""
    }
  },
  "gateway": {
    "host": "0.0.0.0",
    "port": 18790
  },
  "tools": {
    "web": {
      "search": {
        "api_key": "",
        "max_results": 0
      }
    },
    "transcription": {
      "groq_api_key": ""
    }
  }
}

CLI Reference

Command Description
mofaclaw onboard Initialize config & workspace
mofaclaw agent -m "..." Chat with the agent
mofaclaw agent Interactive chat mode
mofaclaw gateway Start the gateway
mofaclaw status Show status
Scheduled Tasks (Cron)
# Add a job
mofaclaw cron add --name "daily" --message "Good morning!" --cron "0 9 * * *"
mofaclaw cron add --name "hourly" --message "Check status" --every 3600

# List jobs
mofaclaw cron list

# Remove a job
mofaclaw cron remove <job_id>

🐳 Docker

Note

Docker support coming soon for the Rust version. For now, please install from source.

# Coming soon: docker build -t mofaclaw .
# Coming soon: docker run -v ~/.mofaclaw:/root/.mofaclaw mofaclaw gateway

πŸ“ Project Structure

mofaclaw/
β”œβ”€β”€ core/           # 🧠 Core library (agent, tools, providers)
β”‚   β”œβ”€β”€ agent/      #    Agent loop, context, memory, skills
β”‚   β”œβ”€β”€ tools/      #    Built-in tools (filesystem, shell, web, spawn)
β”‚   β”œβ”€β”€ provider/   #    LLM provider clients
β”‚   β”œβ”€β”€ channels/   #    Channel integrations (DingTalk, Feishu)
β”‚   β”œβ”€β”€ bus/        #    Message routing
β”‚   β”œβ”€β”€ cron/       #    Scheduled tasks
β”‚   └── heartbeat/  #    Proactive wake-up service
β”œβ”€β”€ cli/            # πŸ–₯️ Command-line interface
β”œβ”€β”€ channels/       # πŸ“± Channel implementations
└── skills/         # 🎯 Bundled skills (github, weather, tmux...)

About

MoFA's OpenClaw

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •