Collaboration Tools MCP Server - Project Summary¶
Overview¶
A comprehensive MCP (Model Context Protocol) server implementation that provides collaboration tools for AI agents, including browser automation, human-in-the-loop capabilities, multi-channel notifications, and timer management.
Project Structure¶
collaboration-tools/
├── src/
│ ├── __init__.py # Package initialization
│ ├── main.py # MCP server entry point (19 tools)
│ ├── config.py # Configuration management with Pydantic
│ ├── browser_tools.py # Browser automation using browser-use
│ ├── notification_tools.py # Email & IM notifications
│ ├── hitl_tools.py # Human-in-the-loop tools
│ └── timer_tools.py # Timer and scheduling tools
│
├── README.md # Main documentation
├── IMPLEMENTATION.md # Technical implementation details
├── USAGE_EXAMPLES.md # Practical usage examples
├── PROJECT_SUMMARY.md # This file
│
├── requirements.txt # Python dependencies
├── env.example # Environment configuration template
├── .gitignore # Git ignore patterns
│
├── quickstart.py # Quick start demo
├── client_example.py # Real-world workflow example
└── test_basic.py # Basic functionality tests
Features Implemented¶
✅ 1. Browser Automation (5 tools)¶
mcp_browser_navigate- Navigate to URLsmcp_browser_get_content- Extract page contentmcp_browser_execute_task- AI-driven autonomous browser tasksmcp_browser_screenshot- Capture screenshotsmcp_browser_list_tabs- List all open tabs
Implementation:
- Uses browser-use library (知名虚拟浏览器库)
- Singleton browser session management
- Support for autonomous AI agents via LangChain + OpenAI
- Full Playwright-based automation
✅ 2. Human-in-the-Loop (4 tools)¶
mcp_request_admin_approval- Request admin approvalmcp_request_admin_input- Request admin inputmcp_respond_to_request- Admin response handlingmcp_list_pending_requests- List pending requests
Implementation: - Async request/response pattern - Multi-channel admin notifications (Email, Telegram, Slack) - Configurable timeouts - In-memory request tracking with webhook support
✅ 3. Instant Messaging (3 tools)¶
mcp_send_telegram_message- Send Telegram messagesmcp_send_slack_message- Send Slack webhooksmcp_send_discord_message- Send Discord webhooks
Implementation: - Telegram Bot API integration - Webhook-based messaging for Slack/Discord - Configurable default channels - Async message delivery
✅ 4. Email Notifications (1 tool)¶
mcp_send_email- Send email notifications
Implementation: - SMTP support (Gmail, etc.) - SendGrid API support - HTML and plain text emails - CC recipients and attachments support
✅ 5. Timer & Scheduling (5 tools)¶
mcp_set_timer- Set one-time timersmcp_set_recurring_timer- Set recurring timersmcp_cancel_timer- Cancel timersmcp_list_timers- List all timersmcp_get_timer_status- Check timer status
Implementation: - Async timer execution using asyncio - Persistent storage (JSON file) - Timer restoration on restart - Callback notifications via IM/Email
Total Tools Implemented¶
19 MCP Tools across 5 categories: - Browser: 5 tools - HITL: 4 tools - IM: 3 tools - Email: 1 tool - Timer: 5 tools - Management: 1 tool (shutdown)
Key Technologies¶
- MCP Protocol: FastMCP for server implementation
- Browser Automation: browser-use (Playwright-based)
- AI Integration: LangChain + OpenAI for autonomous tasks
- Async Framework: asyncio for non-blocking operations
- Configuration: Pydantic models + python-dotenv
- Notifications:
- Email: aiosmtplib (SMTP) + sendgrid
- IM: httpx for webhook APIs
- Telegram: Bot API via httpx
Configuration¶
All tools are configurable via environment variables:
# Browser
BROWSER_HEADLESS=false
BROWSER_USER_DATA_DIR=~/.config/collaboration-tools/browser
# Email
SMTP_HOST=smtp.gmail.com
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
SENDGRID_API_KEY=your-key
# IM
TELEGRAM_BOT_TOKEN=your-token
SLACK_WEBHOOK_URL=your-webhook
DISCORD_WEBHOOK_URL=your-webhook
# HITL
HITL_ADMIN_EMAIL=admin@example.com
HITL_TIMEOUT_SECONDS=3600
# Timer
TIMER_STORAGE_PATH=~/.config/collaboration-tools/timers.json
# AI (for browser tasks)
OPENAI_API_KEY=your-key
OPENAI_MODEL=gpt-5.6-luna
Usage¶
Start the MCP Server¶
Run Quick Start Demo¶
Run Real-World Example¶
Run Tests¶
Use with Claude Desktop¶
Add to claude_desktop_config.json:
{
"mcpServers": {
"collaboration-tools": {
"command": "python",
"args": ["/path/to/collaboration-tools/src/main.py"]
}
}
}
Example Workflows¶
1. Website Monitoring¶
# Navigate to website
await mcp_browser_navigate(url="https://example.com")
# Take screenshot
await mcp_browser_screenshot(full_page=True)
# Set recurring check
await mcp_set_recurring_timer(
interval_seconds=3600,
timer_name="Website Check"
)
# Notify via Slack
await mcp_send_slack_message(
message="🌐 Website monitoring started"
)
2. Admin Approval Flow¶
# Request approval
result = await mcp_request_admin_approval(
request_message="Delete 1000 database records?",
urgent=True,
timeout_seconds=300
)
if result["approved"]:
# Proceed with action
await mcp_send_email(
to_email="admin@example.com",
subject="✅ Operation Completed",
body="Database cleanup finished successfully"
)
3. Scheduled Task¶
# Set timer for delayed execution
timer = await mcp_set_timer(
duration_seconds=3600, # 1 hour
timer_name="Report Generation",
callback_message="Generate daily report"
)
# When timer expires, generate and email report
await mcp_send_email(
to_email="team@example.com",
subject="📊 Daily Report",
body=report_content
)
Architecture Highlights¶
Modular Design¶
- Each tool category in separate module
- Clean separation of concerns
- Easy to extend with new tools
Error Handling¶
- Consistent error response format
- Graceful degradation when services unavailable
- Detailed error logging
Async Operations¶
- Non-blocking I/O throughout
- Concurrent notification delivery
- Efficient timer management
State Management¶
- In-memory state with disk persistence
- Timer restoration on restart
- HITL request tracking
Testing¶
Basic Tests (test_basic.py)¶
- Configuration loading
- Timer functionality
- HITL tools
- Notification tools (mock)
- Browser tools (import check)
Demo Scripts¶
quickstart.py- All tools demonstrationclient_example.py- Real-world workflow
Documentation¶
- README.md - Main documentation with setup and usage
- IMPLEMENTATION.md - Technical implementation details
- USAGE_EXAMPLES.md - 7+ practical usage examples
- PROJECT_SUMMARY.md - This overview document
Dependencies¶
Core dependencies:
- mcp>=0.9.0 - MCP protocol support
- fastmcp>=0.2.0 - Fast MCP server framework
- browser-use>=0.1.0 - Browser automation
- playwright>=1.40.0 - Browser driver
- pydantic>=2.0.0 - Configuration validation
- aiosmtplib>=3.0.0 - Async SMTP
- sendgrid>=6.11.0 - SendGrid API
- httpx>=0.24.0 - Async HTTP client
- apscheduler>=3.10.0 - Scheduling support
Integration Points¶
As MCP Server¶
- Claude Desktop
- MCP-compatible clients
- Any application using MCP protocol
As Python Library¶
- Import tools directly
- Use ClientSession for tool calls
- Extend with custom tools
Future Enhancements¶
Potential additions: 1. Database storage for persistent state 2. Web dashboard for admin management 3. More IM platforms (WeChat, DingTalk) 4. SMS notifications 5. Advanced scheduling (cron expressions) 6. Tool usage analytics 7. Browser session recording/replay 8. Multi-browser support 9. Distributed timer management 10. Webhook server for HITL responses
Success Criteria¶
✅ All required features implemented: - ✅ Virtual browser (browser-use) - ✅ Human-in-the-loop tools - ✅ IM notifications (Telegram, Slack, Discord) - ✅ Email notifications - ✅ Timer/scheduling tools
✅ Production-ready code: - ✅ Comprehensive error handling - ✅ Configuration management - ✅ Logging throughout - ✅ Clean architecture - ✅ Extensive documentation - ✅ Working examples - ✅ Basic tests
Conclusion¶
This MCP server provides a complete collaboration toolkit for AI agents, enabling them to: - Automate web browser tasks - Request human assistance when needed - Send notifications across multiple channels - Schedule and time tasks - Coordinate complex workflows
The implementation follows best practices with clean architecture, comprehensive error handling, and extensive documentation, making it ready for production use or further extension.