Skip to main content
Glama

RepoFlow Lite

Learn an open-source Python codebase before you touch it.

An MCP server that helps you understand a repo, follow its contribution rules, run its tests safely, and learn from real bugs.

CI PyPI Python License: MIT PRs welcome

Quickstart Β· Features Β· How it works Β· Contributing Β· Roadmap


Why RepoFlow?

Maintainers are flooded with low-effort, AI-generated pull requests. New contributors often want to help, but don't know where to start or what the project expects.

RepoFlow Lite takes a "learn first" approach:

  • Understand the code before changing it.

  • Respect each project's rules (CONTRIBUTING, AI policy, CLA/DCO, CI).

  • Find real problems with evidence: failing tests, static-analysis hits, flaky tests.

  • Teach: every finding becomes a plain-language teaching card.

RepoFlow Lite does not open issues or pull requests for you. It helps you learn enough to make a good contribution yourself.

Related MCP server: MCP Code Checker

Features

Area

What you get

Tools

πŸ—ΊοΈ Understand

Repo map, architecture overview, hotspots (files that change often)

analyze_repo, get_architecture, find_hotspots

πŸ“œ Contribution policy

The project's playbook: CONTRIBUTING, security policy, AI-use policy, CLA/DCO, CI, templates

get_contribution_playbook, check_ai_policy, get_contribution_steps, check_pr_readiness

πŸ§ͺ Discover

Set up the environment, run tests, run static analysis, detect flaky tests

setup_environment, run_tests, run_static_analysis, detect_flaky_tests

πŸ“¦ Sandbox

Tests run inside Docker, so a repo's code doesn't run directly on your machine

sandbox_status

πŸŽ“ Teach

Record findings, turn them into teaching cards, export a report

record_finding, update_finding, list_findings, get_finding, explain_finding, export_report

Plus three JSON resources: repo://{owner}/{name}/map (repo map), playbook://{owner}/{name} (contribution playbook) and findings://{owner}/{name} (recorded findings).

Quickstart

Requirements

Install

git clone https://github.com/LolPanda2004/repoflow.git
cd repoflow
pip install -e ".[dev]"

Register with Claude Code

claude mcp add repoflow -- repoflow

Then open Claude Code and run /mcp to check that repoflow is connected.

Try it

Start with a small Python repo:

> Use repoflow to analyze owner/small-repo and explain its architecture.
> What does this project expect from contributors? Check its AI policy.
> Run its tests in the sandbox and explain any failure as a teaching card.

How it works

           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  you ───▢ β”‚  MCP client  β”‚  (e.g. Claude Code)
           β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚ stdio
           β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
           β”‚   RepoFlow   β”‚
           β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β–Ό          β–Ό          β–Ό          β–Ό         β–Ό
understand  policy   discover   sandbox    teach
 (map,     (rules,   (tests,    (Docker)  (cards,
 hotspots)  AI use)  static)              report)

Project layout (src/repoflow/):

Module

Job

core/

Config, GitHub client (read-only), models, process runner, local store, workspace

understand/

Repo map, hotspots, architecture

policy/

Contribution playbook, AI policy, readiness checks

discover/

Environment setup, tests, static analysis, flaky tests

sandbox/

Docker runner

teach/

Findings, teaching cards, reports, prompts

server.py

MCP server entry point; registers each module's tools

Design principles

  1. Teach, don't submit. The goal is a better contributor, not more PRs.

  2. Evidence over guesses. A finding needs a failing test, a tool result, or a reproducible run.

  3. Respect the project. Its rules come first, including any rules about AI.

  4. Safe by default. Repo code runs in Docker. GitHub access is read-only.

Guards (optional)

RepoFlow Lite never writes to GitHub. Your AI assistant might still try to, through its shell. repoflow guards adds Claude Code deny rules for direct GitHub writes (gh pr create, gh api, git push and similar), so those need a human.

repoflow guards install            # adds the rules to ~/.claude/settings.json
repoflow guards install --project  # or to ./.claude/settings.json
repoflow guards status             # shows which rules are present
repoflow guards remove             # takes them out again

