Skip to content

Commit 559ba1e

Browse files
authored
docs: instruct users to always set Google Cloud env vars (#43)
1 parent 69ae860 commit 559ba1e

File tree

2 files changed

+17
-28
lines changed

2 files changed

+17
-28
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ branch named `awesome-feature-42` in this repo:
9191
"--spec",
9292
"git+https://github.com/googleanalytics/google-analytics-mcp.git@awesome-feature-42",
9393
"google-analytics-mcp"
94-
]
94+
],
95+
"env": {
96+
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
97+
"GOOGLE_PROJECT_ID": "YOUR_PROJECT_ID"
98+
}
9599
}
96100
}
97101
}

README.md

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ Here are some sample `gcloud` commands you might find useful:
9292
--scopes=https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/cloud-platform
9393
```
9494

95+
When the `gcloud auth application-default` command completes, copy the
96+
`PATH_TO_CREDENTIALS_JSON` file location printed to the console in the
97+
following message. You'll need this for the next step!
98+
99+
```
100+
Credentials saved to file: [PATH_TO_CREDENTIALS_JSON]
101+
```
102+
95103
### Configure Gemini
96104

97105
1. Install [Gemini
@@ -102,31 +110,8 @@ Here are some sample `gcloud` commands you might find useful:
102110
1. Create or edit the file at `~/.gemini/settings.json`, adding your server
103111
to the `mcpServers` list.
104112

105-
```json
106-
{
107-
"mcpServers": {
108-
"analytics-mcp": {
109-
"command": "pipx",
110-
"args": [
111-
"run",
112-
"--spec",
113-
"git+https://github.com/googleanalytics/google-analytics-mcp.git",
114-
"google-analytics-mcp"
115-
]
116-
}
117-
}
118-
}
119-
```
120-
121-
1. **Optional:** Configure the `GOOGLE_APPLICATION_CREDENTIALS` environment
122-
variable in Gemini settings. You may want to do this if you always want to
123-
use a specific set of credentials, regardless of which Application Default
124-
Credentials are selected in your current environment.
125-
126-
In `~/.gemini/settings.json`, add a `GOOGLE_APPLICATION_CREDENTIALS`
127-
attribute to the `env` object. Replace `PATH_TO_ADC_JSON` in the following
128-
example with the full path to the ADC JSON file you always want to use for
129-
your MCP server.
113+
Replace `PATH_TO_CREDENTIALS_JSON` with the path you copied in the previous
114+
step.
130115

131116
We also recommend that you add a `GOOGLE_CLOUD_PROJECT` attribute to the
132117
`env` object. Replace `YOUR_PROJECT_ID` in the following example with the
@@ -145,8 +130,8 @@ Here are some sample `gcloud` commands you might find useful:
145130
"google-analytics-mcp"
146131
],
147132
"env": {
148-
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_ADC_JSON",
149-
"GOOGLE_CLOUD_PROJECT": "YOUR_PROJECT_ID"
133+
"GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
134+
"GOOGLE_PROJECT_ID": "YOUR_PROJECT_ID"
150135
}
151136
}
152137
}

0 commit comments

Comments
 (0)