Extensibility Options for Open-Code-Review: A Complete Guide to Customizing Your Review Workflow

Open-Code-Review supports extensive customization through agent plugins, Model Context Protocol (MCP) servers, dynamic tool registration, and configurable review rules, allowing seamless integration with Claude Code, OpenCode, Cursor, and external services while maintaining a deterministic core engine.

Open-Code-Review from Alibaba is architected as a modular system that intentionally separates deterministic engineering processes from agent-based intelligence. Understanding the extensibility options for open-code-review enables development teams to integrate custom tools, adapt the workflow to different AI agents, and enforce project-specific coding standards without modifying the core codebase.

Agent-Side Plugins and Native Integrations

The repository provides dedicated plugins for popular AI coding agents, ensuring consistent review capabilities across different platforms.

Claude Code, Codex, and Cursor Plugins

Each major agent platform ships with a dedicated plugin that registers a slash-command or skill forwarding requests to the local ocr CLI. According to [plugins/open-code-review/README.md](plugins/open-code-review/README.md), you can install these via the agent's marketplace or manually copy command files. Once installed, agents like Claude Code expose the review workflow through intuitive commands:

/open-code-review:review   # slash command installed via Claude Code marketplace

OpenCode-AI TypeScript Plugin

For OpenCode workspaces, the repository provides a native TypeScript plugin defined in [plugins/open-code-review/opencode/open-code-review.ts](plugins/open-code-review/opencode/open-code-review.ts). This plugin registers two essential tools:

  • ocr_review: Executes the code review process
  • ocr_health: Verifies version and LLM connectivity

The plugin integrates directly into OpenCode's skill system, making the review workflow available to custom OpenCode agents without additional configuration.

Model Context Protocol (MCP) and Dynamic Tooling

Open-Code-Review implements the Model Context Protocol to incorporate external tools into the review process dynamically.

Connecting External MCP Servers

As documented in [pages/src/content/docs/en/mcp.md](pages/src/content/docs/en/mcp.md), OCR can act as an MCP client to consume additional tools from external servers. By configuring an MCP server, you make tools like linters, ticket-lookup services, or schema validators appear alongside built-in tools such as file_read and code_search.

To register a custom MCP server offering a search_jira tool:


# Add the server (run once)

ocr config set mcp_servers.jira.command npx
ocr config set mcp_servers.jira.args '["@myorg/jira-mcp"]'
ocr config set mcp_servers.jira.tools '["search_jira"]'

Once registered, OpenCode plugins can invoke these tools directly:

// inside an OpenCode agent handler
const result = await client.tool.call("search_jira", {
  query: "PROJECT-1234",
});
// `result` now contains the Jira issue JSON returned by the MCP server.

Runtime Tool Discovery

The core tool system supports runtime discovery through the Dynamic constructor. In [internal/tool/definitions.go](internal/tool/definitions.go), the Dynamic(name string) function creates a Tool instance for any name not reserved by the built-in set. When an MCP server advertises a new tool, the registry automatically creates a dynamic entry, enabling the agent to call it without prior hardcoding.

Custom Review Rules and Configuration Hooks

Beyond tooling, open-code-review offers deep customization of the review logic itself through rule files and CLI configuration.

Rule File Hierarchy and Overrides

Review rules resolve through a priority chain defined in [plugins/open-code-review/skills/open-code-review/SKILL.md](plugins/open-code-review/skills/open-code-review/SKILL.md) (lines 80-86). The system checks configurations in this order:

  1. CLI flag arguments
  2. Repository-local .opencodereview/rule.json
  3. User-wide .opencodereview/rule.json
  4. Built-in defaults

You can override rules for specific languages by creating a repository-local configuration:


# Create a repo-local rule file

cat > .opencodereview/rule.json <<'EOF'
{
  "rules": [
    {
      "path": "**/*.go",
      "rule": "Enforce gofmt and staticcheck",
      "merge_system_rule": true
    }
  ]
}
EOF

CLI Configuration for Runtime Behavior

The ocr config set command allows injection of custom environment variables, command-line arguments, and per-tool allow-lists for MCP servers. As shown in the MCP documentation (lines 31-48), this enables tuning runtime behavior without code changes. You can also pass custom background context during execution:

ocr review --background "Feature X must not break login flow" --from main --to feature-branch

LLM Provider Flexibility

The CLI remains agnostic about the underlying LLM provider, supporting any OpenAI-compatible API endpoint. By using ocr config provider and ocr config model, you can redirect the review engine to Anthropic, OpenAI, Azure, or self-hosted models without modifying the review logic. This extensibility point ensures the tool adapts to your infrastructure rather than requiring specific vendor lock-in.

Summary

  • Agent plugins for Claude Code, Codex, Cursor, and OpenCode provide native integration through marketplace installs or manual configuration.
  • MCP server support in [pages/src/content/docs/en/mcp.md](pages/src/content/docs/en/mcp.md) enables dynamic integration of external tools like Jira, linters, and validators.
  • Dynamic tool registration via [internal/tool/definitions.go](internal/tool/definitions.go) allows runtime discovery of MCP-provided capabilities.
  • Hierarchical rule files support project-specific and user-wide customization of review standards.
  • CLI configuration hooks offer fine-grained control over environment variables, MCP allow-lists, and execution context.
  • Provider agnosticism ensures compatibility with any OpenAI-compatible LLM endpoint.

Frequently Asked Questions

How do I add a custom tool to Open-Code-Review?

Implement a Model Context Protocol (MCP) server that exposes your tool's functionality, then register it using ocr config set mcp_servers.{name}.command. The [internal/tool/definitions.go](internal/tool/definitions.go) file handles dynamic registration automatically, making the tool available to agents immediately after configuration.

Can I use Open-Code-Review with self-hosted LLMs?

Yes. The CLI supports any OpenAI-compatible API endpoint. Configure your custom provider using ocr config provider and ocr config model to point to your self-hosted or private cloud LLM without modifying the core review logic.

Where should I place custom review rules for my team?

Create a .opencodereview/rule.json file in your repository root for project-specific rules that apply to all team members. For personal preferences, use the user-wide configuration in your home directory. The system merges these according to the priority chain documented in [plugins/open-code-review/skills/open-code-review/SKILL.md](plugins/open-code-review/skills/open-code-review/SKILL.md).

What is the difference between agent plugins and MCP servers?

Agent plugins (like those for Claude Code or OpenCode) provide the user interface and command registration within specific AI coding environments, while MCP servers expose functional capabilities (tools) that any compatible agent can invoke. Plugins handle the "how" of triggering reviews; MCP servers handle the "what" of available external capabilities.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →