Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 44 additions & 7 deletions README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,11 +768,14 @@ OCRは4層の優先度チェーンを使ってレビュールールを解決し
| `llm.extra_headers` | string | カンマ区切りの `key=value` HTTPヘッダー |
| `llm.model` | string | `claude-opus-4-6` |
| `llm.use_anthropic` | boolean | `true` \| `false` |
| `mcp_servers.<name>.command` | string | MCPサーバーを起動するコマンド |
| `mcp_servers.<name>.args` | array | MCPサーバーのコマンドライン引数 |
| `mcp_servers.<name>.env` | array | 環境変数(`KEY=VALUE`形式) |
| `mcp_servers.<name>.type` | string | `stdio`(デフォルト)または `remote` |
| `mcp_servers.<name>.command` | string | MCPサーバーを起動するコマンド(stdio) |
| `mcp_servers.<name>.args` | array | MCPサーバーのコマンドライン引数(stdio) |
| `mcp_servers.<name>.env` | array | 環境変数(`KEY=VALUE`形式)(stdio) |
| `mcp_servers.<name>.url` | string | リモートMCPサーバーのURL(http/https) |
| `mcp_servers.<name>.headers` | object | リモートサーバーのHTTPヘッダー(`$ENV_VAR`展開対応) |
| `mcp_servers.<name>.tools` | array | 許可するツール名(空の場合はすべてのツール) |
| `mcp_servers.<name>.setup` | string | サーバー起動前に実行するセットアップコマンド |
| `mcp_servers.<name>.setup` | string | サーバー起動前に実行するセットアップコマンド(stdio) |
| `language` | string | 任意の言語名、例:`English`、`Chinese`(デフォルト:`English`) |
| `telemetry.enabled` | boolean | `true` \| `false` |
| `telemetry.exporter` | string | `console` \| `otlp` |
Expand All @@ -783,32 +786,42 @@ OCRは4層の優先度チェーンを使ってレビュールールを解決し

### MCPサーバー

