使用说明
🤖 MCP代理-通用人工智能自动化
The Ultimate AI Agent powered by Model Context Protocol (MCP)
Next-generation AI automation at your fingertips!
🌟 什么是MCP代理?
MCP代理 是一款革命性的人工智能自动化工具,结合了以下功能:
- 🧠 高级语言模型 (Groq、OpenAI、Gemini)
- 🌐 浏览器自动化 (剧作家)
- 🔌 模型上下文协议 (MCP)服务器
- 💬 对话式人工智能 带记忆
想象一下,有一个个人人工智能助理,可以浏览网页、填写表格、截图和执行复杂任务——所有这些都是通过自然对话完成的!
🚀 主要特点
🎯 核心能力
| 功能 | 描述 | 功率级别 |
|---|---|---|
| 🤖 对话式人工智能 | 自然语言与记忆的互动⚡⚡⚡⚡⚡ | |
| 🌐 浏览器控件 | 使用Playwright实现全面的网络自动化⚡⚡⚡⚡⚡ | |
| 🔌 MCP集成 | 连接到任何MCP服务器 | ⚡⚡⚡⚡ |
| 🧠 智能记忆 | 上下文感知对话 | ⚡⚡⚡⚡ |
| ⚡ 多LLM | 在AI模型之间切换 | ⚡⚡⚡ |
| 📱 交叉平台的 | 适用于Windows、Mac、Linux⚡⚡⚡⚡⚡ |
🎪 它能做什么?
- 📸 截图 任何网站
- 🔍 搜索和浏览 网络自动
- 📝 填写表格 并提交数据
- 🛒 自动购物 以及预订
- 📊 提取数据 来自网站
- 🎯 测试web应用程序
- 📧 自动化电子邮件 任务
- 🗂️ 整理文件 和文件夹
🛠️ 技术栈
graph TD
A[MCP Agent] --> B[LangChain]
A --> C[MCP Protocol]
A --> D[Playwright]
A --> E[Groq LLM]
B --> F[Python 3.13+]
C --> G[MCP Servers]
D --> H[Browser Control]
E --> I[AI Models]
style A fill:#ff6b6b,stroke:#333,stroke-width:4px
style B fill:#4ecdc4,stroke:#333,stroke-width:2px
style C fill:#45b7d1,stroke:#333,stroke-width:2px
style D fill:#96ceb4,stroke:#333,stroke-width:2px
style E fill:#ffeaa7,stroke:#333,stroke-width:2px
🏗️ 架构组件
- 🧠 核心引擎:带asyncio的Python 3.13+
- 🔗 框架:用于AI编排的LangChain
- 🌐 协议:模型上下文协议(MCP)
- 🎭 自动化:用于浏览器控制的剧作家
- 💭 模型:Groq(Llama 3.1)、OpenAI、谷歌双子座
- 📦 管理:UV包管理器
🚀 快速开始
📋 先决条件
- Python 3.13+ 🐍
- Node.js (适用于MCP服务器)📦
- UV包管理器 ⚡
- Groq API密钥 🔑
⚡ 5分钟设置
-
🌟 克隆存储库
git clone https://github.com/yourusername/mcpwheather.git cd mcpwheather -
📦 再进行
uv sync -
🔑 配置API密钥
echo "GROQ_API_KEY=your_groq_api_key_here" > .env -
🚀 启动代理
uv run app.py -
💬 开始聊天!
you: open google.com and search for AI automation
🎮 用法示例
🌐 Web自动化
# Browse and search
you: open google.com and search for "weather in Tokyo"
# Take screenshots
you: navigate to github.com and take a screenshot
# Fill forms
you: go to example.com/contact and fill out the form with name "John" and email "john@example.com"
# Extract data
you: visit amazon.com and find the price of the latest iPhone
🤖 高级任务
# Multi-step workflows
you: book a flight from New York to London for next week, find the cheapest option
# Data collection
you: visit reddit.com/r/technology and get the top 5 post titles
# Testing
you: test the login functionality of example.com with username "test" and password "test123"
🎯 交互式命令
| 命令 | 操作 | 表情符号 |
|---|---|---|
exit / quit |
结束会话 | 👋 |
clear |
清除内存 | 🧹 |
memory |
查看历史记录 | 🧠 |
help |
显示帮助 | 🆘 |
🔧 配置
🎛️ 环境变量
# Required
GROQ_API_KEY=your_groq_api_key_here
# Optional - Additional LLMs
OPENAI_API_KEY=your_openai_key_here
GOOGLE_API_KEY=your_google_key_here
# Optional - MCP Server Tokens
GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token
🔌 自定义MCP服务器
config = {
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token"}
}
}
}
🌍 部署选项
🏠 本地安装
# Run from project directory
uv run app.py
# Install globally
pip install -e .
mcp-agent
🐳 Docker部署
FROM python:3.13-slim
WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY . .
RUN uv sync --frozen
CMD ["uv", "run", "app.py"]
docker build -t mcp-agent .
docker run -it --env-file .env mcp-agent
☁️ 云部署
- AWS Lambda 🚀
- 谷歌云运行 ☁️
- Azure功能 🔷
- 铁路 🚂
- 渲染 🎨
📁 项目结构
mcpwheather/
├── 📄 app.py # Main application entry point
├── 📄 pyproject.toml # Project configuration
├── 📄 .env # Environment variables
├── 📄 .python-version # Python version
├── 📄 uv.lock # Dependency lock file
├── 📄 README.md # Project documentation
└── 📄 .gitignore # Git ignore rules
🔍 故障排除
🐛 常见问题
| 问题 | 解决方案 | 状态 |
|---|---|---|
ModuleNotFoundError |
快跑 uv sync |
✅ 已修复 |
| API关键问题 | 检查 .env 文件 |
✅ 已修复 |
| 浏览器未启动 | 安装Node.js | ✅ 已修复 |
| 权限被拒绝 | 使用 chmod +x |
✅ 已修复 |
| Docker构建失败 | 检查Dockerfile | ✅ 已修复 |
🆘 获取帮助
# Check dependencies
uv tree
# Test API connection
python -c "from langchain_groq import ChatGroq; print('✅ API OK')"
# Verify MCP server
npx @playwright/mcp@latest --help
🚀 路线图
🎯 即将推出
- [ ] 🌐 网络界面 -基于React的仪表板
- [ ] 📱 移动应用程序 -iOS和Android支持
- [ ] 🔌 插件商店 -社区插件
- [ ] 📊 分析 -使用情况跟踪和洞察
- [ ] 🔄 多Agent -并行任务执行
- [ ] 🎨 主题 -可定制的个性
- [ ] 🌍 多语言 -国际支持
- [ ] ☁️ 云同步 -跨设备同步
💡 未来想法
- 🧠 AI培训 -自定义模型微调
- 🔗 API集成 -连接到任何服务
- 📈 商业智能 -自动报告
- 🎮 游戏自动化 -机器人开发工具
- 🏢 企业功能 -团队协作
🤝 贡献
我们欢迎捐款! 🎉
📝 如何做出贡献
- 🍴 分叉存储库
- 🌿 创建要素分支
- 💻 进行更改
- 🧪 添加测试
- 📤 提交拉取请求
🎨 开发设置
# Clone your fork
git clone https://github.com/yourusername/mcpwheather.git
cd mcpwheather
# Set up development environment
python -m venv .venv
source .venv/bin/activate
uv sync --dev
# Run tests
uv run pytest
# Start coding! 🚀
📄 许可证
该项目根据 MIT许可证 -看看 许可证 文件以获取详细信息。
🙏 致谢
- 🧠 LangChain -对于令人惊叹的AI框架
- 🔌 MCP协议 -用于标准化的人工智能通信
- 🎭 剧作家 -实现强大的浏览器自动化
- ⚡ Groq -用于闪电般快速的AI推理
- 🐍 python -最好的编程语言
- 🎨 动画表情符号 -为了美丽的图标
📞 联系与支持
- 📧 电子邮件: support@mcp-agent.com
- 💬 Discord 的中文翻译是“不和谐”或“纷争”。: 加入我们的社区
- 🐦 推特: @MCP_代理
- 📖 文档: docs.mcp-agent.com
- 🐛 问题: GitHub问题
Made with ❤️ by the MCP Agent Team
Powering the future of AI automation
If you love this project, give us a ⭐ on GitHub!