AM

antiv/mate

Developer tools
112 stars 25 forks Quality 79 Trend 21Apache-2.0

Self-hosted, on Google ADK or LangGraph, with any of 50+ LLM providers.

Overview

Self-hosted, on Google ADK or LangGraph, with any of 50+ LLM providers.

README

Run it in one command:

docker run -d -p 8000:8000 -e AUTH_PASSWORD=change-me -e GOOGLE_API_KEY=your-key ghcr.io/antiv/mate:latest
# open http://localhost:8000 and log in as admin / change-me

(Add -v mate-data:/app/data -e DB_PATH=data/my_agent_data.db to keep your agents across restarts — see Quick Start.)

Used in production

  • Goal Navigator runs on MATE in production — case study.
  • MVP-Soft, LLC, a US software consultancy, builds with MATE — MATE at MVP-Soft.

What you get

  • 🎨 Build without code — draw agent hierarchies, attach tools and MCP servers, and edit prompts on a canvas. Every change is live, versioned and one click from a rollback.
  • 🏛️ Govern production — RBAC per agent, cost in US dollars per agent and project, budgets that warn or block, guardrails, alerts to Slack, Discord, email or a webhook, and audit logs.
  • 🧪 Ship without regressions — eval suites scored by exact match, similarity or an LLM judge, a regression webhook, and a Playground that compares models and prompts side by side.
  • 🔌 Plug in anywhere — an embeddable chat widget, an OpenAI-compatible API, A2A, and every agent served as an MCP server.

Created by Ivan Antonijević. If MATE saves you a redeploy, give it a ⭐ — it is how other people find it.


Try it without installing anything

These run on a live MATE instance. No signup, no install.

The dashboard behind them needs an account — everything below sets up your own instance, which behaves the same way.


The Problem with Agents in Production

You built an agent. Now you need to tune the prompt. Swap the model. Restrict access for specific users. Figure out what it’s actually costing you. And make sure yesterday’s behavior still works after today’s changes.

Without a control layer, every one of those is a code change, a commit, and a redeploy. MATE is that control layer — it adds what production needs without touching your agent code.

A single agent in a notebook is easy. A hierarchy of agents serving real users is not.

  • Iteration is slow. Tweaking a prompt means editing code, committing, and redeploying. By the time you’ve tested three variations you’ve wasted half a day.
  • Governance is messy. Who can call the admin agent? The finance agent? You need per-agent access control, but ADK doesn’t ship with RBAC.
  • Costs are invisible. You know tokens are being spent, but you can’t see which agent is the expensive one, or whether it’s prompt tokens, response tokens, or reasoning tokens eating your budget.
  • Regressions are silent. You improve one prompt and unknowingly break another agent’s logic. You only find out when a user complains.

Three Things MATE Gives You

🎨 The Studio — Build and iterate without touching code

A drag-and-drop canvas where you create agents, draw parent→child connections, and attach tools without writing JSON or Python. Change a prompt, swap a model (from Gemini to GPT-4o to local servers like Ollama, LM Studio, llama.cpp, LocalAI, or Llamafile), or restructure an entire hierarchy — and it takes effect immediately, no redeploy.

Every agent lives in the database. Every change is versioned. Roll back to any previous configuration in one click.

When a conversation goes somewhere you didn’t expect, Trace Replay plays it back on the same canvas: agents light up in the order they ran, the hand-off to a sub-agent shows on the edge between them, and each agent shows the model or tool it is using, how long it took, and whether its fallback model had to answer.

🏛️ The Control Room — Govern what runs in production

RBAC per agent means the finance team’s agent is never visible to basic users, without any custom middleware. Every model call is priced in US dollars as it is logged — from OpenRouter’s and LiteLLM’s price lists, or a price you set — so the Usage page shows what each agent and project actually costs, next to the four token buckets (prompt, response, thoughts, tool use).

Set budgets in tokens or dollars per user, agent or project that warn or block, and alert rules that post to a webhook, email, Slack or Discord when agents fail, a guardrail keeps firing, a fallback model takes over, or a budget runs low. Add guardrails (hallucination scoring, PII, prompt injection) from the dashboard. Audit logs capture every configuration change for compliance.

🧪 The Lab — Know before you ship

The Eval Framework runs your agents against a test suite automatically. Write expected outputs; MATE invokes the live agent, scores the response (exact match, semantic similarity, or LLM-as-Judge), and tracks pass rates across versions as a chart.

