Skip to main content

Overview

Google’s Agent Development Kit (ADK) is an open-source, code-first Python toolkit for building, evaluating, and deploying sophisticated AI agents. ADK includes native MCP support via the McpToolset class, enabling seamless integration with StackOne’s MCP server. Official Documentation

Installation

pip install google-adk
Or with uv:
uv add google-adk

Quick Start

Connect to StackOne MCP and create an ADK agent:
import os
import base64
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset, StreamableHTTPConnectionParams

# Configure StackOne account
STACKONE_ACCOUNT_ID = "<account_id>"  # Your StackOne account ID

# Encode API key for Basic auth
auth_token = base64.b64encode(
    f"{os.getenv('STACKONE_API_KEY')}:".encode()
).decode()

# Create agent with StackOne MCP tools
root_agent = LlmAgent(
    model="gemini-2.0-flash-exp",
    name="stackone_assistant",
    instruction="You are a helpful assistant with access to data from connected platforms via StackOne.",
    tools=[
        McpToolset(
            connection_params=StreamableHTTPConnectionParams(
                url="https://api.stackone.com/mcp",
                headers={
                    "Authorization": f"Basic {auth_token}",
                    "x-account-id": STACKONE_ACCOUNT_ID
                }
            ),
            tool_name_prefix="stackone_"  # Tools become stackone_gong_crm_search_calls, etc.
        )
    ],
)

# Run the agent
result = root_agent.run_sync("List recent Salesforce accounts")
print(result.content)

Environment Variables

STACKONE_API_KEY=<stackone_api_key>
GOOGLE_API_KEY=your_google_api_key  # For Gemini models

Async Usage

For production applications, use async patterns:
import asyncio

async def main():
    # Create agent (same as above)
    root_agent = LlmAgent(
        model="gemini-2.0-flash-exp",
        name="stackone_assistant",
        instruction="You are a helpful assistant with access to data from connected platforms.",
        tools=[
            McpToolset(
                connection_params=StreamableHTTPConnectionParams(
                    url="https://api.stackone.com/mcp",
                    headers={
                        "Authorization": f"Basic {auth_token}",
                        "x-account-id": STACKONE_ACCOUNT_ID
                    }
                ),
                tool_name_prefix="stackone_"
            )
        ],
    )

    # Run async
    result = await root_agent.run("Search recent calls in Gong")
    print(result.content)

asyncio.run(main())

Tool Filtering

Restrict which StackOne tools are exposed to the agent for security:
McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url="https://api.stackone.com/mcp",
        headers={
            "Authorization": f"Basic {auth_token}",
            "x-account-id": STACKONE_ACCOUNT_ID,
            "Content-Type": "application/json",
            "Accept": "application/json,text/event-stream",
            "MCP-Protocol-Version": "2025-06-18"
        }
    ),
    tool_filter=[
        "salesforce_crm_list_accounts",
        "salesforce_crm_get_account",
        "gong_crm_search_calls"
    ]  # Only expose specific tools
)
Class Name Update: In ADK v1.17.0+, use McpToolset (not MCPToolset). The old capitalization is deprecated but still works with a warning.

Resources

Next Steps