Multi-MCP AI Agent

by aviban15

250 downloads
Not rated
GitHub

About

An AI agent which utilizes multiple MCP servers, including internal tools like math tools, and external tools like Google services and web scraping.

Details

Author
aviban15
Downloads
250
Categories
AI

- Multi-MCP architecture for distributed processing
- Cognitive modules: perception, memory, decision, action
- Google Workspace integration (Gmail, Drive, Sheets)
- Web scraping, content extraction, DuckDuckGo search
- Real-time Telegram bot and SSE communication
- Session handling, context management, strategic decision making

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Multi-MCP AI Agent
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

After cloning the repository, create a virtual environment with uv venv, activate it, install dependencies with uv sync, and set up environment variables for Gemini API key, Telegram bot token, and Google OAuth credentials. Start the agent with uv run agent.py or the Telegram bot server with uv run telegram_sse_server.py. Configure MCP servers in config/profiles.yaml and models in config/models.json.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "multi-mcp ai agent": {
            "multi-mcp-agent": {
                "command": "uv",
                "args": [
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "multi-mcp-agent": {
        "command": "uv",
        "args": [
            "venv"
        ]
    }
}

Multi-MCP AI Agent

An Agentic AI agent system that leverages multiple MCP (Model Control Protocol) servers to provide a wide range of capabilities, from basic mathematical operations to advanced external service integrations like Google Workspace and web scraping. The agent includes a Telegram bot interface and Server-Sent Events (SSE) for real-time communication.

๐ŸŒŸ Features

- Multi-MCP Architecture: Utilizes multiple MCP servers for distributed processing and diverse capabilities
- Cognitive Modules: Implements perception, decision-making, memory, and action modules
- External Service Integration:
- Google Workspace (Gmail, Google Drive, Google Sheets)
- Web scraping and content extraction
- DuckDuckGo search integration
- Real-time Communication:
- Telegram Bot interface
- Server-Sent Events (SSE) for live updates
- Core Components:
- Agent loop management
- Session handling
- Context management
- Strategic decision making

๐Ÿ—๏ธ Project Structure

โ”œโ”€โ”€ agent.py              # Main agent entry point
โ”œโ”€โ”€ core/                 # Core agent components
โ”‚   โ”œโ”€โ”€ context.py        # Context management
โ”‚   โ”œโ”€โ”€ loop.py           # Main agent loop
โ”‚   โ”œโ”€โ”€ session.py        # Session handling
โ”‚   โ””โ”€โ”€ strategy.py       # Strategic decision making
โ”œโ”€โ”€ modules/              # Cognitive modules
โ”‚   โ”œโ”€โ”€ action.py         # Action execution
โ”‚   โ”œโ”€โ”€ decision.py       # Decision making
โ”‚   โ”œโ”€โ”€ memory.py         # Memory management
โ”‚   โ”œโ”€โ”€ model_manager.py  # Model management
โ”‚   โ”œโ”€โ”€ perception.py     # Input processing
โ”‚   โ””โ”€โ”€ tools.py          # Tool definitions
โ”œโ”€โ”€ config/               # Configuration files
โ”‚   โ”œโ”€โ”€ models.json       # Model configurations
โ”‚   โ””โ”€โ”€ profiles.yaml     # MCP server profiles
โ””โ”€โ”€ mcp_server_*.py       # MCP server implementations

๐Ÿš€ Getting Started

Prerequisites

- Python 3.11+
- UV package manager
- Telegram Bot Token (for bot functionality)
- Google Cloud credentials (for Google Workspace integration)

Installation

1. Clone the repository:

git clone <repository-url>
cd <repository-name>

2. Create and activate a virtual environment:

uv venv
venv\Scripts\activate # On Mac: source venv/bin/activate

3. Install dependencies using UV:

uv sync

4. Set up environment variables:
- Create .env with Gemini API key and Telegram Bot token.
- Generate credentials.json using Google OAuth client.

Configuration

1. Configure MCP servers in config/profiles.yaml
2. Set up model configurations in config/models.json
3. Configure Google Cloud credentials:
- Place credentials.json in the root directory
- Run the application once to generate token.json

๐ŸŽฎ Usage

Starting the Agent

uv run agent.py

Starting the Telegram Bot Server

uv run telegram_sse_server.py

๐Ÿ› ๏ธ MCP Servers

MCP Server 1: Basic Operations

- Mathematical operations - Image processing - File operations

MCP Server 2: Document Processing

- Document indexing - Semantic search - Content extraction - Image captioning

MCP Server 3: Web Integration

- DuckDuckGo search - Web content fetching - Rate-limited requests

MCP Server 4: Google Workspace

- Gmail integration - Google Sheets operations - Google Drive management - F1 standings fetcher (URL scraper)

๐Ÿ“ก Communication

Telegram Bot

- Command handling - Message processing - Real-time responses

SSE Server

- Real-time event streaming - Client connection management - Event broadcasting

๐Ÿง  Cognitive Architecture

The agent implements a cognitive architecture with the following modules:

- Perception: Processes input and extracts relevant information
- Memory: Manages state and historical data
- Decision: Makes strategic decisions based on input and context
- Action: Executes decided actions through appropriate tools

๐Ÿ“ License

MIT License

No reviews yet โ€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.