Skip to main content
The Google ADK MCP helpers live in the aion-authoring-adk package and are imported from aion.adk.authoring. They are thin framework bindings over the shared aion-mcp endpoint helpers. The package does not own Aion control-plane addressing models; those live in aion-api-client.

Install

pip install aion-authoring-adk
The helpers create ADK McpToolset instances and a context-aware ADK BaseToolset.

Exports

from aion.adk.authoring import (
    aion_adk_mcp_toolset,
    aion_adk_mcp_toolsets_sync,
    default_adk_runtime_context,
)

aion_adk_mcp_toolset

Creates a context-aware ADK BaseToolset. ADK calls get_tools(readonly_context) at runtime, and the Aion toolset resolves MCP endpoints from that request context.
from google.adk.agents import Agent

from aion.adk.authoring import aion_adk_mcp_toolset, aion_lite_llm
from aion.api import (
    CapabilityReference,
    CapabilitySubjectSource,
    RuntimeCapabilityReference,
)

agent = Agent(
    name="research_agent",
    model=aion_lite_llm("model-id-from-control-plane"),
    tools=[
        aion_adk_mcp_toolset(
            capability_references=[
                CapabilityReference.global_mcp(),
            ],
            runtime_capability_references=[
                RuntimeCapabilityReference.primary_mcp(
                    CapabilitySubjectSource.INCOMING_DISTRIBUTION
                ),
            ],
        )
    ],
)
ParameterPurpose
capability_referencesExplicit subject-kind-key references, including the global control plane.
runtime_capability_referencesTemplates resolved from ADK’s per-request context.
principal_selectorOptional explicit principal selector for all endpoints.
jwt_managerOptional async token manager.
base_urlOptional Aion API base URL override.
context_providerOptional function that extracts AionRuntimeContext from ADK context.
tool_filterOptional filter forwarded to ADK McpToolset.
tool_name_prefixOptional prefix forwarded to ADK McpToolset.
require_confirmationConfirmation policy forwarded to ADK McpToolset.

Runtime context extraction

By default, default_adk_runtime_context checks these locations on the ADK readonly context:
readonly_context.aion_runtime_context
readonly_context.runtime_context
readonly_context.state["aion_runtime_context"]
readonly_context.state["runtime_context"]
Pass context_provider if your ADK runtime stores the Aion context somewhere else.
def from_invocation(readonly_context):
    return readonly_context.invocation_context.session.state["aion_runtime_context"]


toolset = aion_adk_mcp_toolset(context_provider=from_invocation)

aion_adk_mcp_toolsets_sync

Creates direct ADK McpToolset instances when the AionRuntimeContext is already known.
from aion.adk.authoring import aion_adk_mcp_toolsets_sync

toolsets = aion_adk_mcp_toolsets_sync(
    runtime_context,
    capability_references=[
        CapabilityReference.global_mcp(),
    ],
)
Use this for setup paths where you already have the request context and want explicit ADK McpToolset instances instead of a dynamic BaseToolset.