How richard-gyiko/autogen-ext-mcp works
Project type and purpose
• This is a Python library (“autogen-ext-mcp”) that integrates Microsoft AutoGen agents with external data sources/tools via the Model Context Protocol (MCP).
• It exposes a set of “tool factories” (e.g., StdioServerParams, mcp_server_tools) that spin up or connect to MCP-compliant servers and convert their schemas into AutoGen-compatible tool objects.
File structure
• Top‐level:
• .github/workflows/: CI for build & publish (GitHub Actions)
• pyproject.toml, README.md, LICENSE: packaging & project metadata
• src/autogen_ext_mcp/: core code, subdivided into tools/ modules
• samples/: usage examples
• tests/: unit tests for adapters
• tools/ submodules reveal the internal architecture:
• _config.py: parameter definitions (e.g., server params)
• _factory.py: creation of tool objects
• _session.py: session management with MCP server
• _sse.py: event streaming interface
• _stdio.py: stdio transport implementation
• _base.py: common abstractions for all tools
README for additional insights
• Purpose: wrap any MCP-compliant server into AutoGen tools
• Usage flow:
a. Instantiate ServerParams (e.g., StdioServerParams)
b. Call await mcp_server_tools(server_params)
c. Pass returned tool list into an AutoGen agent
Detail
• Submodule appears if it has a distinct responsibility—don’t lump session and stdio together if both are vital.