KevinLiss/ApeAdmin
Apeadmin 面向现代AI应用打造的Python后台管理框架,基于 FastAPI+Vue3 设计100%开源,内置 RBAC 权限管控、审计日志等企业级基础能力。框架集成 MCP‑SSE 网关,具备强大插件生态完整,帮助开发者快速搭建兼具业务管理与 AI 工具输出能力的应用。
What is ApeAdmin?
ApeAdmin is an open‑source, FastAPI + Vue 3 based admin‑panel framework that is purpose‑built for modern AI applications. It provides the usual back‑office features you expect—user/role management, menus, audit logs, RBAC, etc.—but adds a plug‑in architecture and a MCP‑SSE gateway that lets AI agents call the system’s functionality as “tools”. In short, it’s a “backend‑as‑a‑service” you can install in minutes and then extend with Python plug‑ins that expose business logic to both human users and large‑language‑model agents.
Core Features
| Category | What it does |
|---|---|
| Installation wizard | WordPress‑style three‑step setup (DB config → site & admin → finish). Auto‑creates the database, generates a JWT secret, and locks the installer after the first run. |
| RBAC | Five‑table model (users, roles, menus, departments, association). Four‑layer permission checks (no‑login → no‑auth → rule → data scope) and front‑end v‑permission directive for button‑level hiding. |
| Plug‑in system | Python packages are discovered via importlib. Plugins can be loaded/unloaded at runtime, have a full lifecycle (load → install → register → uninstall), and can be shipped as ZIP files or installed from an online plug‑in market. |
| MCP‑SSE gateway | Exposes registered plug‑in functions as Tools, Resources, or Prompts that AI agents can call over Server‑Sent Events. Schemas are auto‑generated from function signatures, calls are RBAC‑filtered, and each call is logged with request/response and timing. |
| AI chat | Integrated multi‑model chat (DeepSeek, Qwen, GLM, OpenAI, or any OpenAI‑compatible endpoint). Supports streaming SSE output, markdown rendering, and up to five rounds of tool‑calling loops. Model keys are stored encrypted with Fernet. |
| Audit & monitoring | Global request IDs, operation logs, per‑API latency tracking, and a built‑in dashboard with ECharts visualisations. |
| Database flexibility | Works out‑of‑the‑box with SQLite (zero‑config) or MySQL for production; the driver switches via DB_TYPE. Optional Redis cache falls back to in‑memory if unavailable. |
Who Might Use It?
| Use case | Why ApeAdmin fits |
|---|---|
| AI SaaS platforms that need a secure admin UI for managing users, roles, and custom AI tools. | |
| Enterprises wanting to expose internal services to LLM agents without writing bespoke APIs—just register the service as an MCP tool. | |
| Developers building AI‑augmented internal tools (e.g., document retrieval, workflow automation) and who prefer a plug‑in model to keep core code clean. | |
| Start‑ups that want a quick “admin panel + AI gateway” without building the scaffolding from scratch. |
Tech Stack at a Glance
| Layer | Technology |
|---|---|
| Backend | FastAPI, SQLAlchemy 2.0 (async), Alembic migrations |
| Frontend | Vue 3.5, Vite 6, TypeScript 5.7, Element Plus, Pinia, ECharts |
| Database | MySQL (via aiomysql) or SQLite (aiosqlite) |
| Cache | Redis (optional) |
| Auth | JWT + bcrypt password hashing |
| AI Integration | MCP (Model Context Protocol) over SSE, supports DeepSeek, Qwen, GLM, OpenAI, or custom OpenAI‑compatible endpoints |
| Packaging | MIT license, Docker‑friendly, also deployable on bare‑metal or via popular hosting panels |
Getting Started (quickest path)
- Clone the repo and navigate to the backend folder.
- Create a virtual environment, install the package in editable mode, and run the FastAPI server:
cd backend python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -e . uvicorn src.main:app --reload --host 0.0.0.0 --port 8000 - Open another terminal, go to the frontend folder, install npm dependencies and start the dev server:
cd frontend npm install --legacy-peer-deps npm run dev - Visit
http://localhost:5173. Because the system is fresh, it will redirect you to/setup. Follow the three‑step wizard (choose SQLite for a local demo or MySQL for production) and finish the installation. - Log in with the admin credentials you set, explore System Management → Plugins, and try installing a sample plug‑in from the built‑in market.
- To experiment with the AI chat, add a model key under AI Assistant → Model Keys, then start a conversation; the assistant can call the registered MCP tools (e.g.,
system_list_plugins).
Extending ApeAdmin
- Create a plug‑in by adding a new Python package under
backend/src/plugins/builtin/. ImplementPluginInterfacewith methods likeon_load,register_routes, andregister_mcp_tools. - Expose a tool inside
register_mcp_toolsusing the@mcp_manager.tooldecorator; the function signature becomes a JSON‑Schema that the LLM can invoke. - Publish the plug‑in as a ZIP file or push it to the online plug‑in market so other users can install it with a click.
Community & Contribution
- Fork → branch (
feat/…,fix/…, etc.) → PR. Follow the repo’s contribution guide for commit style and testing. - A WeChat group is provided for real‑time support and discussion (QR code in the README).
Bottom line: ApeAdmin is a ready‑to‑run, extensible admin framework that bridges traditional business back‑ends and modern LLM agents. If you need a secure UI, plug‑in‑based extensibility, and a way for AI agents to call your services as first‑class tools, this project gives you a solid foundation out of the box.
Related
- Project
- Project
- Project
- Project