Skip to content

fix: add --repo to serve so get_docs_section works via uvx#24

Open
lbzepoqo wants to merge 1 commit intotirth8205:mainfrom
lbzepoqo:fix/docs-not-found-in-wheel
Open

fix: add --repo to serve so get_docs_section works via uvx#24
lbzepoqo wants to merge 1 commit intotirth8205:mainfrom
lbzepoqo:fix/docs-not-found-in-wheel

Conversation

@lbzepoqo
Copy link

@lbzepoqo lbzepoqo commented Mar 18, 2026

Problem

get_docs_section_tool always returns {"status": "not_found"} when the MCP server runs via uvx. The root cause is that the existing auto-detection relies on the current working directory being inside the repo, which is not the case under uvx.

The serve subcommand was also the only one without a --repo argument — every other subcommand (build, update, watch, status, visualize, install, init) accepts --repo for explicit repo root specification.

Solution

Add --repo to the serve subcommand, consistent with all other subcommands. Thread the value through main() via a module-level default, then pass it to get_docs_section so the tool can locate docs/LLM-OPTIMIZED-REFERENCE.md.

No files are bundled into the wheel — docs stay in docs/ in the source tree.

Usage

# Standard install via uvx — now works correctly:
uvx code-review-graph serve --repo /path/to/your/repo

In .mcp.json:

{
  "mcpServers": {
    "code-review-graph": {
      "command": "uvx",
      "args": ["code-review-graph", "serve", "--repo", "/path/to/your/repo"]
    }
  }
}

Changes

File Change
code_review_graph/cli.py Add --repo to serve subparser; pass to serve_main()
code_review_graph/main.py Accept repo_root in main(); store as module-level default; pass to get_docs_section
code_review_graph/tools.py Add repo_root param to get_docs_section; use explicit path first, then auto-detect

Test Plan

  • uv run --with pytest pytest — 111 passed
  • get_docs_section('troubleshooting', repo_root='.') returns section content
  • code-review-graph serve --help shows --repo option

🤖 Generated with Claude Code

When running via uvx, the working directory is not the repo root, so
the existing auto-detection via _get_store() fails and get_docs_section_tool
always returns {"status": "not_found"}.

Add --repo to the serve subcommand (consistent with all other subcommands),
thread it through main() using a module-level default, and pass it to
get_docs_section so the tool can locate docs/LLM-OPTIMIZED-REFERENCE.md
from an explicitly provided path.

Usage: uvx code-review-graph serve --repo /path/to/repo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lbzepoqo lbzepoqo force-pushed the fix/docs-not-found-in-wheel branch from e989bd6 to 1b7595a Compare March 18, 2026 08:25
@lbzepoqo lbzepoqo changed the title fix: bundle LLM-OPTIMIZED-REFERENCE.md in wheel so get_docs_section works fix: add --repo to serve so get_docs_section works via uvx Mar 18, 2026
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