tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK and MCP Integration

ADK and MCP Integration

Author: Venkata Sudhakar

Model Context Protocol (MCP) is an open standard for connecting AI agents to tools and data sources. ADK has built-in MCP support - connect your ADK agent to any MCP server and it immediately has access to all exposed tools. If your company has an MCP server for inventory, CRM, or ERP, connecting an ADK agent takes a few lines of code with zero custom integration work. ADK discovers tools automatically at startup and the agent calls MCP tools identically to Python functions - the protocol is completely transparent.

ADK supports two MCP connection types: MCPToolset with StdioServerParameters for a local stdio process, and SseServerParams for a remote HTTP/SSE server. Pass the MCPToolset in the agent tools list alongside any custom Python functions - the agent uses all of them interchangeably. ADK handles tool discovery, JSON schema parsing, and the full MCP protocol. Multiple MCP toolsets can be combined in one agent for access to multiple enterprise systems simultaneously.

The below example connects an ADK procurement agent to the inventory MCP server from Tutorial 304, then demonstrates combining local and remote MCP servers in one agent for a full enterprise stack.


It gives the following output showing transparent MCP tool calls,

[ADK calls MCP tool: search_products(query="laptops")]
We have one laptop: SKU-001 Dell XPS 15 Laptop - 8 units at Rs 1,24,999. Status: OK.

[ADK calls MCP tool: get_low_stock_alerts()]
URGENT - 2 products below reorder point:
1. SKU-003: Samsung 65-inch QLED TV - 4 units (reorder point 5). Raise PO today.
2. SKU-005: iPad Air M2 - 3 units (reorder point 5). Raise PO today.

# ADK discovered 3 MCP tools automatically on startup
# Agent called them exactly as it would call Python functions
# Zero protocol code written - ADK handles all MCP communication

The agent now has access to both inventory and CRM MCP servers simultaneously,

adk web
INFO: Starting ADK web server on http://localhost:8000
INFO: Agent: enterprise_agent
INFO: MCP tools loaded from inventory_mcp_server.py:
      check_stock, search_products, get_low_stock_alerts
INFO: MCP tools loaded from remote CRM:
      get_customer, get_orders, update_opportunity

# Agent can now answer queries spanning both systems:
# "What stock do we have for our top 5 customers by order value?"
# Agent calls CRM to get top customers, then inventory to check their preferred SKUs

MCP integration is the key to building enterprise ADK agents that connect to your actual business systems without rebuilding integrations from scratch. The pattern scales: one ADK agent can connect to 5-10 MCP servers simultaneously, giving it access to your entire enterprise data landscape. For security in production, run MCP servers behind your VPC with IAM-controlled access tokens. Use SseServerParams with HTTPS and bearer tokens for all remote MCP connections. Log every MCP tool call at the server level for a complete audit trail of what data the agent accessed and when.


 
  


  
bl  br