Skip to content

Add Podman Streamable HTTP interoperability - #211

Open
mrbrazzi wants to merge 2 commits into
googleanalytics:mainfrom
mrbrazzi:feature/podman-http-interoperability
Open

Add Podman Streamable HTTP interoperability#211
mrbrazzi wants to merge 2 commits into
googleanalytics:mainfrom
mrbrazzi:feature/podman-http-interoperability

Conversation

@mrbrazzi

Copy link
Copy Markdown

Summary

This change adds an explicitly enabled Streamable HTTP transport for the Google Analytics MCP server while preserving the existing stdio behavior.

It also provides a reproducible, non-root Podman deployment for WSL and documents configurations for clients such as Codex and Antigravity.

Changes

  • Replace the ADK/low-level MCP coordination layer with directly registered FastMCP tools.
  • Preserve stdio as the default transport.
  • Add an explicit stateful Streamable HTTP transport on /mcp.
  • Add a guarded subscriptions/listen compatibility handler.
  • Pin the validated fastmcp==4.0.0b3 and mcp==2.0.0 compatibility pair.
  • Add a non-root container image and a hardened Podman/Quadlet example.
  • Document read-only credential mounting and cross-client configuration.
  • Add coordinator and transport regression tests.
  • Restrict Setuptools package discovery to analytics_mcp* so deployment assets are not treated as Python packages.

Motivation

The current server is primarily designed for clients that launch it over stdio. This makes it difficult to operate one isolated server in WSL/rootless Podman and share it with multiple MCP clients.

The new transport is opt-in and keeps existing stdio configurations unchanged.

A related interoperability approach was previously validated in googleads/google-ads-mcp#108. This contribution applies the relevant transport and Podman patterns to Google Analytics, without introducing the Google Ads-specific OAuth storage or compatibility patches.

The open googleanalytics/google-analytics-mcp#160 targets Cloud Run and per-user OAuth. This PR instead focuses on a local WSL/rootless Podman deployment using read-only mounted Application Default Credentials, so the two scopes are complementary.

Validation

Automated

The repository was mounted read-only into separate ephemeral containers reproducing the presubmit matrix:

  • nox -s lint
  • nox -s tests-3.10
  • nox -s tests-3.11
  • nox -s tests-3.12
  • nox -s tests-3.13

All formatting checks passed, and all 8 tests passed on every Python version.

git diff --check main...HEAD also passes.

Manual interoperability

  • Built and ran the image with rootless Podman under WSL.
  • Confirmed that the container runs as a non-root user with a read-only credential mount.
  • Confirmed that two simultaneous Streamable HTTP clients can list the same nine tools.
  • Successfully exercised both the Google Analytics Admin API and Data API using a real accessible GA4 property.
  • Confirmed Streamable HTTP discovery from Codex.

No credentials, property identifiers, or private Analytics response data are included in this contribution.

Contributor checklist

  • Automated tests cover the changes.
  • Documentation has been updated.
  • Python 3.10–3.13 presubmit matrix reproduced locally.
  • Existing stdio behavior is preserved.
  • No credentials or private account data are included.
  • Google CLA confirmed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant