Skip to content

feat(opencode): add claude-code-mcp server#103

Merged
marcusquinn merged 3 commits intomainfrom
feature/add-support-for-steipete-claude-code-mcp
Jan 15, 2026
Merged

feat(opencode): add claude-code-mcp server#103
marcusquinn merged 3 commits intomainfrom
feature/add-support-for-steipete-claude-code-mcp

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 15, 2026

Summary

  • Add steipete/claude-code-mcp MCP server to OpenCode configuration
  • Enable claude-code-mcp_* tools globally for all primary agents (Build+, AI-DevOps, SEO, Plan+, etc.)
  • Fix preflight result detection bug in quality-loop-helper.sh

Changes

generate-opencode-agents.sh

  • Added claude-code-mcp MCP server entry with bunx command
  • Added claude-code-mcp_*: True to all primary agent tool configs

quality-loop-helper.sh

  • Fixed preflight loop comparing full colored output against "PASS"
  • Now extracts only the result line with tail -n 1
  • Aligned ShellCheck severity with linters-local.sh

Testing

  • Ran ./setup.sh to deploy changes
  • Verified MCP appears in ~/.config/opencode/opencode.json
  • Verified tools enabled for all primary agents

Post-merge

Users need to:

  1. Restart OpenCode to load the new MCP
  2. Run claude --dangerously-skip-permissions once to accept upstream terms

Summary by CodeRabbit

  • Chores
    • Automatically enable a new code-assistance tool across generated agent configurations on all supported platforms.
    • Improve preflight quality checks: adjust linter severity to reduce false failures, skip optional checks when absent, and make preflight result handling more robust and reliable.

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

The preflight loop was comparing the full output (including colored log
lines) against 'PASS' instead of just the final status line. This caused
preflight to always fail even when all checks passed.

- Use tail -n 1 to extract only the PASS/FAIL result
- Suppress stderr from run_preflight_checks to keep capture clean
- Align ShellCheck severity with linters-local.sh (warnings only)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Two shell scripts are updated: agent config generation adds claude-code-mcp entries and per-agent tool defaults for macOS, while quality-loop execution adjusts ShellCheck severity, makes secretlint conditional, and refactors preflight result extraction and loop exit logic.

Changes

Cohort / File(s) Summary
Agent Configuration
\.agent/scripts/generate-opencode-agents.sh
Adds claude-code-mcp_* tool defaults via get_agent_config; inserts a claude-code-mcp MCP server entry in the Darwin/macOS block (duplicate insertion present to ensure presence in both MCP and tools sections)
Quality Loop Semantics
\.agent/scripts/quality-loop-helper.sh
Runs ShellCheck with --severity=warning; treats secretlint as conditional (SKIPPED if missing); captures preflight status from stdout (uses piping and tail -n 1) and updates loop early-exit logic to compare that status

Sequence Diagram(s)

(omitted — changes are scripting and control-flow refinements that don't introduce multi-component sequential interactions warranting a diagram)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🛠️ On Darwin's shore a Claude Code seed is sown,
Scripts tidy checks where noisy warnings shone,
Secretlint may sleep until it's known,
Preflight reads the line to claim its tone,
Small edits, steady sails — the pipeline's grown.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(opencode): add claude-code-mcp server' directly reflects the main change: adding the claude-code-mcp MCP server to OpenCode configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 db341bd and e41b7cc.

📒 Files selected for processing (1)
  • .agent/scripts/generate-opencode-agents.sh
🧰 Additional context used
📓 Path-based instructions (1)
.agent/scripts/*.sh

⚙️ CodeRabbit configuration file

.agent/scripts/*.sh: Automation scripts - focus on:

  • Reliability and robustness
  • Clear logging and feedback
  • Proper exit codes
  • Error recovery mechanisms

Files:

  • .agent/scripts/generate-opencode-agents.sh
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/.agent/scripts/linters-local.sh : Run quality checks before committing using .agent/scripts/linters-local.sh
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Follow all security protocols and working directory specifications defined in ~/Git/aidevops/AGENTS.md
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/*.sh : Run ShellCheck on all scripts with zero violations required
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/setup.sh : Deploy agents locally using ./setup.sh script
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/.agent/scripts/version-manager.sh : Use .agent/scripts/version-manager.sh release [major|minor|patch] for releases
📚 Learning: 2025-12-22T01:24:53.937Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Follow all security protocols and working directory specifications defined in ~/Git/aidevops/AGENTS.md

Applied to files:

  • .agent/scripts/generate-opencode-agents.sh
📚 Learning: 2025-12-22T01:25:03.138Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/git/AGENTS.md:0-0
Timestamp: 2025-12-22T01:25:03.138Z
Learning: Store API Keys and Tokens in ~/.config/aidevops/mcp-env.sh with file permissions set to 600 (owner read/write only)

Applied to files:

  • .agent/scripts/generate-opencode-agents.sh
📚 Learning: 2025-12-22T01:24:53.937Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Store API keys and tokens exclusively in ~/.config/aidevops/mcp-env.sh with 600 file permissions (owner read/write only)

Applied to files:

  • .agent/scripts/generate-opencode-agents.sh
🔇 Additional comments (1)
.agent/scripts/generate-opencode-agents.sh (1)

491-505: Version pinning looks good.

The MCP server entry correctly pins @steipete/claude-code-mcp@1.10.12 instead of using @latest, ensuring stable and predictable behavior. This follows the same pattern as macos-automator-mcp@0.2.0 at line 482.

The configuration structure is consistent with other MCP entries:

  • Uses npx -y for auto-install confirmation
  • Sets type: "local" and enabled: True
  • Conditionally adds only if not already present

The global enablement at lines 503-504 (config['tools']['claude-code-mcp_*'] = True) aligns with the per-agent enablement at line 259, though see the Plan+ note above.

✏️ 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.

@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 enhances the OpenCode environment by integrating the claude-code-mcp server, making its associated tools available across all primary agents. Concurrently, it improves the robustness of the preflight check system by fixing a critical bug in result parsing and aligning ShellCheck severity, leading to more reliable and consistent quality gate evaluations.

Highlights

  • Integration of Claude Code MCP: The claude-code-mcp server has been added to the OpenCode configuration, allowing for the use of Claude Code as a one-shot MCP.
  • Global Tool Availability: The claude-code-mcp_* tools are now globally enabled for all primary agents, including Build+, AI-DevOps, SEO, and Plan+, ensuring broad access to this new functionality.
  • Preflight Check Reliability Fix: A bug in quality-loop-helper.sh that caused preflight result detection to fail due to colored output has been resolved. The script now accurately extracts the 'PASS' or 'FAIL' status, improving the robustness of quality gates.
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.

@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:
Thu Jan 15 00:58:28 UTC 2026: Code review monitoring started
Thu Jan 15 00:58:29 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 261
Thu Jan 15 00:58:29 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Thu Jan 15 00:58:31 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

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

Generated on: Thu Jan 15 00:59:11 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

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 the claude-code-mcp server and enables its tools for primary agents. It also fixes a bug in the preflight check loop in quality-loop-helper.sh. The changes look good overall. I've identified a couple of areas for improvement. First, in generate-opencode-agents.sh, pinning the version for the new MCP server package instead of using @latest would improve stability. Second, in quality-loop-helper.sh, the fix for the preflight loop silences all stderr output, which could hide important errors and make debugging difficult. I've provided suggestions for both points.

if [[ "$result" == "PASS" ]]; then
local result_status
result_status=$(run_preflight_checks "$auto_fix" 2>/dev/null | tail -n 1 | tr -d '\r')

Choose a reason for hiding this comment

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

high

Redirecting stderr to /dev/null with 2>/dev/null will suppress all error messages from run_preflight_checks and the tools it calls. This can make debugging failures very difficult, as the reason for a failure (e.g., a missing command) will be hidden. To maintain debuggability, it's better to let stderr be printed to the console. The tail -n 1 already correctly isolates the result from stdout.

Suggested change
result_status=$(run_preflight_checks "$auto_fix" 2>/dev/null | tail -n 1 | tr -d '\r')
result_status=$(run_preflight_checks "$auto_fix" | tail -n 1 | tr -d '\r')

if 'claude-code-mcp' not in config['mcp']:
config['mcp']['claude-code-mcp'] = {
"type": "local",
"command": ["npx", "-y", "@steipete/claude-code-mcp@latest"],

Choose a reason for hiding this comment

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

medium

Using @latest for the npm package can introduce unexpected breaking changes, making the script less stable. It's a best practice to pin dependencies to a specific version to ensure predictable behavior. Please consider replacing @latest with a specific version of @steipete/claude-code-mcp, for example 0.1.0 which appears to be the current version.

Suggested change
"command": ["npx", "-y", "@steipete/claude-code-mcp@latest"],
"command": ["npx", "-y", "@steipete/claude-code-mcp@0.1.0"],

@augmentcode
Copy link

augmentcode bot commented Jan 15, 2026

🤖 Augment PR Summary

Summary: Adds the claude-code-mcp MCP server to the generated OpenCode configuration and enables its tools for primary agents.

Changes:

  • Enable claude-code-mcp_* in generated agent tool configs and in the global OpenCode tools map.
  • Add a claude-code-mcp MCP server entry (local, via npx).
  • Fix preflight PASS detection by extracting the final status line; align ShellCheck gate with local linter severity.

🤖 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. 3 suggestions posted.

Fix All in Augment

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

"""
tools = AGENT_TOOLS.get(display_name, DEFAULT_TOOLS.copy())
# Enabled in all main agents (user request)
tools.setdefault("claude-code-mcp_*", True)
Copy link

Choose a reason for hiding this comment

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

This enables claude-code-mcp_* for every agent config returned by get_agent_config (including Plan+). If Plan+ is meant to stay strictly read-only, it may be worth double-checking that claude-code-mcp_* doesn’t effectively bypass the intended restrictions.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

if 'claude-code-mcp' not in config['mcp']:
config['mcp']['claude-code-mcp'] = {
"type": "local",
"command": ["npx", "-y", "@steipete/claude-code-mcp@latest"],
Copy link

Choose a reason for hiding this comment

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

This uses @steipete/claude-code-mcp@latest; since this executes arbitrary upstream code at runtime, a moving @latest can introduce unexpected behavior changes. Consider whether pinning a version (as is done for macos-automator) is important here.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

if [[ "$result" == "PASS" ]]; then
local result_status
result_status=$(run_preflight_checks "$auto_fix" 2>/dev/null | tail -n 1 | tr -d '\r')
Copy link

Choose a reason for hiding this comment

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

2>/dev/null here will suppress any stderr output from run_preflight_checks (including diagnostics from tools invoked inside it), which can make failures harder to understand. Since the PASS/FAIL parsing is already based on stdout, consider whether dropping stderr is intentional.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@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:
Thu Jan 15 01:04:05 UTC 2026: Code review monitoring started
Thu Jan 15 01:04:05 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 261
Thu Jan 15 01:04:05 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Thu Jan 15 01:04:07 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

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

Generated on: Thu Jan 15 01:04:44 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 1f3b46a into main Jan 15, 2026
8 of 9 checks passed
@marcusquinn marcusquinn deleted the feature/add-support-for-steipete-claude-code-mcp branch February 21, 2026 01:59
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