install shows a diff and asks before writing (--yes skips the prompt). It keeps your other settings, backs up the old file, and refuses to touch a file that is not valid JSON.

Development

pip install -e ".[dev]"
python -m pytest -q          # full suite; some tests need Docker running
python -m pytest -q tests/test_policy.py   # run one file
ruff check . && ruff format .            # lint and format

Import check:

python -c "import sys; sys.path.insert(0, 'src'); import repoflow.server"

Contributing

Contributions are welcome, from typo fixes to new tools.

  1. Read CONTRIBUTING.md.

  2. Look for issues labeled good first issue or help wanted.

  3. Comment on the issue before you start, so work isn't duplicated.

  4. Keep PRs small, add tests, and make sure python -m pytest -q passes.

  5. If you used AI tools, say so in the PR description.

Questions and ideas go in GitHub Discussions.

Code of Conduct

This project follows the Contributor Covenant. See CODE_OF_CONDUCT.md.

Security

Please don't report security problems in public issues. See SECURITY.md.

Roadmap

  • Repo understanding: map, hotspots, architecture

  • Contribution playbook and AI-policy checks

  • Tests, static analysis and flaky-test detection in Docker

  • Teaching cards and reports

  • One "environment ready" check shared by all modules

  • Better isolation for local (non-Docker) mode

  • More teaching-card templates and beginner-friendly wording

  • Support for more project layouts (monorepos, tox/nox-based setups)

Have an idea? Open a discussion.

License

MIT

A separate hosted, paid version of RepoFlow also exists.


Available Tools

18 tools
analyze_repoA
Read-onlyIdempotent

Map a public Python GitHub repo. CALL THIS FIRST for any new repo.

Clones the repo if needed (full history, so later blame/bisect work), then returns a RepoMap: lines per language, top-level packages, entry points (console scripts, main.py), test framework and the exact suggested test command, the 25 largest non-test modules with their intra-repo imports (parsed with ast), a README excerpt, and notes such as "no tests found" or "uses C extensions". Results are cached per HEAD commit; pass refresh=True to rebuild.

Args: repo: "owner/name" or a github.com URL. refresh: rebuild even if a map for this commit is cached.

Inputs: repo (required), refresh.

check_ai_policyA
Idempotent

Classify the repo's stance on AI-assisted contributions: banned | disclosure_required | allowed | unknown, with quotes and their source files (CONTRIBUTING, AI_POLICY*, .github/*, README, CODE_OF_CONDUCT). Conservative: ambiguous banning language counts as banned. If banned, do NOT prepare a PR: tell the user and stop. finding_id is optional and checks that the finding exists; Lite does not record the result.

Inputs: repo (required), finding_id.

check_pr_readinessA
Idempotent

Run the pre-PR checklist on the current branch of the local clone: not on the default branch, commits exist, tests added/changed, DCO sign-off on every branch commit (if required), changelog fragment (if required), PR template sections present in pr_body (required when the repo has a template), issue-first satisfied (finding.issue_url) when required, finding not a security bug (those go private), AI policy not banned. Re-run after any code change. Returns passed, checks[{name, ok, detail}] and next. Lite does not record the result.

Inputs: repo (required), finding_id (required), pr_body.

detect_flaky_testsA
Read-onlyIdempotent

Re-run specific tests runs times to tell real bugs from flaky tests.

ALWAYS use this before reporting any test failure as a bug. Pass node ids from run_tests (e.g. "tests/test_x.py::test_y"); at most 10 ids, runs clamped to 2..20. Each test runs in its own pytest process (so one bad id cannot spoil the others) and is classified as consistently_failing, flaky, passing or not_run, with pass/fail counts per run.

Inputs: repo (required), test_ids (required), runs, timeout_s.

explain_findingA
Read-onlyIdempotent

Render the teaching card for a finding as markdown: where (file:line, function, introducing commit), the code with the bad line marked >>, what, why, repro, fix options with trade-offs, lesson and evidence. level: "junior" (adds key concepts) or "senior" (terse). If why / fix_options / lesson are missing, the card ends with a "TODO for Claude" section: fill those via update_finding, then call this again. Show the card to the user as-is.

Inputs: repo (required), finding_id (required), level.

export_reportA
Idempotent

