Skip to content

Agent Zero AI framework

merge MCP clients

frdel69c3ac310b72
diff --cc agent.py
index 9785ddd51,8c8ade8a5..97c6d544a
--- a/agent.py
+++ b/agent.py
@@@ -1,9 -1,12 +1,12 @@@
import asyncio
+ import nest_asyncio
+ nest_asyncio.apply()
+
from collections import OrderedDict
from dataclasses import dataclass, field
-from datetime import datetime
-import json
-from typing import Any, Awaitable, Coroutine, Optional, Dict, TypedDict
+from datetime import datetime, timezone
+from typing import Any, Awaitable, Coroutine, Dict
+from enum import Enum
import uuid
import models
diff --cc docker/run/fs/ins/install_A0.sh
index 8f110a6b7,8fb6eeb84..d110877b9
--- a/docker/run/fs/ins/install_A0.sh
+++ b/docker/run/fs/ins/install_A0.sh
@@@ -1,6 -1,8 +1,9 @@@
#!/bin/bash
+set -e
+ # Exit immediately if a command exits with a non-zero status.
+ # set -e
+
# branch from parameter
if [ -z "$1" ]; then
echo "Error: Branch parameter is empty. Please provide a valid branch name."
@@@ -8,18 -10,26 +11,26 @@@
fi
BRANCH="$1"
- # clone project repo branch
- git clone -b "$BRANCH" "https://github.com/frdel/agent-zero" "/git/agent-zero"
+ git clone -b "$BRANCH" "https://github.com/frdel/agent-zero" "/git/agent-zero" || {
+ echo "CRITICAL ERROR: Failed to clone repository. Branch: $BRANCH"
+ exit 1
+ }
- # setup python environment
. "/ins/setup_venv.sh" "$@"
-# Ensure the virtual environment and pip setup
-pip install --upgrade pip ipython requests
-
-# Install some packages in specific variants
-pip install torch --index-url https://download.pytorch.org/whl/cpu
+# moved to base image
+# # Ensure the virtual environment and pip setup
+# pip install --upgrade pip ipython requests
+# # Install some packages in specific variants
+# pip install torch --index-url https://download.pytorch.org/whl/cpu
+ pip install -v mcp==1.3.0 || {
+ echo "ERROR: Failed during separate attempt to install mcp==1.3.0. Will proceed to full requirements.txt install anyway."
+ }
+ python -c "import mcp; from mcp import ClientSession; print(f'DEBUG: mcp and mcp.ClientSession imported successfully after separate install. mcp path: {mcp.__file__}')" || {
+ echo "ERROR: mcp package or mcp.ClientSession NOT importable after separate mcp==1.3.0 installation attempt. Full requirements.txt will run next."
+ }
+
# Install remaining A0 python packages
pip install -r /git/agent-zero/requirements.txt
diff --cc requirements.txt
index 06b24bff9,a906b43bf..91ee3b7d9
--- a/requirements.txt
+++ b/requirements.txt
@@@ -1,9 -1,9 +1,11 @@@
++a2wsgi==1.10.8
ansio==0.0.1
beautifulsoup4==4.12.3
browser-use==0.1.40
docker==7.1.0
duckduckgo-search==6.1.12
faiss-cpu==1.8.0.post1
++fastmcp==2.3.4
flask[async]==3.0.3
flask-basicauth==0.2.0
flaredantic==0.1.4
@@@ -20,6 -20,6 +22,7 @@@ langchain-openai==0.3.
openai-whisper==20240930
lxml_html_clean==0.3.1
markdown==3.7
++mcp==1.9.0
newspaper3k==0.2.8
paramiko==3.5.0
playwright==1.52.0
@@@ -31,7 -31,6 +34,5 @@@ tiktoken==0.8.
unstructured==0.15.13
unstructured-client==0.25.9
webcolors==24.6.0
-mcp==1.3.0
+ nest-asyncio==1.6.0
-crontab==1.0.1
+crontab==1.0.1
- fastmcp==2.3.4
- mcp==1.9.0
- a2wsgi==1.10.8