Back to Projects

Repo Context Kit

repo-context-kit

A CLI and MCP server that gives coding agents scoped repository context, task records, and explicit execution gates.

Role: Solo Developer / Maintainer

Highlights

Node.jsJavaScriptESMnpm CLIMCP serverRuntime/v1 JSONConfirmation gatesDeterministic repository scanningNode test runnerGitHub Actions
  • Published an npm package with a CLI and MCP server for repository context and task workflows.
  • Generated file and symbol indexes alongside structured task, execution, and verification records.
  • Added bounded JSON responses, schema validation, and scan freshness checks.
  • Made write and execution capabilities opt-in, with confirmation gates for task and test actions.

Problem

Long coding sessions can lose the relationship between repository structure, task intent, local rules, and required checks.

Sending large Markdown files repeatedly uses context without making execution permissions or verification state explicit.

Approach

Treat repository context and task state as inspectable runtime records.

Use MCP tools and runtime/v1 JSON as the main agent interface, with a smaller CLI for setup, inspection, and CI.

Separate reading context from writing workflow state, running tests, and performing external actions.

Result

Published a reusable npm package with linked source code and an MCP interface for repository context, task state, and verification requirements.

Implementation

Repository indexing and context

  • Generated file indexes, symbol indexes, summaries, entry points, and task maps.
  • Exposed repository summaries, scoped context, file search, and symbol lookup through read-only MCP tools.
  • Applied payload budgets and stable sorting to keep responses compact and predictable.

Runtime contracts

  • Stored task, context, execution, and verification records in runtime/v1 JSON envelopes.
  • Added schema validation, scan freshness checks, and project consistency checks.
  • Built task prompts, checklists, and PR framing from structured records.

Execution boundaries and CLI

  • Added opt-in capability tiers for workflow writes, test execution, and external actions.
  • Used confirmation gates, scoped tokens, and recorded events for task approval and test execution.
  • Consolidated the CLI around init, scan, context, task, gate, check, and metrics, with regression coverage for contracts and outputs.

Lessons

  • Context records are useful only when their freshness and relationship to the current task are clear.
  • Read access and execution permission need separate contracts.
  • A small command surface with predictable output is easier to test and expose to coding agents.