main
tests / pytest (push) Has been cancelled
Agent Platform
Eine schlanke, business-taugliche Agent-Plattform mit LiteLLM, Pydantic AI und MCP.
Architektur
┌─────────────────────────────────────────────┐
│ agent-platform (Port 8000) │
│ - FastAPI + LiteLLM + Pydantic AI │
│ - HTMX-UI (kein JS-Build) │
│ - SQLite │
│ - Audit-Log, Auth │
└──────────────────┬──────────────────────────┘
│ MCP (HTTP)
▼
┌─────────────────────────────────────────────┐
│ mcp-tools (Port 8501, intern) │
│ - fastmcp │
│ - 6 generische Tools │
└─────────────────────────────────────────────┘
Quickstart
# 1. Env-Datei anlegen
cp .env.example .env
# .env editieren: LLM_API_KEY und AUTH_TOKEN setzen
# 2. Starten
docker compose up -d --build
# 3. UI öffnen
http://localhost:8000
# 4. Ersten Agent anlegen
# Im UI: Agents → "Neuen Agent erstellen"
# System-Prompt: "Du bist ein hilfreicher Assistent."
# Erlaubte Tools: "echo, calculate, get_time"
API
# Health
curl http://localhost:8000/health
# Agents
curl -H "Authorization: Bearer $AUTH_TOKEN" http://localhost:8000/api/agents
# Chat
curl -X POST -H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Hallo!"}' \
http://localhost:8000/api/chat/general_assistant
# MCP-Tools
curl http://localhost:8000/api/tools
Verfügbare MCP-Tools
echo(text)- Echo-Toolget_time(timezone_name)- Aktuelle Zeitcalculate(expression)- Mathe-Ausdruck (sicher)http_get(url)- HTTP-Request (SSRF-Schutz)list_env(prefix)- Umgebungsvariablenjson_format(data)- JSON formatieren
Konfiguration
Alle Env-Vars sind in .env.example dokumentiert.
Entwicklung
# Backend lokal starten (ohne Docker)
cd agent_platform
pip install -e .
LLM_API_KEY=sk-xxx uvicorn api:app --reload
# MCP-Server lokal
cd mcp_tools
pip install -r requirements.txt
python server.py
Ressourcen
- agent-platform: 256 MB RAM, 0.5 CPU
- mcp-tools: 128 MB RAM, 0.25 CPU
- SQLite: 5-10 MB
Deploy (Coolify)
- In Coolify: Projects → New Project → name it (e.g.
agent-platform). - Inside the project: Resources → New → Docker Compose.
- Repository URL:
https://forgejo.media-on.de/Leopoldadmin/agent-platform.git, Branch:main. - Domain: bind a hostname to the
agent-platformservice (Traefik routes via theexpose: 8000label). - Environment Variables: set
AUTH_TOKEN(≥32 chars, NOTchange-me-in-production) andLLM_API_KEY; other vars can keep their.env.exampledefaults. - Click Deploy — Coolify builds the two images, creates the
agent-datavolume, and brings up the stack. - Health check:
curl https://<your-domain>/healthreturns{"status":"ok"}oncemcp-toolsis healthy andagent-platformis up.
Languages
Python
74.4%
HTML
17.2%
CSS
7.5%
Dockerfile
0.9%