Edison Watch
Developers

Google ADK

Connect a Google Agent Development Kit (ADK) agent to Edison Watch using MCPToolset, keeping a stable session per conversation so data-leak protection holds across every turn.

Google's Agent Development Kit connects to Edison with MCPToolset and StreamableHTTPConnectionParams. Your connection URL carries your API key, so no auth header is needed.

pip install google-adk mcp
import asyncio

from google.adk.agents import LlmAgent
from google.adk.runners import InMemoryRunner
from google.adk.tools.mcp_tool import MCPToolset, StreamableHTTPConnectionParams
from google.genai import types

import os

agent = LlmAgent(
    model="gemini-3.5-flash",
    name="edison_agent",
    instruction="Use the available tools to help the user.",
    tools=[
        MCPToolset(
            connection_params=StreamableHTTPConnectionParams(
                url=os.environ["EDISON_MCP_URL"],
            ),
        )
    ],
)

async def main() -> None:
    runner = InMemoryRunner(agent=agent, app_name="edison")
    session = await runner.session_service.create_session(app_name="edison", user_id="u1")
    async for event in runner.run_async(
        user_id="u1",
        session_id=session.id,
        new_message=types.Content(role="user", parts=[types.Part(text="List my available tools.")]),
    ):
        if event.content:
            print(event.content)

asyncio.run(main())

Set EDISON_MCP_URL to your connection URL, e.g. https://mcp.edison.watch/mcp/<your-api-key>/?client=google-adk.

Note the exact class spelling: StreamableHTTPConnectionParams (capital HTTP). Its timeout defaults to 5 seconds for establishing the connection - raise it if your gateway is slow to hand off.

Keep a stable session across turns to preserve data-leak protection

Send a stable x-edison-conversation-id header on every turn of the same conversation. That header is what keeps Edison's data-leak protection intact across a multi-turn run: Edison tracks lethal-trifecta risk per session, so if each turn looks like a brand-new session, that protection resets - and a later turn can leak data that the accumulated risk should have blocked.

Hosted clients (Claude Code, VS Code) send it automatically. For a custom ADK agent, set the header on StreamableHTTPConnectionParams, keyed to your own conversation or thread id:

# Reuse one stable conversation_id for every turn of the same conversation.
MCPToolset(
    connection_params=StreamableHTTPConnectionParams(
        url=os.environ["EDISON_MCP_URL"],
        headers={"x-edison-conversation-id": conversation_id},
    ),
)

Without a stable x-edison-conversation-id, each connection is treated as a fresh session that starts with empty risk state - so risk accumulated on an earlier turn won't be there to block a later exfiltration. The ?client= label is only a dashboard tag, not a session key. Use a unique id per conversation (a UUID is ideal); ids are scoped to your API key, so don't reuse one string for two different conversations.

Optional: the encrypted-secrets header

For servers with zero-knowledge-encrypted secrets, pass a headers dict, alongside x-edison-conversation-id:

StreamableHTTPConnectionParams(
    url=os.environ["EDISON_MCP_URL"],
    headers={
        "x-edison-conversation-id": conversation_id,
        "x-edison-secret-key": os.environ["EDISON_SECRET_KEY"],
    },
)