From 5b2e61266f503509c0ab83263a6c89caacc75d36 Mon Sep 17 00:00:00 2001 From: Adarsh Balanolla Date: Fri, 27 Mar 2026 22:38:34 -0700 Subject: [PATCH] fix: detect install method when generating .mcp.json The install command hardcodes uvx as the MCP server command, which fails for pip-installed users who don't have uvx on PATH. Now checks for uvx availability via shutil.which() and falls back to the direct code-review-graph command. Fixes #75 Co-Authored-By: Claude Opus 4.6 (1M context) --- code_review_graph/skills.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code_review_graph/skills.py b/code_review_graph/skills.py index cdeab56..1a69677 100644 --- a/code_review_graph/skills.py +++ b/code_review_graph/skills.py @@ -10,6 +10,7 @@ import json import logging import platform +import shutil from pathlib import Path from typing import Any @@ -87,10 +88,16 @@ def _zed_settings_path() -> Path: def _build_server_entry(plat: dict[str, Any], key: str = "") -> dict[str, Any]: """Build the MCP server entry for a platform.""" - entry: dict[str, Any] = { - "command": "uvx", - "args": ["code-review-graph", "serve"], - } + if shutil.which("uvx"): + entry: dict[str, Any] = { + "command": "uvx", + "args": ["code-review-graph", "serve"], + } + else: + entry: dict[str, Any] = { + "command": "code-review-graph", + "args": ["serve"], + } if plat["needs_type"]: entry["type"] = "stdio" if key == "opencode":