-
Notifications
You must be signed in to change notification settings - Fork 5
feat(setup): auto-deploy Google Analytics MCP to OpenCode config #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add setup_google_analytics_mcp() function that: - Adds google-analytics-mcp to ~/.config/opencode/opencode.json - Disabled by default (enabled: false) for token efficiency - Shows setup instructions for Google Cloud ADC - Skips if already configured or prerequisites missing (jq, pipx)
|
Caution Review failedThe pull request is closed. WalkthroughA new setup function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Jan 14 20:26:07 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request automates the configuration of the Google Analytics MCP within the OpenCode environment. It introduces a new function to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new function to setup.sh for automatically configuring the Google Analytics MCP in the OpenCode configuration file. The implementation is clear and follows the existing structure of the script. I have one suggestion to enhance the robustness of the JSON update logic to prevent potential failures if a key is missing.
| if jq '.mcp["google-analytics-mcp"] = { | ||
| "type": "local", | ||
| "command": ["pipx", "run", "analytics-mcp"], | ||
| "environment": { | ||
| "GOOGLE_APPLICATION_CREDENTIALS": "", | ||
| "GOOGLE_PROJECT_ID": "" | ||
| }, | ||
| "enabled": false | ||
| }' "$opencode_config" > "$tmp_config" 2>/dev/null; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current jq command will fail if the .mcp key does not exist in opencode.json. To make the script more robust, you should ensure that the .mcp object exists before trying to add a property to it. You can use the //= operator in jq to create it if it's missing.
| if jq '.mcp["google-analytics-mcp"] = { | |
| "type": "local", | |
| "command": ["pipx", "run", "analytics-mcp"], | |
| "environment": { | |
| "GOOGLE_APPLICATION_CREDENTIALS": "", | |
| "GOOGLE_PROJECT_ID": "" | |
| }, | |
| "enabled": false | |
| }' "$opencode_config" > "$tmp_config" 2>/dev/null; then | |
| if jq '(.mcp //= {})["google-analytics-mcp"] = { | |
| "type": "local", | |
| "command": ["pipx", "run", "analytics-mcp"], | |
| "environment": { | |
| "GOOGLE_APPLICATION_CREDENTIALS": "", | |
| "GOOGLE_PROJECT_ID": "" | |
| }, | |
| "enabled": false | |
| }' "$opencode_config" > "$tmp_config" 2>/dev/null; then |
🤖 Augment PR SummarySummary: This PR updates the installer to automatically add a Google Analytics MCP entry to the user’s OpenCode configuration. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| # Add google-analytics-mcp to opencode.json (disabled by default) | ||
| local tmp_config | ||
| tmp_config=$(mktemp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }, | ||
| "enabled": false | ||
| }' "$opencode_config" > "$tmp_config" 2>/dev/null; then | ||
| mv "$tmp_config" "$opencode_config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.



Summary
Automatically add Google Analytics MCP to OpenCode config during setup.
Changes
setup_google_analytics_mcp()function tosetup.shenabled: false) for token efficiencyHow it works
After running
./setup.sh, users will havegoogle-analytics-mcpin their~/.config/opencode/opencode.json:The MCP is enabled automatically when using the
google-analyticssubagent via SEO, Marketing, or Sales agents.Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.