You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(mcp): add Model Context Protocol server support
Add MCP client and provider packages that allow integrating external
MCP tool servers into the review loop. Includes config commands for
managing MCP servers, stdio subprocess integration tests, and
comprehensive test coverage.
* refactor(mcp): rename loop variable in contentToText to avoid shadowing Client receiver
* fix(mcp): use platform-specific shell for setup command
The MCP server setup command was hardcoded to use `sh -c`, which
fails on Windows. Extract a `shellCommand` helper behind build tags
to use `cmd /c` on Windows and `sh -c` elsewhere.
* docs(mcp): add MCP server documentation to all README locales
Environment variables take precedence over the config file.
688
693
694
+
### MCP Server
695
+
696
+
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.
697
+
698
+
Configure MCP servers via the CLI:
699
+
700
+
```bash
701
+
# Add an MCP server
702
+
ocr config set mcp_servers.<name>.command <command>
703
+
ocr config set mcp_servers.<name>.args '["arg1","arg2"]'
704
+
ocr config set mcp_servers.<name>.env '["KEY=VALUE"]'
705
+
ocr config set mcp_servers.<name>.tools '["tool_name"]'
706
+
ocr config set mcp_servers.<name>.setup '<setup command>'
707
+
708
+
# Delete an MCP server
709
+
ocr config unset mcp_servers.<name>
710
+
```
711
+
712
+
| Field | Required | Description |
713
+
|-------|----------|-------------|
714
+
|`command`| Yes | The executable command to start the MCP server |
715
+
|`args`| No | Command-line arguments passed to the server |
716
+
|`env`| No | Environment variables in `KEY=VALUE` format |
717
+
|`tools`| No | Allowed tool names; if empty, all tools from the server are available |
718
+
|`setup`| No | A shell command to run before starting the server (e.g. build an index) |
719
+
720
+
> **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.
721
+
722
+
**Example: Add [CodeGraph](https://github.com/nicholasgasior/codegraph) for code structure analysis**
723
+
724
+
```bash
725
+
ocr config set mcp_servers.codegraph.command codegraph
726
+
ocr config set mcp_servers.codegraph.args '["serve","--mcp"]'
727
+
ocr config set mcp_servers.codegraph.tools '["codegraph_explore"]'
728
+
ocr config set mcp_servers.codegraph.setup 'codegraph init && codegraph index'
Copy file name to clipboardExpand all lines: README.ru-RU.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -675,6 +675,11 @@ OCR разрешает правила ревью по цепочке приор
675
675
|`llm.extra_headers`| string | HTTP-заголовки `key=value` через запятую |
676
676
|`llm.model`| string |`claude-opus-4-6`|
677
677
|`llm.use_anthropic`| boolean |`true`\|`false`|
678
+
|`mcp_servers.<name>.command`| string | Команда для запуска MCP-сервера |
679
+
|`mcp_servers.<name>.args`| array | Аргументы командной строки для MCP-сервера |
680
+
|`mcp_servers.<name>.env`| array | Переменные окружения в формате `KEY=VALUE`|
681
+
|`mcp_servers.<name>.tools`| array | Разрешённые имена инструментов (пусто = все инструменты) |
682
+
|`mcp_servers.<name>.setup`| string | Команда настройки перед запуском сервера |
678
683
|`language`| string | Любое название языка, например `English`, `Chinese` (по умолчанию: `English`) |
679
684
|`telemetry.enabled`| boolean |`true`\|`false`|
680
685
|`telemetry.exporter`| string |`console`\|`otlp`|
@@ -683,6 +688,43 @@ OCR разрешает правила ревью по цепочке приор
683
688
684
689
Переменные окружения имеют приоритет над файлом конфигурации.
685
690
691
+
### MCP-сервер
692
+
693
+
Open Code Review поддерживает серверы [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), позволяя агенту ревью использовать внешние инструменты во время проверки кода через stdio-транспорт.
694
+
695
+
Настройка MCP-серверов через CLI:
696
+
697
+
```bash
698
+
# Добавить MCP-сервер
699
+
ocr config set mcp_servers.<name>.command <command>
700
+
ocr config set mcp_servers.<name>.args '["arg1","arg2"]'
701
+
ocr config set mcp_servers.<name>.env '["KEY=VALUE"]'
702
+
ocr config set mcp_servers.<name>.tools '["tool_name"]'
703
+
ocr config set mcp_servers.<name>.setup '<setup command>'
704
+
705
+
# Удалить MCP-сервер
706
+
ocr config unset mcp_servers.<name>
707
+
```
708
+
709
+
| Поле | Обязательно | Описание |
710
+
|------|-------------|----------|
711
+
|`command`| Да | Исполняемая команда для запуска MCP-сервера |
712
+
|`args`| Нет | Аргументы командной строки для сервера |
713
+
|`env`| Нет | Переменные окружения в формате `KEY=VALUE`|
714
+
|`tools`| Нет | Разрешённые имена инструментов; если пусто — доступны все инструменты сервера |
715
+
|`setup`| Нет | Shell-команда для выполнения перед запуском сервера (например, построение индекса) |
716
+
717
+
> **Примечание:** Если имя MCP-инструмента конфликтует со встроенным инструментом, он будет пропущен с предупреждением. Таймаут команды `setup` составляет 5 минут.
718
+
719
+
**Пример: добавление [CodeGraph](https://github.com/nicholasgasior/codegraph) для усиления анализа структуры кода**
720
+
721
+
```bash
722
+
ocr config set mcp_servers.codegraph.command codegraph
723
+
ocr config set mcp_servers.codegraph.args '["serve","--mcp"]'
724
+
ocr config set mcp_servers.codegraph.tools '["codegraph_explore"]'
725
+
ocr config set mcp_servers.codegraph.setup 'codegraph init && codegraph index'
0 commit comments