@jussmor/commit-memory-mcp
v0.5.0
Published
Commit-aware RAG with sqlite-vec and MCP tools for local agent workflows
Downloads
1,593
Readme
@jussmor/commit-memory-mcp
A local MCP server for PR intelligence, author tracing, and worktree-aware async planning.
Purpose
This package helps agents answer:
- who changed a file or area
- why a change was made
- what landed on main recently
- what context should be reviewed before planning
Current MCP tools
sync_pr_contextbuild_context_packpromote_context_factsarchive_feature_contextlist_active_worktreeswho_changed_thiswhy_was_this_changedget_main_branch_overnight_briefresume_feature_session_briefpre_plan_sync_brief
Removed tools
The following legacy tools were removed:
search_related_commitsexplain_commit_matchget_commit_diffreindex_commits
Quick start
npm install @jussmor/commit-memory-mcp
npx commit-memory-mcpFor local development in this repository:
cd packages/commit-rag-mcp
npm install
npm run build
node dist/mcp/server.jsRequirements
- Node.js 20+
ghCLI authenticated for GitHub PR sync features- a git repository available through
COMMIT_RAG_REPO
Environment variables
COMMIT_RAG_REPOrepository path used by the MCP serverCOMMIT_RAG_DBSQLite database pathCOMMIT_RAG_LIMITdefault sync/query limitOLLAMA_BASE_URLoptional Ollama base URLOLLAMA_EMBED_MODELoptional embedding modelCOPILOT_TOKENoptional Copilot reranking tokenCOPILOT_MODELoptional Copilot model overrideCOPILOT_BASE_URLoptional Copilot API base URL
Use cases
Sync GitHub PR context
sync_pr_context({
owner: "MaxwellClinic-Development",
repo: "EverBetter-Pro",
domain: "billing",
feature: "invoice-retry",
branch: "feat/invoice-retry",
taskType: "planning",
limit: 20
})Use this before planning when you need fresh PR descriptions, comments, and reviews.
List active worktrees
list_active_worktrees({
baseBranch: "main"
})Use this when your team works on multiple features in parallel and wants session-aware context.
Build a scoped context pack
build_context_pack({
domain: "billing",
feature: "invoice-retry",
branch: "feat/invoice-retry",
taskType: "coding",
includeDraft: false,
limit: 12
})Use this before invoking a coding subagent to keep prompts small and focused.
The pack is assembled main-first: promoted facts on main are treated as baseline truth, then branch/feature facts are added as in-flight overlay.
If no rows are found in strict scope, the server falls back automatically to broader scope levels.
Important: if you provide domain/feature/branch tags in build_context_pack, use the same tags during sync_pr_context for best precision.
Promote draft facts after review
promote_context_facts({
domain: "billing",
feature: "invoice-retry",
branch: "feat/invoice-retry"
})Use this when discussion outcomes are approved and should become durable context.
Archive completed feature context
archive_feature_context({
domain: "billing",
feature: "invoice-retry"
})Use this after merge/closure to prevent active context bloat.
Find ownership for a file
who_changed_this({
filePath: "src/features/auth/session.ts",
limit: 15
})Use this to discover recent authors and commit history for a target file.
Explain what is happening in a Next.js folder
explain_path_activity({
targetPath: "app/dashboard",
owner: "MaxwellClinic-Development",
repo: "EverBetter-Pro",
limit: 30
})Use this when you want a fast folder-level summary for areas like app/dashboard, app/(authenticated), or src/components.
It returns recent commits, top authors, most touched files, and related PR context/decisions when available.
Explain intent for a change
why_was_this_changed({
filePath: "src/features/auth/session.ts",
owner: "MaxwellClinic-Development",
repo: "EverBetter-Pro"
})Use this to combine commit metadata with synced PR context.
Get an overnight main-branch brief
get_main_branch_overnight_brief({
baseBranch: "main",
sinceHours: 12,
limit: 25
})Use this at the start of the day to review what landed while you were offline.
Resume a feature worktree
resume_feature_session_brief({
worktreePath: "/path/to/worktree",
baseBranch: "main"
})Use this before resuming unfinished work in a separate worktree.
Run the full pre-plan sync flow
pre_plan_sync_brief({
owner: "MaxwellClinic-Development",
repo: "EverBetter-Pro",
baseBranch: "main",
worktreePath: "/path/to/worktree",
sinceHours: 12,
limit: 25
})Use this as the default entrypoint for async team planning.
Multi-session git worktree flow
For parallel AI coding sessions:
- Create one git worktree per feature branch.
- Use
list_active_worktreesto enumerate active sessions. - Use
resume_feature_session_briefper worktree to check divergence and overlap risks. - Generate a worktree-specific
build_context_packand hand it to the target subagent.
This pattern avoids one giant shared context and scales better as features grow.
Data model overview
The package stores local context for:
- commits
- pull requests
- PR comments
- PR reviews
- promoted decision/blocker summaries
- worktree session checkpoints
Publishing
npm run build
npm publish --access publicFor MCP Registry publication, keep package.json mcpName and server.json name aligned.
