
mcp_agents
A powerful AI agents platform that enables automated interactions with various services and APIs, including web browsing, stock market data retrieval, and more.
Repository Info
About This Server
A powerful AI agents platform that enables automated interactions with various services and APIs, including web browsing, stock market data retrieval, and more.
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Agents
A powerful AI agents platform that enables automated interactions with various services and APIs, including web browsing, stock market data retrieval, and more.
Architecture
MCP Server Components
-
Core Server:
- Handles agent coordination and task management
- Implements async communication patterns
- Manages service integrations
-
Service Integrations:
- Browser MCP:
- Playwright-based web automation
- Multi-tab browser management
- Screenshot and PDF capabilities
- Form interaction handling
- Finance MCP:
- Stock market data integration (yfinance)
- Historical and real-time data processing
- Airbnb MCP:
- Property search and filtering
- Listing details retrieval
- Booking information handling
- Search MCP:
- DuckDuckGo integration
- Web search capabilities
- Browser MCP:
Agent System
-
MCPAgent Class:
- Manages conversation state
- Handles tool selection and execution
- Implements memory management
- Coordinates with LLM for decision making
-
MCPClient Class:
- Manages service connections
- Handles configuration loading
- Implements session management
- Provides unified API access
Features
-
Web Browsing Automation: Automated browser control using Playwright
- Navigate websites
- Handle forms and interactions
- Take screenshots
- Manage multiple tabs
- Handle cookies and dialogs
-
Financial Data Integration:
- Stock market data retrieval using yfinance
- Historical price data
- Real-time market information
-
Airbnb Integration:
- Search for listings with customizable filters
- Get detailed property information
- Support for:
- Check-in/check-out dates
- Number of guests (adults, children, infants)
- Price ranges
- Location-based search
- Pet-friendly options
-
Search Capabilities:
- Web search functionality
- DuckDuckGo integration for privacy-focused searches
Prerequisites
- Python 3.x
- Virtual Environment (recommended)
- Node.js and NPX (for Playwright and browser automation)
- Groq API key (for LLM integration)
Setup
- Clone the repository:
git clone <repository-url>
cd mcp_agents
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
- Install Playwright using NPX:
# Install Playwright browsers using NPX
npx playwright install --with-deps
# For specific browsers only
npx playwright install chromium
npx playwright install firefox
npx playwright install webkit
- Configure environment:
# Create .env file
touch .env
# Add required API keys
echo "GROQ_API_KEY=your_groq_api_key" >> .env
Development Tools
NPX Commands
The project uses NPX for various development and testing tasks:
# Run Playwright tests
npx playwright test
# Run Playwright in debug mode
npx playwright test --debug
# Show Playwright test report
npx playwright show-report
# Start Playwright Inspector
npx playwright codegen
Usage
Initialize MCP Client
from mcp_use import MCPClient, MCPAgent
from langchain_groq import ChatGroq
# Initialize client with configuration
client = MCPClient.from_config_file("browser_mcp.json")
# Initialize LLM
llm = ChatGroq(model="qwen-qwq-32b")
# Create agent
agent = MCPAgent(
llm=llm,
client=client,
max_steps=15,
memory_enabled=True
)
Web Automation
# Example of browser automation
await page.goto('https://www.example.com')
await page.click('button#submit')
await page.type('input#search', 'query')
Stock Market Data
# Example of retrieving stock data
stock_history = get_stock_history(
symbol="AAPL",
period="1mo",
interval="1d"
)
Airbnb Search
# Example of searching Airbnb listings
airbnb_results = airbnb_search(
location="Miami, FL",
checkin="2024-06-01",
checkout="2024-06-07",
adults=2,
children=0,
max_price=300
)
# Get detailed information about a specific listing
listing_details = airbnb_listing_details(
id="listing_id",
checkin="2024-06-01",
checkout="2024-06-07",
adults=2
)
Web Search
# Example of performing a web search
search_results = duckduckgo_search(
query="your search query",
safe_search="moderate"
)
Project Structure
mcp_agents/
├── .venv/ # Virtual environment
├── src/ # Source code
│ ├── browser/ # Browser automation modules
│ ├── finance/ # Financial data modules
│ ├── airbnb/ # Airbnb integration modules
│ └── search/ # Search functionality modules
├── tests/ # Test files
│ └── playwright/ # Playwright test scripts
├── playwright.config.js # Playwright configuration
├── browser_mcp.json # Browser MCP configuration
├── package.json # Node.js dependencies
├── requirements.txt # Python dependencies
└── README.md # This file
Configuration
browser_mcp.json
{
"browser": {
"headless": true,
"viewport": {
"width": 1280,
"height": 720
}
},
"services": {
"airbnb": {
"enabled": true
},
"finance": {
"enabled": true
},
"search": {
"enabled": true
}
}
}
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Playwright for web automation
- yfinance for financial data
- DuckDuckGo for search functionality
- Groq for LLM capabilities
Quick Start
Clone the repository
git clone https://github.com/anuragratna/mcp_agentsInstall dependencies
cd mcp_agents
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.