Metadata-Version: 2.4
Name: laylzj777-analytics-mcp
Version: 0.7.0
Summary: Google Analytics MCP server fork with opt-in credential validation
Author-email: Josh Radcliff <jradcliff@users.noreply.github.com>, Matt Landers <matt-landers@users.noreply.github.com>
Maintainer: laylzj777
License-Expression: Apache-2.0
Project-URL: homepage, https://github.com/googleanalytics/google-analytics-mcp
Project-URL: repository, https://github.com/googleanalytics/google-analytics-mcp.git
Project-URL: issues, https://github.com/googleanalytics/google-analytics-mcp/issues
Keywords: google analytics,analytics,mcp,ga4
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: google-analytics-data==0.23.0
Requires-Dist: google-analytics-admin==0.30.1
Requires-Dist: google-auth~=2.40
Requires-Dist: mcp<2,>=1.24.0
Requires-Dist: google-adk>=1.29.0
Requires-Dist: httpx>=0.28.1
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: nox<2027,>=2026.2.9; extra == "dev"
Dynamic: license-file

# laylzj777-analytics-mcp

An independently maintained fork of Google's experimental
[Google Analytics MCP server](https://github.com/googleanalytics/google-analytics-mcp),
based on upstream version 0.7.0, commit
`a8ca729d4a8fa99bffe87962c17c0539c6aa9da7`.
This fork is not an official Google release. The upstream Apache-2.0 license
and copyright notices are retained.

## Install and run

Requires Python 3.10 or newer. Install into a dedicated Python environment:

```sh
python -m pip install laylzj777-analytics-mcp==0.7.0
analytics-mcp
```

`google-analytics-mcp` is an equivalent entry point. Both start the Python
server directly; Node.js, npm, and `--managed-python` are not needed.
The distribution installs its Python dependencies itself. Do not install the
upstream `analytics-mcp` distribution in the same environment: both provide the
`analytics_mcp` import package and the same commands.

For a managed plugin host, declare a single pip runtime dependency on
`laylzj777-analytics-mcp==0.7.0`, resolve its `analytics-mcp` entry point, and
preserve the Python runtime environment supplied by the host.

## Credentials and validation

Enable the Google Analytics Admin and Data APIs and grant the account access
to the required Analytics properties. Configure Google Application Default
Credentials using `GOOGLE_APPLICATION_CREDENTIALS` (a local credential JSON
file path) and provide `GOOGLE_PROJECT_ID` as required by your host.
Never put credential files or tokens in this package or its configuration
examples.

Set `MCP_VALIDATE_CREDENTIALS=true` to validate credentials before `tools/list`
returns tools. Validation is disabled by default. Validation refreshes ADC and
performs a read-only Admin API request; an empty account list is valid. A
successful validation is cached for the server process.

Failures use sanitized JSON-RPC errors with
`data.kind = "credential_validation"`:

| Code | `data.code` | Retryable |
| --- | --- | --- |
| -32042 | INVALID_CREDENTIALS | false |
| -32043 | INSUFFICIENT_PERMISSIONS | false |
| -32044 | UNAVAILABLE | true |

Error messages do not include credential paths, tokens, or account data. This
is a fork-specific error contract, not a standard MCP authentication extension.
The fork retains the upstream read-only Analytics reporting and account tools.