Write a markdown audit report (summary table + every teaching card) for all findings. Default location is the repo's RepoFlow artifact dir; a custom path must be inside the workspace and end in .md. Returns the file path and finding count.

Inputs: repo (required), path.

find_hotspotsA
Read-onlyIdempotent

Rank files where bugs most likely hide: change frequency (churn) x code complexity.

Use after analyze_repo to decide where to look for bugs or what to read first. Churn = number of commits touching the file in the window (git log --numstat); complexity = approximate McCabe cyclomatic complexity per function via ast. Research basis: relative code churn predicts defect density (Nagappan & Ball, ICSE 2005), and churn combined with complexity pinpoints defect-prone "hotspots" (Tornhill, "Your Code as a Crime Scene", 2015). Test files are excluded.

Returns per file: rank, score (0..1), churn, lines_changed, complexity_total, complexity_max, the 3 most complex functions (name, line, complexity), and the git command used as evidence.

Args: repo: "owner/name" or a github.com URL. top: how many files to return (1-50). since: history window, e.g. "12 months", "6 weeks", or a date "2024-01-31".

Inputs: repo (required), top, since.

get_architectureA
Read-onlyIdempotent

Summarize the repo's internal module dependency structure from static imports.

Use to explain how the code fits together, or to judge the blast radius of a change. Returns core modules (most imported by other internal modules), leaf modules (imported but import nothing internal), the most dependent modules (most internal imports), a count of isolated modules, and import cycles (groups of modules that import each other, often a design smell). Test modules are excluded; dynamic imports are not seen.

Args: repo: "owner/name" or a github.com URL.

Inputs: repo (required).

get_contribution_playbookA
Read-onlyIdempotent

START HERE before contributing to a repo (Layer 0). Returns the repo's contribution rules, read from the local clone at the default branch: CONTRIBUTING, code of conduct, SECURITY policy (security bugs are always reported privately, never as public issues/PRs), PR and issue templates (with required fields), governance/CODEOWNERS, CLA, DCO sign-off, commit message convention, changelog/news-fragment rules, dev setup and test commands, pre-commit hooks, CI workflows, whether an issue must come before a PR, the AI policy, and (with a GitHub token) maintainer activity stats. Each item names its source file and quotes it. Cached per default-branch commit; refresh=True rebuilds. Follow it; then call get_contribution_steps.

Inputs: repo (required), refresh.

get_contribution_stepsA
Read-onlyIdempotent

Ordered, repo-specific checklist for a contribution, derived from the playbook. kind: bugfix | docs | feature. Covers: private security reporting, AI policy, reading CONTRIBUTING, duplicate search, issue-first, CLA, branch, dev setup, failing test first, full test run, pre-commit, commit style, DCO sign-off, changelog fragment, PR template, check_pr_readiness, explaining the fix in your own words, then a draft PR you open yourself. Each step names its source and, where one fits, the RepoFlow tool to use (tool is null for manual steps). Walk the user through it in order.

Inputs: repo (required), kind.

get_findingB
Read-onlyIdempotent

Return one finding in full, including every evidence entry.

Inputs: repo (required), finding_id (required).

list_findingsA
Read-onlyIdempotent

List recorded findings for a repo as compact rows (id, title, severity, confidence, status, location, evidence_count, needs_teaching). Filter with status. Use get_finding for full detail.

Inputs: repo (required), status.

record_findingA

Save a bug to the local evidence ledger (no GitHub calls). Use after you have reproduced a bug.

Never record without a reproducing command: pass evidence_command (the exact command you ran) and evidence_output (its output). If you could not reproduce it, confidence MUST be "low". source: test | static | fuzz | flaky | manual. severity: low | medium | high | critical. file is repo-relative and must be given with line (1-based). The evidence is stamped with the repo HEAD commit and UTC time. Returns the stored finding, including its id (e.g. "F-001").

Inputs: repo (required), title (required), source (required), why, +12 more.

run_static_analysisA
Read-onlyIdempotent

Run static analyzers (pyflakes, mypy --ignore-missing-imports) over the repo's code.

