Skip to main content

prefect-jcodemunch

Prefect 3.x tasks and flows for keeping jcodemunch-mcp code indexes fresh across many repositories.

jcodemunch-mcp is a token-efficient MCP server that gives AI agents structural access to source code (symbols, call hierarchies, dead-code detection, refactor blast radius). It lives locally per-machine. Once you maintain indexes for more than a handful of repos, keeping them fresh becomes the kind of recurring orchestration problem Prefect is built for.

This package wraps the jcodemunch-mcp CLI as Prefect Tasks and Flows so you can:

  • Schedule periodic reindexing of every repo on a cron
  • Index on push by triggering a flow from a webhook
  • Chain indexing into larger pipelines (e.g. doc generation, CI gates, agent provisioning)
  • React to staleness by querying which repos haven't been touched in N days and refreshing only those

Install

pip install prefect-jcodemunch

This pulls in prefect>=3.0 and jcodemunch-mcp>=1.81.0 automatically. The jcodemunch-mcp binary needs to be on PATH (the install above puts it there).

Quick example

Reindex every locally-indexed repo whose index is more than 7 days old:

from prefect_jcodemunch import keep_indexes_fresh

if __name__ == "__main__":
    keep_indexes_fresh(older_than_days=7)

Deploy on a daily cron via Prefect Cloud:

prefect deploy examples/keep_indexes_fresh.py:keep_indexes_fresh \
    --name daily-reindex \
    --cron "0 4 * * *" \
    --pool default-agent-pool

Tasks

Task What it wraps
index_local_folder(path) jcodemunch-mcp index <path>
index_github_repo(owner_repo) jcodemunch-mcp index <owner>/<repo>
index_file(path) jcodemunch-mcp index-file <path> (single-file refresh)
list_repos() MCP list_repos tool — returns [{source_root, indexed_at, ...}, …]
reindex_stale_repos(older_than_days=N) list_repos → filter by age → index_local_folder per stale repo

All Tasks accept cli_path= to override the binary location, and pass through to standard Prefect kwargs (retries, timeout, tags) at decoration time.

Flows

Flow Purpose
keep_indexes_fresh(older_than_days=7) The standard "schedule me on a cron" flow — walks every locally-indexed repo, refreshes anything older than the threshold

Compose with other Prefect blocks

Tasks emit standard Prefect logs and respect retry/timeout config, so the usual blocks plug in:

  • Slack / Discord notifications on flow failure via prefect-slack / prefect-community
  • GitHub event triggers via prefect-github
  • Result persistence to S3 / GCS / local FS via standard result storage blocks

License

This wrapper package (prefect-jcodemunch) is MIT.

The wrapped tool, jcodemunch-mcp, is dual-licensed: free for non-commercial use (personal, academic, research) and paid for commercial use. Commercial license tiers and pricing at j.gravelle.us/jCodeMunch. Review the terms before deploying in a commercial workflow.

Issues / contributions

Issues and PRs welcome at https://github.com/jgravelle/prefect-jcodemunch.

For jcodemunch-mcp itself (CLI / index format / MCP tools), file at https://github.com/jgravelle/jcodemunch-mcp/issues.

Metadata

Release files for prefect-jcodemunch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prefect-jcodemunch 0.1.0
File Size Uploaded Provenance
prefect_jcodemunch-0.1.0.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-jcodemunch 0.1.0
File Interpreter ABI Platform
prefect_jcodemunch-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / prefect_jcodemunch-0.1.0.tar.gz

Download URL prefect_jcodemunch-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c1eb36aa8020ac0e141ce581112f3efb3306c95a4dfe8a4cfcc84eebab6c6d0f
BLAKE2b-256 checksum
How to use checksums
e2315a92e2cf66d1843a6f2bef4867cd42aedaecc124730fd361e80a926e41fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / prefect_jcodemunch-0.1.0-py3-none-any.whl

Download URL prefect_jcodemunch-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db1a104ff55c96f00e6e8b14b1bf6234d3ea44e18124cfc111cca5cb6bc30ede
BLAKE2b-256 checksum
How to use checksums
6842e1930221cefc157f84ef0c8a88c585ebf093ba51075e7ef53d2f3fb38d23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for prefect-jcodemunch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page