Skip to main content
Glama
vad-007

MCP + CrewAI Agentic Integration

by vad-007
README.md
# šŸ¤– MCP + CrewAI Agentic Integration šŸš€

A powerful demonstration of **Model Context Protocol (MCP)** integrated with **CrewAI** orchestrations, featuring full observability through **AgentOps** and high-speed inference via **Groq**.

![Python](https://img.shields.io/badge/Python-3.13-blue?style=for-the-badge&logo=python)
![CrewAI](https://img.shields.io/badge/CrewAI-Agentic_Framework-orange?style=for-the-badge)
![FastMCP](https://img.shields.io/badge/FastMCP-Server-green?style=for-the-badge)
![AgentOps](https://img.shields.io/badge/AgentOps-Observability-red?style=for-the-badge)

---

## 🌟 Overview

This project bridges the gap between **context-aware tools** and **autonomous agents**. It provides a custom MCP server for real-time external data (Weather, News, Notes) while leveraging CrewAI to orchestrate multi-agent workflows.

### šŸ—ļø Architecture
- **MCP Layer**: A `FastMCP` server exposing tools for real-time data retrieval.
*   **Agentic Layer**: `CrewAI` agents specialized in Market Analysis and Research.
- **Inference Layer**: Ultra-fast LLMs (Llama 3.1) hosted on `Groq`.
- **Observability Layer**: `AgentOps` for tracing, cost management, and debugging.

---

## ✨ Key Features

### šŸ› ļø Custom MCP Server Tools
- **ā˜€ļø Weather Engine**: Real-time meteorology data via WeatherAPI.
- **šŸ“° News Intelligence**: Global news retrieval via Serper (Google Search API).
- **šŸ“ Contextual Notes**: Locally persistent note management for long-term memory.
- **ļæ½ Auto-Summary**: Intelligent summarization of collected context.

### šŸ‘„ Intelligence Crew
- **šŸ” Market Researcher**: Scours data to identify emerging trends.
- **šŸ“ˆ Data Analyst**: Synthesizes research into actionable market insights.
- **šŸš€ Sequential Workflow**: Fully orchestrated execution path for reliable results.

---

## šŸ› ļø Tech Stack

- **Framework**: [CrewAI](https://crewai.com)
- **Server**: [FastMCP](https://modelcontextprotocol.io)
- **LLM Engine**: [Groq](https://groq.com) (Llama 3.1 8B/70B)
- **Tracing**: [AgentOps](https://agentops.ai)
- **Package Manager**: [uv](https://github.com/astral-sh/uv)

---

## šŸš€ Getting Started

### 1. Prerequisites
Ensure you have the following installed:
- [uv](https://github.com/astral-sh/uv) (Recommended) or Python 3.13+
- A valid Groq API Key
- A valid AgentOps API Key
- A Serper API Key (for News)

### 2. Installation
Clone the repository and sync dependencies:
```bash
git clone https://github.com/vad-007/MCP_Integration_crewai.git
cd MCP_Integration_crewai
uv sync
```

### 3. Configuration
Create a `.env` file in the root directory:
```env
AGENTOPS_API_KEY=your_agentops_key
GROQ_API_KEY=your_groq_key
SERPER_API_KEY=your_serper_key
WEATHER_API_KEY=your_weather_key
```

### 4. Running the Project

#### 🌐 Start the MCP Server
```bash
mcp dev main.py
```

#### 🚢 Run the CrewAI Integration
```bash
python crewai_agentops_integration.py
```

#### šŸ” Run Diagnostics
```bash
python test_agentops.py
```

---

## šŸ“Š Observability with AgentOps

This project is fully instrumented. Every run generates a unique replay URL allowed you to:
- **Watch Agent Self-Correction**: See exactly how agents reason through tasks.
- **Trace LLM Calls**: Monitor every prompt and completion.
- **Analyze Latency**: Visualize the execution timeline of your crew.

Check your dashboard at: [app.agentops.ai](https://app.agentops.ai)

---

## šŸ“‚ Project Structure

```text
ā”œā”€ā”€ main.py                    # FastMCP Server implementation
ā”œā”€ā”€ crewai_agentops_integration.py # Main CrewAI orchestration
ā”œā”€ā”€ test_agentops.py           # Connectivity & Diagnostic tool
ā”œā”€ā”€ .env                       # Environment variables (private)
ā”œā”€ā”€ pyproject.toml             # Project configuration
ā”œā”€ā”€ uv.lock                    # Dependency lockfile
└── docs/                      # Troubleshooting & Optimization guides
```

---

## šŸ¤ Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

---

## šŸ›”ļø License

Distributed under the MIT License. See `LICENSE` for more information.

---

**Developed with ā¤ļø for the AI Community.**

TDQS

B3.3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: add_note and read_notes handle note management, fetch_weather retrieves weather data, and search_news fetches news results. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency4/5

The tool names follow a consistent verb_noun pattern (add_note, fetch_weather, read_notes, search_news), which is predictable and readable. The minor deviation is that 'fetch_weather' and 'search_news' use different verbs ('fetch' vs. 'search'), but the overall pattern remains clear.

Tool Count3/5

With only 4 tools, the set feels thin for a server named 'MCP + CrewAI Agentic Integration', which suggests broader agentic capabilities. While the tools cover basic utilities (notes, weather, news), the scope seems limited compared to the implied integration purpose, bordering on under-scoped.

Completeness2/5

Inferring the domain as agentic integration utilities, there are significant gaps: no tools for agent coordination, task management, or data processing beyond simple fetches. The note tools lack update/delete operations, and overall coverage is incomplete for enabling complex agent workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues