A modular AI-powered client that combines filesystem and browser automation using the Model Context Protocol (MCP). Supports multiple LLM providers: Ollama (local), Google Gemini, and Groq.
- 🤖 Multiple LLM Providers: Ollama, Gemini, or Groq
- 📁 Filesystem Operations: Create, read, update, delete files and directories
- 🌐 Browser Automation: Web scraping and browser control
- 📅 Google Calendar Integration: Create, read, update, delete calendar events
- 🔧 Modular Architecture: Clean, maintainable code structure
- 🔄 Persistent Connections: Maintains connections to multiple MCP servers
- 🛡️ Loop Detection: Prevents infinite loops in task execution
.
├── client/ # Main client code
│ ├── main.py # Entry point and CLI
│ ├── mcp_client.py # Core MCP client logic
│ ├── llm_provider.py # LLM initialization
│ ├── prompts.py # System prompts
│ └── config.py # Configuration
├── filesystem-mcp-server/ # Filesystem MCP server (included)
├── mcp-server-browser-use-ollama/ # Browser MCP server (included)
├── gcp-oauth.keys.json # Google OAuth credentials (create this)
├── Sandbox/ # Working directory for file operations
├── .env # Environment variables (create this)
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
├── setup.sh # Setup script for Linux/Mac
├── setup.bat # Setup script for Windows
├── README.md # This file
└── SETUP.md # Detailed setup guide
- Python 3.8+
- Node.js 16+ (for filesystem MCP server)
- Ollama (optional, for local LLM)
- API Keys (optional):
GEMINI_API_KEYfor Google GeminiGROQ_API_KEYfor Groq
For Windows:
setup.batFor Linux/Mac:
chmod +x setup.sh
./setup.shThe setup script will:
- ✅ Check prerequisites (Python, Node.js, npm)
- ✅ Create Python virtual environment
- ✅ Install all dependencies
- ✅ Build MCP servers
- ✅ Create Sandbox directory
If you prefer to set up manually or the script fails:
git clone <your-repo-url>
cd <repo-name>Note: All MCP servers are included in the repository, no need to clone them separately!
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On Linux/Mac:
source .venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt# Navigate to the filesystem server directory
cd filesystem-mcp-server
# Install Node.js dependencies
npm install
# Build the server
npm run build
# Go back to root
cd ..# Navigate to the browser server directory
cd mcp-server-browser-use-ollama
# Install dependencies (if requirements.txt exists)
pip install -r requirements.txt
# Go back to root
cd ..Create a .env file in the root directory:
# Optional: Only needed if using Gemini or Groq
GEMINI_API_KEY=your_gemini_api_key_here
GROQ_API_KEY=your_groq_api_key_hereThe default configuration uses relative paths and should work out of the box.
If you need to customize paths, edit client/config.py:
# The default uses relative paths (recommended):
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
FILESYSTEM_BASE_DIR = os.path.join(PROJECT_ROOT, "Sandbox")
FILESYSTEM_SERVER_PATH = os.path.join(PROJECT_ROOT, "filesystem-mcp-server", "dist", "index.js")
BROWSER_SERVER_PATH = os.path.join(PROJECT_ROOT, "mcp-server-browser-use-ollama", "src", "server.py")
# Or use absolute paths if needed:
# FILESYSTEM_BASE_DIR = "C:\\Users\\YourName\\unified-mcp-client\\Sandbox"
# FILESYSTEM_SERVER_PATH = "C:\\Users\\YourName\\unified-mcp-client\\filesystem-mcp-server\\dist\\index.js"
# BROWSER_SERVER_PATH = "C:\\Users\\YourName\\unified-mcp-client\\mcp-server-browser-use-ollama\\src\\server.py"# Create the working directory for file operations
mkdir SandboxIf you want calendar integration:
-
Create Google Cloud Project:
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the Google Calendar API
-
Create OAuth Credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Desktop app" as application type
- Download the JSON file and rename it to
gcp-oauth.keys.json - Place it in the project root directory
-
Install the Calendar MCP Server:
npm install -g @gongrzhe/server-calendar-autoauth-mcp
-
Authenticate (first time only):
npx @gongrzhe/server-calendar-autoauth-mcp auth
This will open your browser for Google authentication.
If you want to use local LLMs:
- Download Ollama from ollama.ai
- Install and start Ollama
- Pull the required model:
ollama pull qwen2.5-coder:14b# With Ollama (local) - uses qwen2.5-coder:14b
python client/main.py "Create a folder called 'projects'"
# With Gemini - uses gemini-2.0-flash-exp
python client/main.py "Your task" --gemini
# With Groq - uses llama-3.1-70b-versatile
python client/main.py "Your task" --groq# Filesystem operations only (faster)
python client/main.py "Create a file notes.txt" --filesystem-only
# Browser operations only
python client/main.py "Open GitHub trending" --browser-only
# Calendar operations only
python client/main.py "What's on my calendar today?" --calendar-only
# Skip calendar (if not set up)
python client/main.py "Create notes.txt" --no-calendar
# Debug mode
python client/main.py "Your task" --debug
# Custom max iterations
python client/main.py "Your task" --max-iterations 30# File operations
python client/main.py "Create a file hello.txt with 'Hello World'"
# Web scraping
python client/main.py "Open GitHub trending, get top 5 Python repos, save to file"
# Calendar management
python client/main.py "Schedule a team meeting tomorrow at 2pm"
python client/main.py "What meetings do I have this week?"
python client/main.py "Cancel my 3pm meeting today"
# Combined operations
python client/main.py "Check my calendar, then create a summary file of today's meetings"Edit client/llm_provider.py to change the hardcoded models:
# Groq
model_name = "llama-3.1-70b-versatile"
# Gemini
model_name = "gemini-2.0-flash-exp"
# Ollama
model_name = "qwen2.5-coder:14b"Edit client/config.py:
LLM_TEMPERATURE = 0.7 # Creativity (0.0 - 1.0)
OLLAMA_CONTEXT_SIZE = 32000 # Context window size
MAX_ITERATIONS = 20 # Max task iterationsEdit client/prompts.py to customize the AI assistant's behavior.
Update the paths in client/config.py to use absolute paths for your system:
import os
# Get the project root directory
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Use relative paths from project root
FILESYSTEM_BASE_DIR = os.path.join(PROJECT_ROOT, "Sandbox")
FILESYSTEM_SERVER_PATH = os.path.join(PROJECT_ROOT, "filesystem-mcp-server", "dist", "index.js")
BROWSER_SERVER_PATH = os.path.join(PROJECT_ROOT, "mcp-server-browser-use-ollama", "src", "server.py")# Make sure Node.js is installed
node --version
# Rebuild the server
cd filesystem-mcp-server
npm install
npm run build
cd ..# Upgrade pip
python -m pip install --upgrade pip
# Reinstall dependencies
pip install -r requirements.txt --force-reinstall# Check if Ollama is running
curl http://localhost:11434
# Start Ollama service
ollama serveMake sure your .env file is in the root directory and contains valid API keys:
# Check if .env exists
cat .env # Linux/Mac
type .env # Windows
# Verify environment variables are loaded
python -c "from dotenv import load_dotenv; import os; load_dotenv(); print(os.getenv('GEMINI_API_KEY'))"# Make sure browser dependencies are installed
cd mcp-server-browser-use-ollama
pip install -r requirements.txt
cd ..client/main.py: CLI entry point, argument parsing, server initializationclient/mcp_client.py: Core logic for MCP connections, tool execution, conversation managementclient/llm_provider.py: LLM initialization for different providersclient/prompts.py: System prompts and instructions for the AIclient/config.py: Centralized configuration and environment setup
- New LLM Provider: Add to
llm_provider.py - New MCP Server: Update
main.pyconnection logic - Custom Prompts: Modify
prompts.py - Configuration: Add to
config.py
Create a requirements.txt file:
mcp
langchain-ollama
langchain-google-genai
langchain-groq
langchain-core
python-dotenv
pydantic[Your License Here]
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
For issues and questions:
- Open an issue on GitHub
- Check existing documentation
- Review troubleshooting section