PRReviewIQ is a local FastAPI app plus Python CLI that reviews pull request diffs with HuggingFace and logs every review insight into a Notion knowledge base through Notion MCP.
POST /api/setupprovisions the Notion workspace structure.POST /api/review-prreviews a raw git diff and logs findings.POST /api/review-filereviews a single file for pre-commit style checks.GET /api/standardsreturns the living coding standards database as JSON.POST /api/weekly-digestcreates a weekly quality report page in Notion.python review.py --repo /path/to/reporuns the CLI against a local git repo.
This implementation uses the official @notionhq/notion-mcp-server package locally via npx, with NOTION_TOKEN passed to the MCP server. MCP stdio is the primary path; direct REST is retained only as a constrained fallback for supported Notion operations and for database endpoints that the current MCP server does not expose reliably.
- Python 3.11+
- Node.js and
npx - A Notion integration token in
NOTION_TOKEN - A parent Notion page ID in
NOTION_PARENT_PAGE_ID - A HuggingFace API key in
HF_API_KEYor a localHF_TOKENfallback
python -m pip install -e ".[dev]"
uvicorn app.main:app --reloadOpen http://127.0.0.1:8000.
python review.py --repo /path/to/repo
python review.py --file path/to/file.py --pr-title "Pre-commit review" --repo-name my-repopython -m pytest
python -m compileall app tests review.pyThe app can serve health and static UI routes without tokens. Review/setup routes fail with explicit configuration errors until HF_API_KEY or HF_TOKEN, NOTION_TOKEN, NOTION_PARENT_PAGE_ID, and optional GITHUB_TOKEN are configured. /api/health reports notion_transport so MCP stdio and REST fallback are not confused. If NOTION_TOKEN is not loaded, live Notion setup/review/digest routes cannot be tested; REST fallback errors are sanitized before surfacing.
.envcontains tokens and is ignored..prreviewiq/contains local Notion workspace state created by setup and is ignored.- Do not commit Notion page IDs, tokens, generated reports, or cache directories.
app/
api/
core/
schemas/
services/
static/
review.py
tests/
