Connect a Google ADK agent to Civic’s MCP Hub using streamable HTTP transport
Connect a Google Agent Development Kit (ADK) agent to Civic using McpToolset with Streamable HTTP transport. Google ADK natively supports Gemini models; for Claude, register LiteLlm as shown below.
Google ADK’s built-in Anthropic support requires Vertex AI. To use Claude directly with the Anthropic API, register LiteLlm with the ADK model registry:
Copy
import osimport asynciofrom dotenv import load_dotenvfrom google.adk.agents import Agentfrom google.adk.tools.mcp_tool import McpToolsetfrom google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParamsfrom google.adk.models.lite_llm import LiteLlmfrom google.adk.models.registry import LLMRegistryload_dotenv()# Required: register LiteLlm to use non-Gemini modelsLLMRegistry.register(LiteLlm)root_agent = Agent( model=LiteLlm(model="anthropic/claude-sonnet-4-6"), name="civic_assistant", instruction="You are a helpful assistant with access to Civic tools.", tools=[ McpToolset( connection_params=StreamableHTTPConnectionParams( url=os.environ["CIVIC_URL"], headers={"Authorization": f"Bearer {os.environ['CIVIC_TOKEN']}"}, ), ) ],)