Multi-MCP AI agent integrates multiple servers for advanced automation, web scraping, Google Workspace, and real-time chat features
The Multi-MCP AI Agent is a sophisticated Agentic AI system designed to leverage multiple Model Context Protocol (MCP) servers for distributed processing and diverse capabilities. It provides a wide array of functionalities, from basic mathematical operations to advanced external service integrations like Google Workspace and web scraping. The agent includes both a Telegram bot interface and Server-Sent Events (SSE) for real-time communication.
The core of the Multi-MCP AI Agent revolves around utilizing multiple MCP servers, each designed to handle specific types of tasks—basic operations, document processing, web integration, and Google Workspace interactions. This architecture ensures that complex tasks can be broken down into manageable parts, allowing for more efficient processing and resource utilization.
The agent implements a comprehensive cognitive architecture consisting of four main modules: perception, decision-making, memory, and action. These modules work together to enable the system to understand input data, make strategic decisions based on context, store historical data, and execute appropriate actions through available tools or services.
The Multi-MCP AI Agent is structured with clear separation of concerns. Key components include:
agent.py
: Main entry point for the agent.
core/
: Contains core agent functionalities.
context.py
: Manages context within operations.loop.py
: Orchestrates the main execution loop.session.py
: Handles sessions and user states.strategy.py
: Facilitates strategic decision making.modules/
: Houses cognitive modules for various tasks.
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
Clone the repository:
git clone <repository-url>
cd <repository-name>
Create and activate a virtual environment:
uv venv
venv\Scripts\activate # On Mac: source venv/bin/activate
Install dependencies using UV:
uv sync
Set up the environment variables:
.env
file with Gemini API key and Telegram Bot token.credentials.json
.graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server (Math)]
B --> D[MCP Server (Web Scrape)]
C --> E[Real-time Trading System]
D --> F[Gmail Integration for Alerts]
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server (Web Scrape)]
C --> D[Data Extraction]
D --> E[System for Report Generation]
{
"mcpServers": {
"[Math Server]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-math"],
"env": {
"API_KEY": "your-api-key"
}
},
"[Web Scrape Server]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-scrape"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Feature | Math Server | Document Server | Web Server | Google Workspace |
---|---|---|---|---|
Mathematical Operations | ✅ | ❌ | ❌ | ❌ |
Document Indexing | ❌ | ✅ | ❌ | ❌ |
Web Scraping | ❌ | ❌ | ✅ | ❌ |
Google Sheets Operations | ❌ | ❌ | ❌ | ✅ |
import modelcontextprotocol as mcp
class MathServer(mcp.AbstractMCPClient):
def __init__(self, api_key):
self.api_key = api_key
def main():
server_configs = {
"math": MathServer("YOUR-MATH-API-KEY"),
"web_scrape": WebScrapeServer("YOUR-WEB-SCRAPE-API-KEY")
}
mcp.connect(server_configs)
if __name__ == "__main__":
main()
A1: Refer to the provided table, which outlines the compatibility of each AI application with specific MCP servers. For full support, ensure all required resources and tools are enabled.
A2: You can still use this system by focusing on compatible aspects or seek alternative MCP solutions tailored to your needs.
A3: Yes, you can define custom commands within the agent configuration files. This allows for task-specific interactions with the system using Telegram.
A4: Implement a rate-limiting mechanism or use MCP server functionalities that support throttling to ensure compliance with external API limits.
A5: Follow best practices for securing your MCP clients, such as using environment variables for sensitive information like API keys. Regularly update credentials and review logs for unauthorized access.
Interested developers should fork the repository from GitHub, clone it to their local machine, and run uv sync
to install dependencies. For contributions, please create an issue or a pull request following the standard guidelines provided in the CONTRIBUTING.md file.
Explore the broader MCP ecosystem for more information on Model Context Protocol and its applications across various AI systems. Additional resources include documentation, community forums, and example projects available on GitHub.
The Multi-MCP AI Agent, with its robust architecture and versatile features, stands out as a powerful tool for developers looking to enhance their AI applications through MCP integration. By leveraging multiple MCP servers, the agent offers unparalleled flexibility and scalability in handling complex tasks across various domains.
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions
AI Vision MCP Server offers AI-powered visual analysis, screenshots, and report generation for MCP-compatible AI assistants
Analyze search intent with MCP API for SEO insights and keyword categorization
Expose Chicago Public Schools data with a local MCP server accessing SQLite and LanceDB databases
Connects n8n workflows to MCP servers for AI tool integration and data access
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support