|
1 | 1 | # Google Analytics MCP Server (Experimental) |
2 | 2 |
|
| 3 | +[](https://pypi.org/project/analytics-mcp/) |
| 4 | +[](https://www.python.org/downloads/) |
| 5 | +[](https://github.com/googleanalytics/google-analytics-mcp/actions?query=branch%3Amain++) |
| 6 | +[](https://pypi.org/project/analytics-mcp/) |
| 7 | +[](https://github.com/googleanalytics/google-analytics-mcp/stargazers) |
| 8 | +[](https://github.com/googleanalytics/google-analytics-mcp/network/members) |
| 9 | +[](https://www.youtube.com/watch?v=PT4wGPxWiRQ) |
| 10 | + |
3 | 11 | This repo contains the source code for running a local |
4 | 12 | [MCP](https://modelcontextprotocol.io) server that interacts with APIs for |
5 | 13 | [Google Analytics](https://support.google.com/analytics). |
6 | 14 |
|
7 | 15 | Join the discussion and ask questions in the |
8 | | -[:robot:-analytics-mcp channel](https://discord.com/channels/971845904002871346/1398002598665257060) |
| 16 | +[🤖-analytics-mcp channel](https://discord.com/channels/971845904002871346/1398002598665257060) |
9 | 17 | on Discord. |
10 | 18 |
|
11 | | -## Tools :hammer_and_wrench: |
| 19 | +## Tools 🛠️ |
12 | 20 |
|
13 | 21 | The server uses the |
14 | 22 | [Google Analytics Admin API](https://developers.google.com/analytics/devguides/config/admin/v1) |
|
17 | 25 | to provide several |
18 | 26 | [Tools](https://modelcontextprotocol.io/docs/concepts/tools) for use with LLMs. |
19 | 27 |
|
20 | | -### Retrieve account and property information :orange_circle: |
| 28 | +### Retrieve account and property information 🟠 |
21 | 29 |
|
22 | 30 | - `get_account_summaries`: Retrieves information about the user's Google |
23 | 31 | Analytics accounts and properties. |
24 | 32 | - `get_property_details`: Returns details about a property. |
25 | 33 | - `list_google_ads_links`: Returns a list of links to Google Ads accounts for |
26 | 34 | a property. |
27 | 35 |
|
28 | | -### Run core reports :orange_book: |
| 36 | +### Run core reports 📙 |
29 | 37 |
|
30 | 38 | - `run_report`: Runs a Google Analytics report using the Data API. |
31 | 39 | - `get_custom_dimensions_and_metrics`: Retrieves the custom dimensions and |
32 | 40 | metrics for a specific property. |
33 | 41 |
|
34 | | -### Run realtime reports :hourglass_flowing_sand: |
| 42 | +### Run realtime reports ⏳ |
35 | 43 |
|
36 | 44 | - `run_realtime_report`: Runs a Google Analytics realtime report using the |
37 | 45 | Data API. |
38 | 46 |
|
39 | | -## Setup instructions |
| 47 | +## Setup instructions 🔧 |
40 | 48 |
|
41 | 49 | Setup involves the following steps: |
42 | 50 |
|
43 | 51 | 1. Configure Python. |
44 | 52 | 1. Configure credentials for Google Analytics. |
45 | 53 | 1. Configure Gemini. |
46 | 54 |
|
47 | | -### Configure Python :snake: |
| 55 | +### Configure Python 🐍 |
48 | 56 |
|
49 | 57 | [Install pipx](https://pipx.pypa.io/stable/#install-pipx). |
50 | 58 |
|
51 | | -### Enable APIs in your project :white_check_mark: |
| 59 | +### Enable APIs in your project ✅ |
52 | 60 |
|
53 | 61 | [Follow the instructions](https://support.google.com/googleapi/answer/6158841) |
54 | 62 | to enable the following APIs in your Google Cloud project: |
55 | 63 |
|
56 | 64 | * [Google Analytics Admin API](https://console.cloud.google.com/apis/library/analyticsadmin.googleapis.com) |
57 | 65 | * [Google Analytics Data API](https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com) |
58 | 66 |
|
59 | | -### Configure credentials :key: |
| 67 | +### Configure credentials 🔑 |
60 | 68 |
|
61 | 69 | Configure your [Application Default Credentials |
62 | 70 | (ADC)](https://cloud.google.com/docs/authentication/provide-credentials-adc). |
@@ -105,7 +113,7 @@ Credentials saved to file: [PATH_TO_CREDENTIALS_JSON] |
105 | 113 | 1. Install [Gemini |
106 | 114 | CLI](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/index.md) |
107 | 115 | or [Gemini Code |
108 | | - Assist](https://marketplace.visualstudio.com/items?itemName=Google.geminicodeassist) |
| 116 | + Assist](https://marketplace.visualstudio.com/items?itemName=Google.geminicodeassist). |
109 | 117 |
|
110 | 118 | 1. Create or edit the file at `~/.gemini/settings.json`, adding your server |
111 | 119 | to the `mcpServers` list. |
@@ -136,7 +144,7 @@ Credentials saved to file: [PATH_TO_CREDENTIALS_JSON] |
136 | 144 | } |
137 | 145 | ``` |
138 | 146 |
|
139 | | -## Try it out :lab_coat: |
| 147 | +## Try it out 🥼 |
140 | 148 |
|
141 | 149 | Launch Gemini Code Assist or Gemini CLI and type `/mcp`. You should see |
142 | 150 | `analytics-mcp` listed in the results. |
@@ -173,6 +181,6 @@ Here are some sample prompts to get you started: |
173 | 181 | what are the custom dimensions and custom metrics in my property? |
174 | 182 | ``` |
175 | 183 |
|
176 | | -## Contributing |
| 184 | +## Contributing ✨ |
177 | 185 |
|
178 | 186 | Contributions welcome! See the [Contributing Guide](CONTRIBUTING.md). |
0 commit comments