Skip to content

Conversation

aaronsteers
Copy link
Contributor

feat: add agent framework examples for MCP wrapper

Summary

Adds a new examples/ folder containing demonstration scripts for wrapping the connector-builder-mcp and pyairbyte-mcp servers using different AI agent frameworks. This addresses the request to explore headless options for automated connector building.

Key additions:

  • upsonic_example.py: Demonstrates using the Upsonic AI agent framework for simple MCP orchestration
  • autogen_example.py: Demonstrates using Microsoft AutoGen for sophisticated multi-agent connector building workflows
  • README.md: Comprehensive documentation with usage instructions, prerequisites, and troubleshooting

Both scripts use uv inline dependency syntax for easy execution and demonstrate the core workflow: API discovery → manifest generation → validation → testing → iteration.

Review & Testing Checklist for Human

⚠️ High Priority (3 items):

  • Test uv script execution: Run uv run examples/upsonic_example.py and uv run examples/autogen_example.py to verify the inline dependency syntax works and scripts don't crash on import
  • Verify framework APIs: Check that the Upsonic and AutoGen APIs used in the scripts match actual available APIs (especially Agent.add_mcp_server(), MCPAgent, etc.)
  • Validate MCP tool integration: Ensure the MCP tool calls (like list_connectors, validate_manifest, execute_stream_test_read) match what's actually available in the running MCP servers

Test Plan: Set up both MCP servers locally, install the required dependencies, and attempt to run through at least the initial import and setup phases of both example scripts.


Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    examples["examples/"] --> upsonic["upsonic_example.py"]:::major-edit
    examples --> autogen["autogen_example.py"]:::major-edit  
    examples --> readme["README.md"]:::major-edit
    
    upsonic --> mcp1["connector-builder-mcp<br/>validate_manifest<br/>execute_stream_test_read"]:::context
    upsonic --> mcp2["pyairbyte-mcp<br/>list_connectors<br/>get_connector_info"]:::context
    
    autogen --> mcp1
    autogen --> mcp2
    
    upsonic --> deps1["uv dependencies:<br/>upsonic>=0.1.0<br/>fastmcp>=0.1.0"]:::context
    autogen --> deps2["uv dependencies:<br/>pyautogen>=0.2.0<br/>openai>=1.0.0"]:::context
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit
        L3[Context/No Edit]:::context
    end
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB  
    classDef context fill:#FFFFFF
Loading

Notes

  • Framework choice rationale: Selected Upsonic for simplicity/reliability and AutoGen for sophisticated multi-agent workflows based on research of available MCP-compatible frameworks
  • uv syntax validation: Confirmed inline dependency syntax matches official uv documentation format
  • Untested demonstration code: These are conceptual examples that demonstrate integration patterns but haven't been executed end-to-end with real MCP servers
  • Session context: Requested by AJ Steers (@aaronsteers) - Devin session

- Add examples folder with Upsonic and AutoGen framework examples
- Include proper uv inline dependency syntax for script execution
- Provide comprehensive README with usage instructions
- Demonstrate MCP server integration for automated connector building
- Support both simple (Upsonic) and multi-agent (AutoGen) approaches

Co-Authored-By: AJ Steers <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings August 10, 2025 23:14
Copy link
Contributor

Original prompt from AJ Steers
@Devin - let's explore headless options to wrap connector builder MCP into an agent that can build connectors given only the source API name and creds

Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions github-actions bot added the enhancement New feature or request label Aug 10, 2025
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This Branch via MCP

To test the changes in this specific branch with an MCP client like Claude Desktop, use the following configuration:

{
  "mcpServers": {
    "connector-builder-mcp-dev": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/airbytehq/connector-builder-mcp.git@devin/1754867314-add-agent-framework-examples", "connector-builder-mcp"]
    }
  }
}

Testing This Branch via CLI

You can test this version of the MCP Server using the following CLI snippet:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/connector-builder-mcp.git@devin/1754867314-add-agent-framework-examples#egg=airbyte-connector-builder-mcp' --help

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poe <command> - Runs any poe command in the uv virtual environment

📝 Edit this welcome message.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new examples/ directory demonstrating how to integrate the connector-builder-mcp and pyairbyte-mcp servers with AI agent frameworks for automated connector building. The examples showcase headless automation workflows as alternatives to manual connector development.

Key changes:

  • Two complete example implementations using different agent frameworks (Upsonic and AutoGen)
  • Comprehensive documentation with setup instructions and troubleshooting guidance
  • Self-contained scripts using uv inline dependency management for easy execution

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
examples/upsonic_example.py Simple single-agent implementation demonstrating MCP server integration with Upsonic framework
examples/autogen_example.py Sophisticated multi-agent system using Microsoft AutoGen for collaborative connector building
examples/README.md Comprehensive documentation covering setup, usage, customization, and troubleshooting

