使用说明
🔌 Mcp-Core
RAG agent with MCP and Llama 3.2 — instantly connects your tools and knowledge base
Fully dockerized proof-of-concept: AI agent that autonomously queries a knowledge server via MCP.
🧠 运作原理
在Docker中运行的三个微服务,像私人房间里的三个朋友一样相互交谈:
Your Browser / curl
│
▼
┌──────────────┐ MCP (SSE) ┌───────────────┐
│ RAG Agent │ ◄───────────────► │ MCP Knowledge │
│ (FastAPI) │ │ Server │
│ LangChain │ │ (FastMCP) │
└──────┬───────┘ │ Mock: Drive, │
│ │ Slack data │
│ Ollama API └───────────────┘
▼
┌──────────────┐
│ Ollama │
│ Llama 3.2 │
└──────────────┘
| 服务 | 角色 | 功能 |
|---|---|---|
| 🧠 RAG代理 | Brain | LangChain代理——决定调用哪个工具 |
| 🔧 MCP知识 | 工具箱 | 通过MCP提供模拟Google Drive和Slack数据 |
| ⚙️ 奥拉玛 | 引擎 | 本地运行Llama 3.2进行文本处理 |
🚀 快速开始
# 1. Clone
git clone https://github.com/Nikhilchapkanade/Mcp-Core.git
cd Mcp-Core
# 2. Build and start
docker-compose up --build
# 3. Download the LLM (in a new terminal)
docker exec -it mcp-rag-system-ollama-1 ollama pull llama3.2
🧪 测试IT
场景A——“谷歌云端硬盘”搜索:
curl "http://localhost:8080/query?q=What%20is%20the%20pricing%20for%20Enterprise"
# → "The Enterprise plan costs $50/user/month."
场景B——“松弛”检查:
curl "http://localhost:8080/query?q=What%20about%20the%20memory%20leak"
# → Agent searches Slack history for context
📁 项目结构
Mcp-Core/
├── docker-compose.yml # Connects 3 services
├── rag-agent/ # The Brain
│ ├── Dockerfile
│ ├── server.py # FastAPI server
│ ├── agent.py # LangChain tool routing
│ ├── mcp_client.py # MCP connection manager
│ └── requirements.txt
└── mcp-knowledge/ # The Toolbox
├── Dockerfile
├── main.py # Mock Google/Slack tools via FastMCP
└── requirements.txt
🛠️ 技术栈
| 组件 | 技术 |
|---|---|
| AI协议 | 模型上下文协议(MCP) |
| LLM | 通过Ollama拨打3.2 |
| 代理框架 | LangChain |
| API服务器 | FastAPI |
| MCP服务器 | FastMCP(SSE传输) |
| 基础设施 | Docker Compose |
