Integrates Microsoft Agent Framework with Azure OpenAI (GPT-4.1 deployment) to provide AI agent capabilities with tool management through the Model Context Protocol.
ms-agentframework
Microsoft Agent Framework + MCP Protocol
🤖 Production-ready AI Agent Server | 生產級 AI 代理伺服器
ms-agentframework 是 Microsoft Agent Framework 與 Model Context Protocol (MCP) 的生產級整合,提供 SSE/HTTP 串流傳輸。
ms-agentframework is a production-ready integration of Microsoft Agent Framework with Model Context Protocol (MCP), providing SSE/HTTP streamable transport.
🎬 示範影片 | Demo Video
示範內容 | What the demo shows:
✅ 工具自動載入與註冊 | Automatic tool loading and registration
✅ 即時查詢處理 | Real-time query processing
✅ 多工具協同使用 | Multi-tool collaboration
✅ 結果即時顯示 | Real-time result display
示範影片展示了:
✅ 工具自動載入與註冊 | Automatic tool loading and registration
✅ 即時查詢處理 | Real-time query processing
✅ 多工具協同使用 | Multi-tool collaboration
✅ 結果即時顯示 | Real-time result display
The demo showcases:
✅ Automatic tool loading and registration
✅ Real-time query processing
✅ Multi-tool collaboration
✅ Real-time result display
✨ 特色 | Features
✅ Microsoft Agent Framework - 官方 Azure OpenAI 代理框架 | Official Azure OpenAI agent framework
✅ MCP 協議 - AI 代理工具的標準協議 | Standard protocol for AI agent tools
✅ SSE 傳輸 - Server-Sent Events 即時串流 | Server-Sent Events for real-time streaming
✅ Python uv - 現代化 Python 套件管理 | Modern Python package management
✅ FastAPI - 高效能異步網頁框架 | High-performance async web framework
✅ 生產就緒 - 包含 Docker、測試、監控 | Production ready with Docker, testing, monitoring
🚀 快速開始 | Quick Start
一行命令啟動 | One-Line Startup
或分步驟執行 | Or step by step
快速測試工具 | Quick Tool Testing
伺服器端點 | Server Endpoints
SSE 端點 | SSE Endpoint:
http://localhost:8000/sse訊息端點 | Messages Endpoint:
http://localhost:8000/messages健康檢查 | Health Check:
http://localhost:8000/healthAPI 文件 | API Docs:
http://localhost:8000/docs
📐 架構 | Architecture
MCP-MAF 實作三層架構 | MCP-MAF implements a three-layer architecture:
獨立代理 | Standalone Agent - 直接使用代理進行測試 | Direct agent usage for testing
遠端 MCP (SSE) | Remote MCP (SSE) - 生產伺服器模式 ⭐ | Production server mode ⭐
STDIO MCP - CLI 整合模式(可選)| CLI integration mode (optional)
🛠️ 開發 | Development
🐳 Docker
📚 文件 | Documentation
🔌 Codex CLI 整合 | Codex CLI Integration
配置方式 | Configuration
編輯 Claude Desktop 配置檔 | Edit Claude Desktop config:
路徑 | Path: ~/Library/Application Support/Claude/claude_desktop_config.json
使用方式 | Usage
📖 使用範例 | Usage Examples
獨立代理 | Standalone Agent
SSE 客戶端 | SSE Client
🧪 測試 | Testing
📋 可用工具 | Available Tools
🌤️ 天氣工具 | Weather Tool
取得任何地點的即時天氣資訊。| Get current weather information for any location.
用法 | Usage: get_weather(location: str)
範例 | Examples:
繁中:
"台北的天氣如何?"English:
"What's the weather in Taipei?"
🧮 計算機工具 | Calculator Tool
執行數學運算。| Perform mathematical calculations.
用法 | Usage: calculate(expression: str)
範例 | Examples:
繁中:
"計算 123 乘以 456"English:
"Calculate 123 * 456"
📊 股票價格工具 | Stock Price Tool
查詢台灣證券交易所股票價格。| Query Taiwan stock prices from TWSE.
用法 | Usage: get_stock_price(stock_code: str)
範例 | Examples:
繁中:
"台積電(2330)的股價是多少?"English:
"What's TSMC (2330) stock price?"
支援的股票 | Supported Stocks:
2330 - 台積電 | TSMC
2454 - 聯發科 | MediaTek
2317 - 鴻海 | Hon Hai (Foxconn)
更多... | And more...
🔧 配置 | Configuration
環境變數在 .env 中配置 | Environment variables are configured in .env:
📊 技術棧 | Tech Stack
核心技術 | Core Technologies
Python 3.11+ - 現代 Python | Modern Python
uv - 快速套件管理器 | Fast package manager
FastAPI - 異步網頁框架 | Async web framework
Uvicorn - ASGI 伺服器 | ASGI server
AI 與雲端 | AI & Cloud
Microsoft Agent Framework - Azure AI 代理 | Azure AI agents
Azure OpenAI - GPT-4.1 部署 | GPT-4.1 deployment
OpenAI SDK - 後備 SDK | Fallback SDK
協議與傳輸 | Protocol & Transport
MCP (Model Context Protocol) - 2024-11-05 規範 | 2024-11-05 spec
JSON-RPC 2.0 - 遠端程序調用 | Remote procedure calls
SSE (Server-Sent Events) - 即時串流 | Real-time streaming
🤝 貢獻 | Contributing
歡迎貢獻!請閱讀 CONTRIBUTING.md 了解詳情。
Contributions are welcome! Please read CONTRIBUTING.md for details.
📄 授權 | License
MIT 授權 - 詳見 LICENSE 檔案。
MIT License - see LICENSE for details.
🙏 致謝 | Acknowledgments
Microsoft Agent Framework - 微軟代理框架 | Microsoft's agent framework
Model Context Protocol - MCP 協議規範 | MCP protocol specification
FastAPI - 現代網頁框架 | Modern web framework
Agent Lucy - 參考實作 | Reference implementation
📞 支援 | Support
問題回報 | Issues: GitHub Issues
討論區 | Discussions: GitHub Discussions
📈 專案狀態 | Project Status
✅ 已完成 | Completed:
基礎架構 | Core architecture
MCP 協議實作 | MCP protocol implementation
SSE 傳輸層 | SSE transport layer
三個範例工具 | Three example tools
Docker 支援 | Docker support
完整測試 | Complete testing
文件撰寫 | Documentation
🚧 計劃中 | Planned:
STDIO 傳輸 | STDIO transport
更多工具 | More tools
CI/CD 管道 | CI/CD pipeline
效能優化 | Performance optimization
版本 | Version: 1.0.0 作者 | Author: Jimmy Liao 用 ❤️ 打造 | Built with ❤️ 使用 | using Microsoft Agent Framework and MCP Protocol
Co-Authored-By: Agent-Lucy hi@leapdesign.ai