Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 14, 2026

Summary

Automatically add Google Analytics MCP to OpenCode config during setup.

Changes

  • Add setup_google_analytics_mcp() function to setup.sh
  • MCP is added disabled by default (enabled: false) for token efficiency
  • Shows setup instructions for Google Cloud ADC credentials
  • Gracefully skips if prerequisites missing (jq, pipx) or already configured

How it works

After running ./setup.sh, users will have google-analytics-mcp in their ~/.config/opencode/opencode.json:

"google-analytics-mcp": {
  "type": "local",
  "command": ["pipx", "run", "analytics-mcp"],
  "environment": {
    "GOOGLE_APPLICATION_CREDENTIALS": "",
    "GOOGLE_PROJECT_ID": ""
  },
  "enabled": false
}

The MCP is enabled automatically when using the google-analytics subagent via SEO, Marketing, or Sales agents.

Summary by CodeRabbit

Release Notes

  • New Features
    • Google Analytics MCP setup has been added to the installation process. The setup automatically verifies required dependencies and manages configuration, with clear instructions provided for credential enablement.

✏️ Tip: You can customize this high-level summary in your review settings.

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)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

A new setup function setup_google_analytics_mcp() has been added to setup.sh to register the Google Analytics MCP with OpenCode. The function validates prerequisites (jq, pipx), checks for existing installations, appends a configuration entry to the OpenCode config file, and outputs setup instructions.

Changes

Cohort / File(s) Summary
Google Analytics MCP Setup Integration
setup.sh
Added setup_google_analytics_mcp() function that validates dependencies (jq, pipx), checks for existing MCP registration, and appends a new google-analytics-mcp entry to ~/.config/opencode/opencode.json with type local and pipx-based command invocation. Integrated into main setup flow after SEO MCP setup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

📊 Analytics takes flight with a script so tight,
Google's wisdom now glowing at night,
Pipx runs the show, jq validates the flow,
OpenCode config blooms—watch your insights grow! 🚀

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe6de07 and f612cfb.

📒 Files selected for processing (1)
  • setup.sh

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 261 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Jan 14 20:25:23 UTC 2026: Code review monitoring started
Wed Jan 14 20:25:23 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 261
Wed Jan 14 20:25:24 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Wed Jan 14 20:25:26 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 261
  • VULNERABILITIES: 0

Generated on: Wed Jan 14 20:26:07 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 11e8f78 into main Jan 14, 2026
8 of 9 checks passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 setup.sh script that adds the necessary configuration to the opencode.json file, while also ensuring that the required dependencies are present. The MCP is added in a disabled state by default, and the script provides instructions for enabling it and setting up the necessary Google Cloud credentials.

Highlights

  • Google Analytics MCP Integration: Adds a function setup_google_analytics_mcp() to setup.sh to automatically configure the Google Analytics MCP in the OpenCode config.
  • Disabled by Default: The Google Analytics MCP is added to the OpenCode config in a disabled state (enabled: false) to optimize token usage.
  • Dependency Checks: The setup script now checks for the presence of jq and pipx and gracefully skips the Google Analytics MCP setup if these dependencies are missing.
  • Setup Instructions: The script provides instructions for setting up Google Cloud ADC credentials and enabling the MCP.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines +2152 to +2160
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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

@augmentcode
Copy link

augmentcode bot commented Jan 14, 2026

🤖 Augment PR Summary

Summary: This PR updates the installer to automatically add a Google Analytics MCP entry to the user’s OpenCode configuration.

Changes:

  • Adds setup_google_analytics_mcp() to setup.sh to inject google-analytics-mcp into ~/.config/opencode/opencode.json
  • Configures the MCP as type: local using pipx run analytics-mcp, and keeps it disabled by default
  • Skips gracefully when prerequisites are missing (OpenCode config, jq, or pipx) or when already configured
  • Prints user guidance for setting up Google Cloud Application Default Credentials (ADC) and required env vars
  • Wires the new step into the interactive main() setup flow

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


# Add google-analytics-mcp to opencode.json (disabled by default)
local tmp_config
tmp_config=$(mktemp)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flow overwrites opencode.json but doesn’t create a backup first; since other steps (e.g., update_opencode_config) do, it may be worth aligning here to reduce the risk of user config loss if something goes wrong.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

},
"enabled": false
}' "$opencode_config" > "$tmp_config" 2>/dev/null; then
mv "$tmp_config" "$opencode_config"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mv "$tmp_config" "$opencode_config" isn’t checked for success before printing the "Added" message; if the move fails (permissions, disk, etc.), the user could get a false success signal and be left with a stray temp file.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant