A comprehensive AI-powered application built with mcp-agent featuring web scraping, email management, and social media content generation capabilities.
- π Web Scraping: Extract articles from websites
- π§ Email Management: Process and draft emails
- π Zapier Integration: Connect with various services and tools
- π± Social Media Content: Generate LinkedIn, Twitter, and Instagram posts
- πΌοΈ Image Generation: Create visual content for social posts
- π§ Streamlit Interface: Easy-to-use web interface for all operations
- Python 3.10+ (required by mcp-agent)
- Node.js 18+ (required for MCP servers)
- uv package manager: Install with
pip install uv
# Clone the repository
git clone <repository-url>
cd mcp_basic_agent
# Install dependencies using uv
uv syncThe project uses several Node.js-based MCP servers:
# These will be automatically installed when first run, but you can pre-install:
npx -y @modelcontextprotocol/server-filesystem
npx -y @modelcontextprotocol/server-zapierYou need the following API keys to run the application:
-
Anthropic API Key (Claude)
- Get from: https://console.anthropic.com
- Format:
sk-ant-api03-...
-
Zapier Natural Language Actions (NLA) API Key
- Go to: https://zapier.com/l/natural-language-actions
- Create account and get your MCP URL by creating new server OTHER OPTION
- add Gmail tools and login with credentials
- go to settings and copy the url for zapier connection
- Format:
https://mcp.zapier.com/api/mcp/s/...
The project uses two configuration files:
Copy the example secrets file and add your API keys:
cp mcp_agent_secrets.yaml.example mcp_agent.secrets.yamlEdit mcp_agent.secrets.yaml and replace the placeholder values:
anthropic:
api_key: "sk-ant-api03-your_anthropic_api_key_here"
mcp:
servers:
zapier:
url: "https://mcp.zapier.com/api/mcp/s/your_zapier_mcp_url_here"
transport: "streamable_http"The mcp_agent.config.yaml file is already configured but you can modify:
- Logging levels and paths
- Model selection (default: Claude Sonnet 4)
- MCP server settings
Start the web interface:
uv run streamlit run streamlit.pyThe web interface provides:
-
Web Scraper:
- Configuration: Set URLs, criteria, and image styles
- Run: Execute scraping workflow
- Preview: Edit and save social media posts
-
Email Management:
- Settings: Configure email guidelines and contacts
- Run: Generate email drafts
Run individual components:
# Run web scraper
uv run python webscraper.py
# Run email agent
uv run python mail_agent.pymcp_basic_agent/
βββ README.md # This file
βββ mcp_agent.config.yaml # MCP server configuration
βββ mcp_agent.secrets.yaml # API keys (create from .example)
βββ mcp_agent_secrets.yaml.example # Template for secrets
βββ streamlit.py # Web interface
βββ webscraper.py # Web scraping workflow
βββ mail_agent.py # Email management workflow
βββ webscraper_inputs/ # Web scraper configuration
β βββ sources.txt # URLs to scrape
β βββ selection_criteria.txt # Article selection criteria
β βββ image_style.txt # Image generation style
βββ webscraper_outputs/ # Generated content by date
β βββ YYYY-MM-DD/
β βββ linkedin.txt
β βββ twitter.txt
β βββ instagram.txt
β βββ image_prompt.txt
βββ mail_agent_inputs/ # Email agent configuration
β βββ contacts.csv # Contact database
β βββ mail_agent_context.txt # Context and categories
β βββ email_guidelines.txt # Email templates
βββ tests/ # Test files
βββ logs/ # Application logs
# Start the application
uv run streamlit run streamlit.py
# The web interface will guide you through:
# 1. API key configuration
# 2. Google authentication (first run)
# 3. Setting up your preferences# 1. Install dependencies
uv sync
# 2. Copy and edit secrets file
cp mcp_agent_secrets.yaml.example mcp_agent.secrets.yaml
# Edit the file with your API keys
# 3. Test the setup
uv run python -c "from webscraper import WebScraperWorkflow; print('Setup OK')"When you first run the application, the Zapier MCP server will authenticate using the URL you configured in the secrets file. Make sure you have:
- Created a Zapier account
- Set up Natural Language Actions
- Copied the correct MCP URL to your secrets file
Run the test suite:
# Run all tests
uv run pytest
# Run specific test modules
uv run pytest tests/test_webscraper.py
uv run pytest tests/test_mail_agent.py# Run linting
uv run ruff check .
# Run type checking
uv run mypy .
# Auto-fix linting issues
uv run ruff check . --fix# Add Python dependencies
uv add package_name
# Add development dependencies
uv add --group dev package_name-
"Command not found: uv"
pip install uv
-
"MCP server failed to start"
- Ensure Node.js is installed:
node --version - Clear npm cache:
npm cache clean --force
- Ensure Node.js is installed:
-
"Invalid API key" errors
- Verify API keys in
mcp_agent.secrets.yaml - Check for extra spaces or quotes
- Verify API keys in
-
Zapier connection issues
- Verify your Zapier MCP URL is correct
- Check that Natural Language Actions is enabled in your Zapier account
-
Streamlit connection errors
- Check if port 8501 is available
- Try:
uv run streamlit run streamlit.py --server.port 8502
- Check the logs in
logs/directory for detailed error messages - Verify MCP server status in the application
- Test individual components:
# Test web scraping uv run python -c "from webscraper import WebScraperWorkflow; w = WebScraperWorkflow(); print('Webscraper OK')" # Test email agent uv run python -c "from mail_agent import SimplifiedEmailManagementSystem; e = SimplifiedEmailManagementSystem(); print('Mail Agent OK')"
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
uv run pytest - Run linting:
uv run ruff check . - Submit a pull request
This project is licensed under the Apache License 2.0. See the main mcp-agent repository for details.