name="pyairbyte",
server_path="pyairbyte-mcp",
description="Tools for connector discovery and local operations"
)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method 'add_mcp_server' may not exist in the Upsonic Agent API. The actual method for configuring MCP servers should be verified from the Upsonic documentation.

Suggested change
)
connector_builder_server = MCPServer(
name="connector-builder",
server_path="connector-builder-mcp",
description="Tools for validating and testing connector manifests"
)
self.agent.register_mcp_server(connector_builder_server)
pyairbyte_server = MCPServer(
name="pyairbyte",
server_path="pyairbyte-mcp",
description="Tools for connector discovery and local operations"
)
self.agent.register_mcp_server(pyairbyte_server)

Copilot uses AI. Check for mistakes.

args={"keyword": api_name, "connector_type": "source"}
)

checklist = await self.agent.call_mcp_tool(
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method 'call_mcp_tool' may not exist in the Upsonic Agent API. The correct method name for executing MCP tools should be verified.

Suggested change
checklist = await self.agent.call_mcp_tool(
similar_connectors = await self.agent.run_mcp_tool(
server="pyairbyte",
tool="list_connectors",
args={"keyword": api_name, "connector_type": "source"}
)
checklist = await self.agent.run_mcp_tool(

Copilot uses AI. Check for mistakes.

"server_path": "pyairbyte-mcp"
}
]
)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'MCPAgent' class and its constructor parameters (especially 'mcp_servers') may not match the actual AutoGen API. The correct agent type and configuration method should be verified.

Suggested change
)
self.mcp_agents = {
"connector_builder": MCPAgent(
name="connector_builder_mcp",
system_message="""You coordinate connector-builder MCP server interactions. Your role is to:
1. Execute MCP tool calls for connector building operations
2. Manage communication between agents and MCP servers
3. Handle error recovery for MCP operations
4. Provide MCP tool results to other agents""",
llm_config=self.llm_config,
server_path="connector-builder-mcp"
),
"pyairbyte": MCPAgent(
name="pyairbyte_mcp",
system_message="""You coordinate pyairbyte MCP server interactions. Your role is to:
1. Execute MCP tool calls for connector building operations
2. Manage communication between agents and MCP servers
3. Handle error recovery for MCP operations
4. Provide MCP tool results to other agents""",
llm_config=self.llm_config,
server_path="pyairbyte-mcp"
)
}

Copilot uses AI. Check for mistakes.

- Testing streams (connector-builder server)
"""

chat_result = await self.manager.a_initiate_chat(
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method 'a_initiate_chat' may not exist in AutoGen's GroupChatManager. The correct async method name should be verified from the AutoGen documentation.

Suggested change
chat_result = await self.manager.a_initiate_chat(
chat_result = await self.manager.a_run_chat(

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Aug 10, 2025

PyTest Results (Fast)

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit c4cadc8. ± Comparison against base commit 604a482.

♻️ This comment has been updated with latest results.

devin-ai-integration bot and others added 7 commits August 10, 2025 23:21
- Add examples/mcp_use_demo.py showing mcp-use wrapper usage
- Demonstrate direct tool calls, LLM integration, and workflows
- Use uv inline dependencies for easy execution
- Include comprehensive README with usage instructions
- Gracefully handle missing mcp-use dependency with informative output

Co-Authored-By: AJ Steers <[email protected]>
- Add basic_mcp_example.py for workflow demonstration
- Add working_mcp_example.py with simulated responses
- Add real_mcp_integration_example.py with actual MCP calls
- Update README.md to document all five examples
- All examples use correct uv inline dependency syntax
- Demonstrate different approaches to MCP server integration

Co-Authored-By: AJ Steers <[email protected]>
- Fix Ruff Format Check CI failure
- Apply automatic code formatting to examples/mcp_use_demo.py

Co-Authored-By: AJ Steers <[email protected]>
- Add required # /// script block with dependencies
- Addresses Copilot feedback about missing uv inline dependencies
- Enables zero-setup execution with uv run examples/mcp_use_demo.py

Co-Authored-By: AJ Steers <[email protected]>
- Fix formatting issues introduced by uv inline dependency block
- Addresses CI Ruff Format Check failure

Co-Authored-By: AJ Steers <[email protected]>
…ample' into devin/1754867314-add-agent-framework-examples (keep both docs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant