Skip to content

MCP#

Connect AG2 Agents to 8,000+ Tools with Arcade.dev

AG2 x Arcade.dev

Overview

Arcade.dev is a tool execution runtime that provides 8,000+ pre-built integrations with just-in-time authorization. It sits between your agents and enterprise systems: your agent calls a tool, the user authenticates once through Arcade, and Arcade handles token management, scope negotiation, and credential storage from that point on. No service accounts, no secrets in your codebase.

This solves common problems when connecting agents to external services:

  • Building and maintaining OAuth flows for each API (Gmail, Linear, Slack, etc.)
  • Managing token lifecycle: refresh, rotation, expiry
  • Storing credentials securely and isolating them from the LLM layer
  • Handling scope negotiation and incremental authorization

In this post, we'll build a Gmail assistant using AG2 and the Arcade SDK. The agent will list, search, read threads, send, reply, and archive emails using AG2's AssistantAgent + UserProxyAgent, pattern while Arcade handles all the authentication and API complexity behind the scenes.

AG2 Multi-MCP Session Management: Dynamic Server Connections with MCPClientSessionManager

AG2's MCPClientSessionManager revolutionizes how you connect to multiple MCP (Model Context Protocol) servers by enabling on-demand session creation within your agent workflows. Instead of maintaining persistent connections, you can now dynamically open sessions to different servers—whether they use stdio or SSE transports—right inside your tool functions.

This article explores how to leverage MCPClientSessionManager for flexible, resource-efficient multi-server agent architectures, with practical examples for building research assistants, data pipelines, and intelligent routing systems.