Skip to content

refactor(adk): modernize run-with-google-adk to ADK v2 package with CLI and FastAPI - #303

Open
dandye wants to merge 14 commits into
mainfrom
refactor/run-with-adk-v2
Open

refactor(adk): modernize run-with-google-adk to ADK v2 package with CLI and FastAPI#303
dandye wants to merge 14 commits into
mainfrom
refactor/run-with-adk-v2

Conversation

@dandye

@dandye dandye commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Modernizes run-with-google-adk/ into a standard PEP 621 Python package (mcp-security-agent / mcp_security_agent) powered by Google ADK v2.x.
  • Replaces legacy relative path resolution (../../../...) with dynamic package/repo root resolution.
  • Replaces custom schema wrappers (MCPToolSetWithSchemaAccess) with native ADK multi-transport toolsets (build_mcp_toolsets) supporting Stdio subprocesses and remote SSE/HTTP URLs.
  • Implements centralized Pydantic Settings (AgentSettings) with validated environment and .env loading.
  • Introduces dual serving interfaces:
    • Rich interactive terminal REPL (mcp-security-agent chat).
    • Production FastAPI server (mcp-security-agent serve) with /healthz, /info, and /chat endpoints for Cloud Run.
  • Adds comprehensive hermetic pytest test suite covering package init, config, toolsets, callbacks, agent, CLI, and REST endpoints (11/11 tests passing).

Changes Made

  • Build & Packaging:
    • run-with-google-adk/pyproject.toml: Standard PEP 621 build configuration with CLI entry point mcp-security-agent.
    • run-with-google-adk/sample.env: Clean environment variables template.
    • run-with-google-adk/Dockerfile: Multi-stage container using uv for fast dependency installation and execution.
  • Source Package (src/mcp_security_agent/):
    • __init__.py: Package metadata and __version__ = "0.2.0".
    • __main__.py: Executable module entry point.
    • config.py: Centralized AgentSettings using Pydantic Settings with boolean converters and credential fallbacks.
    • toolsets.py: Native ADK MCP toolset builder for SecOps SIEM, SCC, GTI, and SecOps SOAR.
    • callbacks.py: Request context trimming callbacks.
    • agent.py: create_security_agent factory and SOC system prompt.
    • cli.py: Typer CLI with chat, serve, and info subcommands.
    • server/app.py & server/routes.py: FastAPI server factory and endpoints.
  • Testing:
    • tests/test_package_init.py
    • tests/test_config.py
    • tests/test_toolsets.py
    • tests/test_callbacks.py
    • tests/test_agent.py
    • tests/test_cli.py
    • tests/test_server.py

Test Plan

  • Ran complete hermetic test suite: 11/11 unit tests passed in run-with-google-adk/tests/.
  • Verified CLI help output and info command.
  • Verified FastAPI /healthz and /info routes.

@dandye
dandye requested a review from a team August 30, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant