项目简介
'atlas-ui-3' 是一个功能丰富的LLM聊天界面,支持多种大型语言模型。其核心亮点在于深度集成了Model Context Protocol (MCP),不仅能连接外部MCP服务,还自身托管了大量开箱即用的MCP服务器。这些服务器通过标准化协议为LLM客户端提供各种工具、数据和Prompt,极大地扩展了LLM的应用能力,包括数据分析、文件管理、计算、内容生成等。
主要功能点
- 多LLM支持: 可连接OpenAI GPT、Anthropic Claude、Google Gemini等多种LLM。
- MCP服务集成: 作为MCP客户端,连接并管理多个MCP服务器,以获取和执行工具、访问数据源、应用Prompt模板。
- 内嵌MCP服务器群: 提供了以下MCP服务器,涵盖了广泛的功能:
- Calculator (计算器): 提供数学表达式安全评估功能。
- PDF Analyzer (PDF分析): 提取、分析PDF文本内容,生成词频报告。
- Thinking (思维链): 结构化思考工具,用于组织思路、问题分解。
- UI Demo (UI演示): 演示MCP服务器如何通过HTML自定义UI界面。
- CSV/XLSX Analyzer (电子表格分析): 自动分析电子表格,检测数值列并生成统计图表。
- CSV Reporter (CSV报告): 为CSV文件生成统计报告、相关性矩阵图和时间序列图。
- Progress Demo (进度演示): 演示长时间运行任务的实时进度更新。
- Corporate Cars (企业车队RAG): 模拟企业车队数据源,提供RAG(检索增强生成)服务。
- PowerPoint Generator (PPTX生成): 将JSON或Markdown转换为PPTX演示文稿,支持图片嵌入。
- Web Searcher (网页搜索): 使用DuckDuckGo进行网页搜索并获取内容。
- File Size Test (文件大小测试): 测试文件传输,返回文件大小。
- Order Database (订单管理): 模拟订单数据库,提供订单查询与状态更新。
- Filesystem (文件系统): 提供受限的文件系统读写、目录列表功能。
- Prompts (Prompt管理): 托管多个预定义的AI人格和专业领域系统Prompt。
- Code Executor (代码执行): 安全沙盒化的Python代码执行环境,支持数据分析和可视化。
- 实时通信: 基于WebSocket的聊天接口。
- 文件管理: 内置S3兼容的文件存储功能,支持用户上传和工具生成的文件管理。
- 代理模式 (Agent Mode): 支持基于ReAct和Think-Act策略的自动化代理,实现多步推理和工具协同。
安装步骤
本仓库同时包含MCP客户端(聊天UI后端)和多个内嵌的MCP服务器。启动聊天UI后端会自动启动这些内嵌的MCP服务器。
Docker (推荐)
- 构建Docker镜像: 在项目根目录执行:
docker build -t atlas-ui-3 . - 运行容器:
docker run -p 8000:8000 atlas-ui-3 - 访问: 在浏览器中打开 'http://localhost:8000'。
本地开发
- 安装 'uv' 包管理器: 如果尚未安装,执行:
curl -LsSf https://astral.sh/uv/install.sh | sh - 设置Python环境: 在项目根目录执行:
uv venv && source .venv/bin/activate # Windows用户请使用:.venv\Scripts\activate - 安装依赖:
uv pip install -r requirements.txt - 配置API密钥: 复制 '.env.example' 文件到 '.env',并编辑 '.env' 文件,填入您的API密钥等配置信息。
cp .env.example .env # 编辑 .env 文件 - 构建前端: 进入 'frontend' 目录并构建:
cd frontend && npm install && npm run build - 启动后端: 返回项目根目录,然后进入 'backend' 目录,执行:
(此命令将启动 'atlas-ui-3' 的FastAPI后端,它会自动初始化并启动所有内嵌的MCP服务器。)cd ../backend && python main.py - 或者使用快捷启动脚本 (推荐): 在项目根目录执行:
(此脚本会启动所有必要的组件,包括S3 mock、LLM mock和MCP servers。)bash agent_start.sh
MCP服务器配置示例
MCP客户端(如 'atlas-ui-3' 的后端模块)通过配置文件连接MCP服务器。以下是一个在 'config/overrides/mcp.json' 文件中配置内嵌MCP服务器的示例。请根据您的实际部署路径('cwd')和启动命令('command')进行调整。
{ "calculator": { "description": "提供数学表达式安全评估功能。", "author": "Chat UI Team", "short_description": "基本数学计算", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/calculator/main.py"], "cwd": "/path/to/atlas-ui-3" }, "pdfbasic": { "description": "提取、分析PDF文本内容并生成报告。", "author": "Chat UI Team", "short_description": "PDF分析工具", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/pdfbasic/main.py"], "cwd": "/path/to/atlas-ui-3" }, "thinking": { "description": "结构化思考工具,用于组织思路和问题分解。", "author": "Chat UI Team", "short_description": "结构化思考", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/thinking/main.py"], "cwd": "/path/to/atlas-ui-3" }, "ui-demo": { "description": "演示MCP服务器如何通过HTML自定义UI界面。", "author": "Chat UI Team", "short_description": "自定义UI演示", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/ui-demo/main.py"], "cwd": "/path/to/atlas-ui-3" }, "basictable": { "description": "自动分析CSV/XLSX电子表格并生成统计图表。", "author": "Chat UI Team", "short_description": "电子表格分析", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/basictable/main.py"], "cwd": "/path/to/atlas-ui-3" }, "csv_reporter": { "description": "为CSV文件生成统计报告、相关性矩阵图和时间序列图。", "author": "Chat UI Team", "short_description": "CSV数据报告", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/csv_reporter/main.py"], "cwd": "/path/to/atlas-ui-3" }, "progress_demo": { "description": "演示长时间运行任务的实时进度更新。", "author": "Chat UI Team", "short_description": "任务进度演示", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/progress_demo/main.py"], "cwd": "/path/to/atlas-ui-3" }, "corporate_cars": { "description": "模拟企业车队数据源,提供RAG服务。", "author": "Chat UI Team", "short_description": "企业车队RAG", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/corporate_cars/main.py"], "cwd": "/path/to/atlas-ui-3" }, "pptx_generator": { "description": "将JSON或Markdown转换为PPTX演示文稿,支持图片嵌入。", "author": "Chat UI Team", "short_description": "PPTX生成", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/pptx_generator/main.py"], "cwd": "/path/to/atlas-ui-3" }, "websearcher": { "description": "使用DuckDuckGo进行网页搜索并获取内容。", "author": "Chat UI Team", "short_description": "网页搜索工具", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/duckduckgo/main.py"], "cwd": "/path/to/atlas-ui-3" }, "file_size_test": { "description": "测试文件传输功能,返回文件大小和处理结果。", "author": "Chat UI Team", "short_description": "文件传输测试", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/file_size_test/main.py"], "cwd": "/path/to/atlas-ui-3" }, "order_database": { "description": "模拟订单数据库,提供订单查询与状态更新功能。", "author": "Chat UI Team", "short_description": "订单管理", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/order_database/main.py"], "cwd": "/path/to/atlas-ui-3" }, "filesystem": { "description": "提供受限的文件系统读写、目录列表功能。", "author": "Chat UI Team", "short_description": "文件系统操作", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/filesystem/main.py"], "cwd": "/path/to/atlas-ui-3" }, "prompts": { "description": "托管多个预定义的AI人格和专业领域系统Prompt。", "author": "Chat UI Team", "short_description": "AI Prompt管理", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/prompts/main.py"], "cwd": "/path/to/atlas-ui-3" }, "code-executor": { "description": "安全沙盒化的Python代码执行环境,支持数据分析和可视化。", "author": "Chat UI Team", "short_description": "代码执行", "groups": ["users"], "enabled": true, "command": ["python", "backend/mcp/code-executor/main.py"], "cwd": "/path/to/atlas-ui-3" } }
基本使用方法
启动 'atlas-ui-3' 应用后,在聊天界面中,您可以通过侧边栏的“工具与集成”面板或在AI代理模式下与AI直接对话来选择并启用这些MCP工具或Prompt。AI助手将根据您的请求智能调用相应的工具来完成任务,例如:
- 请求“计算 2 + 3 * 4”以调用Calculator工具。
- 上传PDF文件后,请求“分析这个PDF文件”以调用PDF Analyzer工具。
- 在对话中选择启用“Expert Dog Trainer”Prompt,让AI以专业训犬师的身份进行交流。
- 提供Python代码并请求AI“执行这段代码进行数据分析”以调用Code Executor。
信息
分类
AI与计算