Open Code Reviewは[Model Context Protocol (MCP)](https://modelcontextprotocol.io/)サーバーをサポートしており、レビューエージェントがstdioトランスポートを介してコードレビュー中に外部ツールを使用できます
Open Code Reviewは[Model Context Protocol (MCP)](https://modelcontextprotocol.io/)サーバーをサポートしており、レビューエージェントがコードレビュー中に外部ツールを使用できます。**stdio**(ローカルサブプロセス)と**remote**(Streamable HTTP)の2つのトランスポートに対応しています

CLIからMCPサーバーを設定します:

```bash
# MCPサーバーを追加
# Stdio MCPサーバー(デフォルト)
ocr config set mcp_servers.<name>.command <command>
ocr config set mcp_servers.<name>.args '["arg1","arg2"]'
ocr config set mcp_servers.<name>.env '["KEY=VALUE"]'
ocr config set mcp_servers.<name>.tools '["tool_name"]'
ocr config set mcp_servers.<name>.setup '<setup command>'

# リモートMCPサーバー
ocr config set mcp_servers.<name>.type remote
ocr config set mcp_servers.<name>.url https://mcp.example.com/mcp
ocr config set mcp_servers.<name>.headers '{"Authorization":"Bearer $MCP_TOKEN"}'

# MCPサーバーを削除
ocr config unset mcp_servers.<name>
```

| フィールド | 必須 | 説明 |
|-----------|------|------|
| `command` | はい | MCPサーバーを起動する実行コマンド |
| `type` | いいえ | `stdio`(デフォルト)または `remote` |
| `command` | はい(stdio) | MCPサーバーを起動する実行コマンド |
| `args` | いいえ | サーバーに渡すコマンドライン引数 |
| `env` | いいえ | 環境変数(`KEY=VALUE`形式) |
| `url` | はい(remote) | リモートMCPサーバーのURL(http/https) |
| `headers` | いいえ | HTTPヘッダー(JSONオブジェクト)。値は実行時に`$ENV_VAR`が展開されます |
| `tools` | いいえ | 許可するツール名。空の場合、サーバーのすべてのツールが利用可能 |
| `setup` | いいえ | サーバー起動前に実行するシェルコマンド(例:インデックスの構築) |

> **注意:** MCPツールの名前が組み込みツールと競合する場合、そのツールは警告付きでスキップされます。`setup`コマンドのタイムアウトは5分です。

> **ヒント:** CLIでheadersを設定する際は、シェルが`$ENV_VAR`を展開しないよう**シングルクォート**を使用してください。値はOCRが接続時に展開します(設定保存時ではありません)。または`~/.opencodereview/config.json`を直接編集してください。

**例:[CodeGraph](https://github.com/nicholasgasior/codegraph)を追加してコード構造分析を強化**

```bash
Expand All @@ -818,6 +831,30 @@ ocr config set mcp_servers.codegraph.tools '["codegraph_explore"]'
ocr config set mcp_servers.codegraph.setup 'codegraph init && codegraph index'
```

**例:リモートMCPサーバーに接続**

```bash
ocr config set mcp_servers.my-remote.type remote
ocr config set mcp_servers.my-remote.url 'https://mcp.example.com/mcp'
ocr config set mcp_servers.my-remote.headers '{"Authorization":"Bearer $MCP_TOKEN"}'
```

または`~/.opencodereview/config.json`で:

```json
{
"mcp_servers": {
"my-remote": {
"type": "remote",
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer $MCP_TOKEN"
}
}
}
}
```

### 環境変数

| 変数 | 用途 |
Expand Down
51 changes: 44 additions & 7 deletions README.ko-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,14 @@ Config file: `~/.opencodereview/config.json`
| `llm.extra_headers` | string | 쉼표로 구분된 `key=value` HTTP 헤더 |
| `llm.model` | string | `claude-opus-4-6` |
| `llm.use_anthropic` | boolean | `true` \| `false` |
| `mcp_servers.<name>.command` | string | MCP 서버를 시작하는 명령어 |
| `mcp_servers.<name>.args` | array | MCP 서버의 커맨드라인 인수 |
| `mcp_servers.<name>.env` | array | 환경 변수 (`KEY=VALUE` 형식) |
| `mcp_servers.<name>.type` | string | `stdio` (기본값) 또는 `remote` |
| `mcp_servers.<name>.command` | string | MCP 서버를 시작하는 명령어 (stdio) |
| `mcp_servers.<name>.args` | array | MCP 서버의 커맨드라인 인수 (stdio) |
| `mcp_servers.<name>.env` | array | 환경 변수 (`KEY=VALUE` 형식) (stdio) |
| `mcp_servers.<name>.url` | string | 원격 MCP 서버 URL (http/https) |
| `mcp_servers.<name>.headers` | object | 원격 서버의 HTTP 헤더 (`$ENV_VAR` 확장 지원) |
| `mcp_servers.<name>.tools` | array | 허용할 도구 이름 (비어 있으면 모든 도구 허용) |
| `mcp_servers.<name>.setup` | string | 서버 시작 전에 실행할 설정 명령어 |
| `mcp_servers.<name>.setup` | string | 서버 시작 전에 실행할 설정 명령어 (stdio) |
| `language` | string | 임의의 언어 이름, 예: `English`, `Chinese` (기본값: `English`) |
| `telemetry.enabled` | boolean | `true` \| `false` |
| `telemetry.exporter` | string | `console` \| `otlp` |
Expand All @@ -741,32 +744,42 @@ Config file: `~/.opencodereview/config.json`

### MCP Server

Open Code Review는 [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) 서버를 지원하여 리뷰 에이전트가 stdio 전송을 통해 코드 리뷰 중에 외부 도구를 사용할 수 있습니다.
Open Code Review는 [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) 서버를 지원하여 리뷰 에이전트가 코드 리뷰 중에 외부 도구를 사용할 수 있습니다. **stdio** (로컬 서브프로세스)와 **remote** (Streamable HTTP) 두 가지 전송 방식을 지원합니다.

CLI로 MCP 서버를 설정합니다:

```bash
# MCP 서버 추가
# Stdio MCP 서버 (기본값)
ocr config set mcp_servers.<name>.command <command>
ocr config set mcp_servers.<name>.args '["arg1","arg2"]'
ocr config set mcp_servers.<name>.env '["KEY=VALUE"]'
ocr config set mcp_servers.<name>.tools '["tool_name"]'
ocr config set mcp_servers.<name>.setup '<setup command>'

# 원격 MCP 서버
ocr config set mcp_servers.<name>.type remote
ocr config set mcp_servers.<name>.url https://mcp.example.com/mcp
ocr config set mcp_servers.<name>.headers '{"Authorization":"Bearer $MCP_TOKEN"}'

# MCP 서버 삭제
ocr config unset mcp_servers.<name>
```

| 필드 | 필수 | 설명 |
|------|------|------|
| `command` | 예 | MCP 서버를 시작하는 실행 명령어 |
| `type` | 아니오 | `stdio` (기본값) 또는 `remote` |
| `command` | 예 (stdio) | MCP 서버를 시작하는 실행 명령어 |
| `args` | 아니오 | 서버에 전달할 커맨드라인 인수 |
| `env` | 아니오 | 환경 변수 (`KEY=VALUE` 형식) |
| `url` | 예 (remote) | 원격 MCP 서버의 URL (http/https) |
| `headers` | 아니오 | HTTP 헤더 (JSON 객체). 값은 런타임에 `$ENV_VAR`가 확장됩니다 |
| `tools` | 아니오 | 허용할 도구 이름. 비어 있으면 서버의 모든 도구 사용 가능 |
| `setup` | 아니오 | 서버 시작 전에 실행할 셸 명령어 (예: 인덱스 빌드) |

> **참고:** MCP 도구의 이름이 내장 도구와 충돌하면 경고와 함께 건너뜁니다. `setup` 명령어의 타임아웃은 5분입니다.

> **팁:** CLI에서 headers를 설정할 때 셸이 `$ENV_VAR`를 확장하지 않도록 **작은따옴표**를 사용하세요. 값은 설정 저장 시가 아닌 OCR 연결 시에 확장됩니다. 또는 `~/.opencodereview/config.json`을 직접 편집하세요.

**예시: [CodeGraph](https://github.com/nicholasgasior/codegraph)를 추가하여 코드 구조 분석 강화**

```bash
Expand All @@ -776,6 +789,30 @@ ocr config set mcp_servers.codegraph.tools '["codegraph_explore"]'
ocr config set mcp_servers.codegraph.setup 'codegraph init && codegraph index'
```

**예시: 원격 MCP 서버에 연결**

```bash
ocr config set mcp_servers.my-remote.type remote
ocr config set mcp_servers.my-remote.url 'https://mcp.example.com/mcp'
ocr config set mcp_servers.my-remote.headers '{"Authorization":"Bearer $MCP_TOKEN"}'
```

또는 `~/.opencodereview/config.json`에서:

```json
{
"mcp_servers": {
"my-remote": {
"type": "remote",
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer $MCP_TOKEN"
}
}
}
}
```

### Environment Variables

| Variable | Purpose |
Expand Down
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,14 @@ Config file: `~/.opencodereview/config.json`
| `llm.extra_headers` | string | Comma-separated `key=value` HTTP headers |
| `llm.model` | string | `claude-opus-4-6` |
| `llm.use_anthropic` | boolean | `true` \| `false` |
| `mcp_servers.<name>.command` | string | Command to start the MCP server |
| `mcp_servers.<name>.args` | array | Command-line arguments for the MCP server |
| `mcp_servers.<name>.env` | array | Environment variables in `KEY=VALUE` format |
| `mcp_servers.<name>.type` | string | `stdio` (default) or `remote` |
| `mcp_servers.<name>.command` | string | Command to start the MCP server (stdio) |
| `mcp_servers.<name>.args` | array | Command-line arguments for the MCP server (stdio) |
| `mcp_servers.<name>.env` | array | Environment variables in `KEY=VALUE` format (stdio) |
| `mcp_servers.<name>.url` | string | URL for remote MCP server (http/https) |
| `mcp_servers.<name>.headers` | object | HTTP headers for remote server (supports `$ENV_VAR` expansion) |
| `mcp_servers.<name>.tools` | array | Allowed tool names (empty = all tools) |
| `mcp_servers.<name>.setup` | string | Setup command to run before starting the server |
| `mcp_servers.<name>.setup` | string | Setup command to run before starting the server (stdio) |
| `language` | string | Any language name, e.g. `English`, `Chinese` (default: `English`) |
| `telemetry.enabled` | boolean | `true` \| `false` |
| `telemetry.exporter` | string | `console` \| `otlp` |
Expand All @@ -790,32 +793,42 @@ Environment variables take precedence over the config file.

### MCP Server

Open Code Review supports [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers, allowing the review agent to use external tools during code review via the stdio transport.
Open Code Review supports [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers, allowing the review agent to use external tools during code review. Two transports are supported: **stdio** (local subprocess) and **remote** (Streamable HTTP).

Configure MCP servers via the CLI:

```bash
# Add an MCP server
# Stdio MCP server (default)
ocr config set mcp_servers.<name>.command <command>
ocr config set mcp_servers.<name>.args '["arg1","arg2"]'
ocr config set mcp_servers.<name>.env '["KEY=VALUE"]'
ocr config set mcp_servers.<name>.tools '["tool_name"]'
ocr config set mcp_servers.<name>.setup '<setup command>'

# Remote MCP server
ocr config set mcp_servers.<name>.type remote
ocr config set mcp_servers.<name>.url https://mcp.example.com/mcp
ocr config set mcp_servers.<name>.headers '{"Authorization":"Bearer $MCP_TOKEN"}'

# Delete an MCP server
ocr config unset mcp_servers.<name>
```

| Field | Required | Description |
|-------|----------|-------------|
| `command` | Yes | The executable command to start the MCP server |
| `type` | No | `stdio` (default) or `remote` |
| `command` | Yes (stdio) | The executable command to start the MCP server |
| `args` | No | Command-line arguments passed to the server |
| `env` | No | Environment variables in `KEY=VALUE` format |
| `url` | Yes (remote) | URL of the remote MCP server (http/https) |
| `headers` | No | HTTP headers as a JSON object; values support `$ENV_VAR` expansion at runtime |
| `tools` | No | Allowed tool names; if empty, all tools from the server are available |
| `setup` | No | A shell command to run before starting the server (e.g. build an index) |

> **Note:** If an MCP tool's name conflicts with a built-in tool, it will be skipped with a warning. The `setup` command has a 5-minute timeout.

> **Tip:** When setting headers via CLI, use **single quotes** to prevent the shell from expanding `$ENV_VAR` references. The values are expanded at runtime by OCR, not at config-save time. Alternatively, edit `~/.opencodereview/config.json` directly.

**Example: Add [CodeGraph](https://github.com/nicholasgasior/codegraph) for code structure analysis**

```bash
Expand All @@ -825,6 +838,30 @@ ocr config set mcp_servers.codegraph.tools '["codegraph_explore"]'
ocr config set mcp_servers.codegraph.setup 'codegraph init && codegraph index'
```

**Example: Connect to a remote MCP server**

```bash
ocr config set mcp_servers.my-remote.type remote
ocr config set mcp_servers.my-remote.url 'https://mcp.example.com/mcp'
ocr config set mcp_servers.my-remote.headers '{"Authorization":"Bearer $MCP_TOKEN"}'
```

Or in `~/.opencodereview/config.json`:

```json
{
"mcp_servers": {
"my-remote": {
"type": "remote",
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer $MCP_TOKEN"
}
}
}
}
```

### Environment Variables

| Variable | Purpose |
Expand Down
Loading
Loading