Set a regression threshold and MATE fires a webhook if a new version scores more than 5 points below the previous one. Catch prompt regressions before users do.

The Playground answers “which model, which prompt?” before you change anything: run one prompt, or an agent’s whole eval suite, on two or three variants of the agent — another model, other instructions, an older version — and compare score, reply time and cost in dollars side by side.


Quick Start

git clone https://github.com/antiv/mate.git && cd mate
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.lock

cp .env.example .env
# Set GOOGLE_API_KEY (or any supported provider key), AUTH_USERNAME and AUTH_PASSWORD

python auth_server.py
# Dashboard: http://localhost:8000  — log in with AUTH_USERNAME / AUTH_PASSWORD
# (left empty, they are admin / mate; MATE_ENV=production refuses that default)

Or with Docker, from the published image (no clone needed):

docker run -d --name mate -p 8000:8000 \
  -e AUTH_PASSWORD=change-me -e GOOGLE_API_KEY=your-key \
  -e DB_PATH=data/my_agent_data.db -v mate-data:/app/data \
  ghcr.io/antiv/mate:latest

Or build it yourself with docker-compose up (it needs AUTH_PASSWORD set in .env).

Dependencies

requirements.txt lists the direct dependencies; requirements.lock pins every package, with hashes, and is what Docker, CI and the Quick Start install. After editing requirements.txt, or to pick up new releases, regenerate the lock with uv and run the tests before committing both files:

uv pip compile requirements.txt -o requirements.lock --universal --python-version 3.11 --generate-hashes
# add --upgrade to move everything to the latest allowed versions,
# or --upgrade-package litellm to move just one
python -m unittest discover -s shared/test -t . -p "test_*.py"

On the 1st of every month, .github/workflows/dependency-upgrade.yml does this with --upgrade, taking only releases at least a week old, runs the tests on the result in a job without write access, and opens a pull request when anything moved (it can also be started by hand from the Actions tab). The exact pins in requirements.txt, google-adk and SQLAlchemy below 2.1, are moved by hand after reading their changelogs. The workflow needs Settings → Actions → General → Allow GitHub Actions to create and approve pull requests; with the default token the pull request gets no CI run of its own, so set a DEPENDENCY_PR_TOKEN secret if you want one. Dependabot keeps the workflows’ own actions current.

Migrations run automatically on startup. Default database is SQLite.


Screenshots

Dashboard Overview

Monitor usage, active agents, system health, and request trends at a glance.

Agent Management

View and manage your full agent hierarchy — models, parent relationships, and status per project.

Agent Visual Builder

Drag-and-drop canvas for building agent hierarchies. See tool and MCP nodes attached to each agent, click to configure them inline, and create connections without touching JSON.

Trace Replay

Play a traced conversation back on the Visual Builder canvas: which agent ran when, the hand-off from the root agent to a sub-agent, the tools it called, and a fallback model answering when the primary failed. The whole session plays as one run, turn after turn. (MP4 · guide)

Work Room

A built-in chat interface inside the dashboard. Pick any root agent from the card grid and start a conversation — no embed code, no browser tab switching. Sessions are auto-titled and persist across page reloads. The default landing page after login.

When the agent responds with code, the canvas panel opens automatically to the right of the chat. Code never clutters the conversation — it goes straight into a full-featured editor. HTML, JavaScript, CSS, SVG and Python run with one click in a sandboxed frame, apart from the dashboard — Python via Pyodide (WebAssembly), in the browser. Dart and Flutter applications are executed directly in the browser via a seamless, zero-install DartPad integration that bypasses the code view to show the interactive application immediately. The panel is resizable by dragging the divider. Any edits made in the canvas are automatically included in the next prompt, so you can ask the agent to modify its own output without copy-pasting.

With the Canvas Panel, you can view and edit the generated code in a full-featured Ace Editor, and run/execute it in a sandboxed environment with a single click:

Editing generated code in the Canvas Panel

Previewing and running the generated code in a sandboxed iframe

Agent Configuration

Edit every aspect of an agent: model, instruction, RBAC roles, memory blocks, tools, MCP servers, planner, and schemas.

Tool Configuration

Toggle built-in tools or provide custom JSON — Google Drive, Search, Image, Memory Blocks, Code Executor, File Search, and more.

Chat Interface

Multi-agent chat with event tracing, tool calls, and persistent memory.

Usage Analytics

Token usage trends, agent performance, activity-by-hour, and per-agent success rates.

Token Usage Details

Drill into individual request logs — prompt / response / thought / tool-use token breakdown per request.


Why MATE vs. raw ADK

Challenge Raw ADK MATE
Change a prompt or model Edit code, redeploy Dashboard edit, instant
Switch LLM providers Code change per agent Change model_name in config (ollama_chat/llama3.2, lm_studio/qwen2.5, openai/gpt-4o, …)
Access control per agent Build your own Built-in RBAC, no code
Cost visibility DIY Cost in US dollars per agent, project and user, plus a 4-type token breakdown
Spending limits DIY Token and dollar budgets that warn or block, with alerts
Regression testing Manual Automated eval suite with LLM-as-Judge
Compare models and prompts Ad-hoc scripts Playground: variants side by side with score, latency and cost
Multi-team isolation Manual Project-scoped agent hierarchies
Embed chat on a website Not included Single `

A floating chat button appears instantly. No build step, no framework dependency.

### Multi-site example

MATE instance ├── key: wk_aaa → support_agent → company-support.com (English, light theme) ├── key: wk_bbb → sales_agent → company-sales.com (dark theme, no attachments) └── key: wk_ccc → docs_agent → docs.company.com (RAG over product docs)


Each key is independent: different agent, different greeting, different allowed origins, different color scheme.

### Page context awareness

When a user opens the widget on a product page, the widget automatically reads the page URL, title, and meta description and passes them to the agent as conversation context. The agent knows which page the user is viewing without any custom integration — just enable "Inject page context" in the widget admin panel.

### Widget admin panel

Each key has a standalone admin panel at `/widget/admin?key=...`. Non-technical teams can manage appearance, greeting, memory blocks, and uploaded files without touching the main dashboard.

| Setting | Admin panel |
|---|---|
| Widget title and greeting | ✓ |
| Light / dark / auto theme | ✓ |
| Button and accent color | ✓ |
| Show / hide file attachments | ✓ |
| Page context injection toggle | ✓ |
| Agent instruction and model | ✓ |
| Memory blocks (company info, FAQs…) | ✓ |
| RAG file upload | ✓ |

> Full documentation: [docs/user/widget.md](docs/user/widget.md)

---

## MCP Integration

MATE exposes agents and tools as MCP servers, compatible with Claude Desktop, Cursor, and any MCP client.

```bash
# Expose specific agents as MCP servers
export MCP_EXPOSED_AGENTS=creative_agent,support_agent

Each exposed agent gets endpoints at /agents/{name}/mcp/*, and GET /mcp lists the ones you may use with their URLs. Built-in MCP servers: Image Generation (/images/mcp) and Google Drive (/gdrive/mcp).

Clients authenticate with a personal access token from the dashboard’s account menu, sent as Authorization: Bearer mate_pat_.... The token’s user needs a role in ALLOWED_API_ROLES (default admin, developer) and, for an agent, a role the agent allows.

Full documentation: docs/dev/mcp-servers.md


Dashboard Routes

Route Purpose
/dashboard/workroom Work Room — chat with any agent directly in the dashboard (default after login)
/dashboard Overview — usage stats, system health
/dashboard/agents Agent hierarchy, configuration, Visual Builder
/dashboard/users User management and role assignment
/dashboard/usage Cost in US dollars and token analytics, per agent, project and user
/dashboard/rate-limits Rate limits and budgets (requests, tokens, US dollars)
/dashboard/alerts Alert rules and where they are sent
/dashboard/settings Model prices, default image model
/dashboard/evals Test suites, score history, regression tracking, Playground
/dashboard/audit-logs Audit trail viewer
/dashboard/migrations Database migration management
/dashboard/docs Documentation: user and developer guides, generated reference, search, and the API explorer (Swagger + ReDoc)

Additional Documentation


Contributing

Contributions are welcome. See CONTRIBUTING.md for development setup, code style, and PR guidelines.

Security

For security best practices and vulnerability reporting, see SECURITY.md.

License

Apache License 2.0 — see LICENSE.

View the full README on GitHub

Install

docker run -d -p 8000:8000 -e AUTH_PASSWORD=change-me -e GOOGLE_API_KEY=your-key ghcr.io/antiv/mate:latest
New to MCP? Start with the mcpskill.org guide →