AutoGen MCP扩展工具

提供AutoGen与模型上下文协议(MCP)的集成,使AutoGen代理能够无缝连接各种数据源和工具。

  • by richard-gyiko
  • Python
  • 本地部署
  • 59 星标
  • 更新于
在 GitHub 查看 richard-gyiko/autogen-ext-mcp

使用说明

MCP工具的AutoGen扩展

🚨 此存储库现已存档 🚨

该项目的功能已直接集成到官方 autogen-ext 套餐,可从 version v0.4.6.
现在,您可以直接在中使用它 autogen-ext 而不需要这个单独的包。

有关进一步的更新和改进,请参阅官方 autogen 存储库。

关于

此软件包提供以下功能之间的集成 微软AutoGen 和那个 模型上下文协议(MCP),使AutoGen代理能够与各种数据源和工具无缝连接。

MCP是一个开放标准,它实现了人工智能系统和数据源之间的安全双向连接,用单一的通用协议取代了分散的集成。这允许AI助手在不同工具和数据集之间移动时保持上下文。

安装

pip install autogen-ext-mcp

特性

  • MCP工具与AutoGen代理的无缝集成
  • 连接到任何兼容MCP的数据源或工具
  • MCP工具模式自动转换为AutoGen兼容格式

快速开始

from autogen_ext_mcp.tools import mcp_server_tools, StdioServerParams
from pathlib import Path

# Get desktop path cross-platform
desktop_path = str(Path.home() / "Desktop")

# Connect to FileSystem MCP server
server_params = StdioServerParams(
    command="npx",
    args=[
        "-y",
        "@modelcontextprotocol/server-filesystem",
        desktop_path,  # Allow access to Desktop directory
    ]
)

# Get tools
tools = await mcp_server_tools(server_params)

# Use tools with AutoGen agents
# The tools can be passed to any AutoGen agent that supports tool use

样品

看看 示例目录 例如关于开始使用AutoGen MCP扩展的代码和详细说明。这些示例演示了将MCP工具与AutoGen代理集成的常见用例和最佳实践。

资源

贡献

欢迎投稿!请随时提交拉取请求。