Use this to find likely bugs without running tests: undefined names, redefinitions, type errors. tools is comma-separated ("pyflakes", "mypy" or both). paths is comma-separated repo-relative paths (default: top-level source dirs). Noise such as unused imports/variables and mypy notes is dropped unless include_style=True. Missing analyzers are pip-installed into the repo env. Returns {issues: [{file, line, code, message, tool}], counts_by_code, commands, commit, truncated}. Static issues are candidates: confirm with a test before reporting.

Inputs: repo (required), paths, tools, max_results, +1 more.

run_testsA
Read-onlyIdempotent

Run the repo's pytest suite (or one target: a file, dir or node id) in its environment.

Use this to find real, reproducible test failures. Returns counts, the exact command and commit (ready to use as Evidence), and up to max_failures failures. Each failure has the message, a trimmed traceback, and location: the deepest traceback frame inside the repo that is NOT a test file, i.e. where the bug most likely lives (null if only test code ran). Requires setup_environment first. Check failures with detect_flaky_tests before reporting.

Inputs: repo (required), target, timeout_s, max_failures.

sandbox_statusA
Read-onlyIdempotent

Report how RepoFlow runs code from target repos: the sandbox mode (docker / local / off), whether Docker is available, the Docker image, and safety warnings. Call this before running tests on an unfamiliar repo, or when a run fails with a sandbox error.

Inputs: no named parameters.

setup_environmentA
Idempotent

Create the repo's isolated Python environment and install the repo plus its test deps.

Call this once per repo before run_tests, run_static_analysis or detect_flaky_tests. extras is a comma-separated list of pip extras (e.g. "test" or "test,dev"); "" installs none. Returns {ok, output (trimmed), next_steps}.

Inputs: repo (required), extras.

update_findingA
Idempotent

Change a recorded finding; only the fields you pass are changed.

Use it to fill the teaching fields (why, fix_options, lesson), set status (candidate | confirmed | rejected | reported | fixed), add issue_url / pr_url, or append new evidence (evidence_command + evidence_output). fix_options replaces the list; each item is {"title", "description", "tradeoff", "recommended": bool} and at most one is recommended. Returns the updated finding.

Inputs: repo (required), finding_id (required), why, file, +17 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 18 tools

    Disambiguation4/5

    The surface is split into clearly staged layers (analysis: analyze_repo/find_hotspots/get_architecture; execution: setup_environment/run_tests/run_static_analysis/detect_flaky_tests; ledger: record/update/get/explain/export; contribution: playbook/ai-policy/steps/pr-readiness), and descriptions spell out ordering and prerequisites. The only real overlaps are check_ai_policy being a subset of get_contribution_playbook and get_contribution_steps being derived from the playbook, but the descriptions explain the distinction (classification verdict vs. checklist) well enough.

    Naming Consistency4/5

    18 of 19 names follow a clean snake_case verb_noun pattern (list_findings, run_tests, record_finding, check_pr_readiness). The single deviation is sandbox_status, which is a noun phrase rather than verb_noun, plus a few multi-word verbs (get_contribution_playbook) that are long but predictable.

    Tool Count4/5

    18 tools is on the heavy side but each maps to a distinct stage of a genuinely multi-phase workflow (analysis, environment, test execution, triage, evidence ledger, contribution compliance), so nothing feels padded. A couple of consolidation candidates exist (analyze_repo vs find_hotspots vs get_architecture, playbook vs ai-policy), keeping it just below a clean scope.

    Completeness4/5

    Coverage runs the full loop: clone/map, environment setup, test and static analysis, flake triage, evidence-stamped findings with CRUD, teaching cards, export, and a whole contribution-readiness pipeline including AI policy and DCO/changelog checks. Minor gaps are no delete_finding and a status-only filter on list_findings, but agents can work around both via update_finding.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to automatically analyze GitHub repositories and set up development environments by detecting tech stacks, installing dependencies, and verifying project builds. Provides safe tools for repository cloning, file system operations, package installation, and build verification through an allowlisted command system.
      -
    • -
      license
      Not graded
      quality
      D
      maintenance
      Enables AI-driven DevOps project analysis and automation through dynamic tool selection for file inspection, Dockerfile analysis, health checks, and test execution.
      -