OpenMacaw
The Universal, Security-First AI Guardian Agent. A cross-platform Rust application that puts a human in the loop for safe, auditable workflow automation.
Ask AI about OpenMacaw
Powered by Claude Β· Grounded in docs
I know everything about OpenMacaw. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
OpenMacaw
A self-hosted, security-first AI agent platform with granular MCP server permission control.
OpenMacaw is an open-source web-based AI agent runtime that connects to LLM providers, orchestrates MCP servers, and enforces fine-grained permission policies β all through a clean browser UI. No desktop client required. Designed as a security-hardened successor to OpenClaw.
What It Does
OpenMacaw lets you run an AI agent locally that can use tools via the Model Context Protocol (MCP). Every tool call passes through a configurable permission guard before it executes β giving you precise, auditable control over what the agent can and cannot do.
Core capabilities:
- Connect to any MCP server (stdio or HTTP/SSE transport)
- Control exactly what each server can access: paths, commands, domains, and more
- Stream agent responses and tool calls in real time via WebSocket
- Approve or deny individual tool calls with inline editing before execution
- Run autonomous agentic plans with a drag-to-reorder step editor and optional final checkpoint
- Log every tool call with timestamp, outcome, latency, and full payload
- Pipe the agent into Discord, Telegram, or LINE via the Pipelines system
- Multi-user with role-based access control (Admin / User / Pending)
Features
Authentication & Multi-User
- Email/password registration and login with bcrypt hashing
- JWT-based sessions (7-day expiry, self-healing token refresh on
/api/auth/me) - Login rate limiting (5 attempts per minute per IP/email)
- Role hierarchy: Super Admin β Admin β User β Pending
- First registered user becomes Super Admin automatically
- Configurable signup: open or admin-invite only (
ENABLE_SIGNUP,DEFAULT_NEW_USER_ROLE) - Per-user profile with avatar upload (resized to 200Γ200 WebP via Sharp)
- Per-user API key overrides (BYOK):
ANTHROPIC_API_KEY,OPENAI_API_KEYstored inuser_settings, cascaded over global keys at agent runtime
Chat Interface
- Full streaming chat with live tool call events shown inline
- Human-in-the-Loop approval cards β review and edit tool arguments before execution
- Agentic Mode β propose a multi-step plan, reorder steps by dragging, add custom steps, set a mid-run checkpoint for final review
- Auto-generated conversation titles
- Session sidebar with time-grouped buckets (Pinned / Today / Yesterday / Previous 7 Days / Older)
- Inline session rename, pin/unpin, delete, and JSON export from the context menu
- Collapsible folder groups in the sidebar
- Code blocks with one-click copy
- Collapsible tool call summaries per response (tools used, server, input)
- Hallucination detection for local Ollama models with automatic retry
- Emergency halt button β aborts all active LLM streams and disconnects MCP servers
MCP Servers
- Register stdio or HTTP/SSE servers with name, command, args, and env vars
- One-click start / stop / restart per server
- Inline edit mode for updating server config (auto-restarts on save)
- Live status badges:
running,stopped,error,unhealthy - Tool count display per server
- Auto-reconnect on startup for previously enabled servers
- Environment variable JSON editor with format/validation
- Emergency halt:
/api/mcp/haltterminates all streams and pauses all servers
Permission Editor
- Per-server permission policies stored in SQLite
- Filesystem: allowed/denied path lists with per-operation toggles (read, write, create, delete, list)
- Bash: toggle + glob-pattern allowlist for commands
- Web Fetch: toggle + optional domain allowlist
- Network & Subprocess: individual toggles
- Rate Limits: max calls per minute and max tokens per call
- Prompt Injection Prevention (PIP): server-wide toggle with per-tool overrides (inherit / enable / disable)
- Auto-Approve Reads (Trust Policy): trusted-path zone for safe read-only tools that skip the approval prompt
- Env var read access is permanently hardcoded
falsein the evaluator β not overridable by anyone - Auto-saves on every change with toast confirmation
MCP Catalog
- Curated library of popular MCP servers (Filesystem, Fetch, Memory, Brave Search, GitHub, GitLab, Slack, PostgreSQL, Puppeteer, Google Maps, and more)
- Live integration with the official MCP Registry (paginated, cached 5 min)
- One-click Add & Start installs the server and connects it immediately
- Detects already-installed servers
- Required environment variable keys highlighted per entry
- Search and free-text filtering across title, description, and package name
Audit Log
- Live feed of every tool call across all sessions
- Columns: timestamp, tool name, target server, outcome (
ALLOWED/β‘ AUTO/403 DENIED), latency - Click any row to expand the full input payload and denial reason
- Filter by server, outcome, or free-text search
- Auto-refreshes every 3 seconds
Pipelines
- Connect the agent to external chat platforms without code changes
- Discord β bot responds in a channel or DM; supports per-reaction approval gate
- Telegram β long-polling bot with optional chat ID allowlist
- LINE β inbound webhook with signature verification
- Each pipeline shares a conversation session and runs the agent in auto-execute mode
- Start, stop, restart, and edit config without redeploying
Settings & Admin
- Per-user API key overrides for Anthropic and OpenAI (server keys used as fallback)
- Global workspace settings: default model, temperature, max steps, personality/system prompt, signup policy β Super Admin only
- Admin Panel (
/admin): user management, role assignment, platform stats (user count, session count, DB size) - Self-healing JWT: fresh token issued on every
/api/auth/mecall reflecting current DB role - Password change via Settings page; Admin can reset other users' passwords
LLM Providers
- Anthropic (Claude) β full streaming, native tool use blocks
- OpenAI (GPT-4o, o-series) β streaming with tool calls
- Ollama β local model support with hallucination retry loop
Security Pipeline
Every MCP tool call is evaluated through a multi-stage PermissionGuard before execution:
- Server registered & running? β DENY if not
- Filesystem path checks: denied-path list β allowed-path list β per-operation flags (read/write/create/delete)
- Bash command glob matching: against user-configured allowlist patterns
- Web fetch domain filtering: against optional domain allowlist
- Subprocess / network toggles
- Env var access: hardcoded DENY, not user-configurable
- Trust Policy: safe read-only tools in trusted paths β
ALLOW_SILENT(skip approval prompt) - Prompt Injection Prevention (PIP): scrubs tool results to strip embedded instructions
All denials are logged to the activity log with full context and surfaced in real time to the UI.
Deployment
Docker (Recommended)
Prerequisites: Docker v20+ and Docker Compose.
-
Clone the repository:
git clone https://github.com/OpenMacaw/OpenMacaw.git cd OpenMacaw -
Create a
.envfile:AUTH_TOKEN=your_secret_token ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... OLLAMA_BASE_URL=http://localhost:11434 DEFAULT_MODEL=claude-sonnet-4-5-20250929 DEFAULT_PROVIDER=anthropic ENABLE_SIGNUP=true DEFAULT_NEW_USER_ROLE=pendingVariable Default Description AUTH_TOKEN(none) Legacy static token (superseded by JWT login) ANTHROPIC_API_KEY(none) Anthropic API key (workspace default) OPENAI_API_KEY(none) OpenAI API key (workspace default) OLLAMA_BASE_URLhttp://localhost:11434Ollama server URL DEFAULT_MODELclaude-sonnet-4-5-20250929Default LLM model DEFAULT_PROVIDERanthropicDefault LLM provider ENABLE_SIGNUPtrueAllow new user registration DEFAULT_NEW_USER_ROLEpendingRole assigned to new signups ( userorpending)MAX_STEPS50Max agentic loop iterations TEMPERATURE1.0LLM temperature -
Start:
docker compose up -dThe app is available at http://localhost:3000. Data persists in
./data. -
Stop:
docker compose down
Manual Docker Build
docker build -t openmacaw .
docker run -d \
-p 3000:3000 \
-v $(pwd)/data:/data \
-e ANTHROPIC_API_KEY=sk-ant-... \
--restart unless-stopped \
openmacaw
On Windows PowerShell, replace
$(pwd)with${PWD}.
Local Development
npm install
npm run dev # starts both server (port 3000) and web (port 5173) with hot reload
Tech Stack
| Layer | Technology |
|---|---|
| Backend | Node.js 20+, Fastify, TypeScript (strict mode) |
| MCP | @modelcontextprotocol/sdk |
| Database | SQLite via better-sqlite3 + Drizzle ORM |
| Frontend | React 18, Vite, Tailwind CSS v3, shadcn/ui |
| State | Zustand + React Query |
| Auth | JWT (@fastify/jwt) + bcrypt |
| Streaming | Native WebSocket |
| Image Processing | Sharp (avatar uploads) |
Project Structure
/
βββ packages/
β βββ server/src/
β β βββ agent/ # Agentic loop, planner, session management, tool interceptor
β β βββ db/ # Drizzle schema, migrations, raw SQLite wrapper
β β βββ llm/ # Anthropic, OpenAI, Ollama adapters
β β βββ mcp/ # MCP client, server registry
β β βββ permissions/ # PermissionGuard evaluator + SQLite store
β β βββ pipelines/ # Discord, Telegram, LINE pipeline runners
β β βββ routes/ # Fastify REST + WebSocket routes
β βββ web/src/
β βββ pages/ # Chat, Servers, Catalog, Permissions, Pipelines, Admin, Settings, etc.
β βββ components/ # Shared UI components (ServerPermissionDrawer, UserMenu, etc.)
β βββ contexts/ # AuthContext
βββ Dockerfile
βββ docker-compose.yml
βββ AGENTS.md # Coding standards and architecture reference
βββ SECURITY_HARDENING.md # Threat model and hardening decisions
βββ PROMPT_INJECTION_LAYER.md # PIP implementation details
Roadmap
Completed
- Streaming agent runtime with Planner-Executor architecture
- MCP client with stdio and HTTP/SSE transports
- PermissionGuard with filesystem, bash, web, subprocess, and rate limit policies
- Prompt Injection Prevention (PIP) with per-tool overrides
- Auto-approve reads (Trust Policy) for trusted path zones
- Real-time WebSocket chat with inline tool call approval UI
- Agentic mode with drag-to-reorder plan editor and mid-run checkpoint
- Activity audit log with search, filter, and payload inspection
- Discord, Telegram, and LINE pipeline integrations
- MCP Catalog with curated list + live official MCP Registry integration
- Hallucination detection and retry for Ollama models
- Multi-user system: registration, login, roles (Super Admin / Admin / User / Pending)
- Per-user BYOK API keys with cascade resolution (user β global β env)
- Admin panel: user management, role control, platform stats
- Session sidebar with time-grouped buckets, pin, rename, delete, export
- Emergency halt β abort all streams and disconnect all MCP servers
In Progress / Planned
- Chat history page β paginated view to prevent sidebar overflow on high session counts
- Full multi-tenant isolation β per-user MCP servers, permissions, audit logs, and pipelines
- Open WebUI compatibility β tools, functions, prompts, and models API surface
- Sandbox mode β isolated execution environments for high-risk tool calls
- Enhanced canary token leak detection pipeline
- Session search and tagging
- Marketplace β community MCP server sharing
Inspired by OpenClaw. Reimagined for safety, precision, and multi-user deployments.
