A powerful web research pipeline MCP built using the Atomic Agents framework.
For a full breakdown of the code, please
For now, this requires an API key for
Do you like this project?
This project implements an advanced web research pipeline that leverages the Model Context Protocol (MCP) and Atomic Agents to provide comprehensive answers to research questions. The pipeline automates the entire research process:
- Generating optimized search queries
- Performing web searches using Tavily
- Scraping and processing relevant web pages
- Synthesizing information into coherent answers
The system follows a modular architecture based on the MCP client-server model:
- MCP Server: Implements the Model Context Protocol to expose tools and manage client connections
- Web Search Pipeline: Orchestrates the research workflow through multiple stages
- Atomic Agents: Specialized AI agents for query generation and question answering
- Tools: Reusable components for web search (Tavily) and web page scraping
User Question → Query Generation → Web Search → Content Scraping → Answer Synthesis → Formatted Response
- Model Context Protocol (MCP): An open standard for AI applications to access contextual information
- Atomic Agents: A modular framework for building AI agents with well-defined input/output schemas
- Tavily API: A specialized search engine for AI applications
- OpenAI: Powers the underlying language models for query generation and answer synthesis
- Python 3.12+: The foundation of the application
- Python 3.12 or higher
- Tavily API key
- OpenAI API key
-
Clone the repository:
git clone https://github.com/yourusername/agentic-research-mcp.git cd agentic-research-mcp
-
Install dependencies:
pip install -e .
-
Set up environment variables:
# Create a .env file in the project root echo "TAVILY_API_KEY=your_tavily_api_key" > .env echo "OPENAI_API_KEY=your_openai_api_key" >> .env
Start the MCP server:
python -m atomic_research_mcp.server
OR
[rootfolder]\atomic-reseearch-mcp\.venv\Scripts\atomic-research
OR configure it in, for example, Cursor
Run the test client to verify functionality:
python test_client.py
The system returns comprehensive research results including:
- Generated search queries
- Top search results with relevance scores
- A detailed answer synthesized from multiple sources
- References to source materials
- Suggested follow-up questions
atomic_research_mcp/
├── agents/
│ ├── query_agent.py # Generates optimized search queries
│ └── qa_agent.py # Synthesizes answers from scraped content
├── tools/
│ ├── tavily_search.py # Interface to Tavily search API
│ └── webpage_scraper.py # Extracts and processes web content
├── server.py # MCP server implementation
└── config.py # Configuration settings
The system can be configured through environment variables:
TAVILY_API_KEY
: Required for web search functionalityOPENAI_API_KEY
: Required for AI agent operationsOPENAI_MODEL
: Optional, defaults to "gpt-4o-mini"
Contributions are welcome! Please feel free to submit a Pull Request.