Sign In

@shmindmaster/repocontext

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@shmindmaster/repocontext

Give coding agents fast, commit-pinned context across the repositories that matter.

Source
npmnpm
Version
0.2.4
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

RepoContext

Validate License: MIT Node.js Version MCP Protocol

Give coding agents commit-pinned answers from the repositories that matter.

RepoContext is an open-source MCP server for teams that want Claude Code, Codex, Cursor, and other MCP clients to navigate multiple repositories without guessing. It returns bounded, read-only evidence with repository paths, line numbers, and Git commit SHAs.

Agent question → RepoContext → commit-pinned docs and code evidence → answer you can verify

No database. No embeddings. No write tools. Git remains the source of truth.

Release status: @shmindmaster/repocontext is publicly available on npm. Clean npx installs are verified on Node 20, 22, and 24.

The repository also contains a static product site at shmindmaster.github.io/repocontext. Website analytics are optional, cookieless, and isolated to a dedicated RepoContext PostHog project; the CLI and MCP transports contain no telemetry.

Prerequisites

  • Node.js 20 or newer to run the published package
  • Node.js 22.13 or newer for source development (required by pnpm 11)
  • Git available on PATH
  • pnpm 11 for source development (corepack enable will provide the version declared by the project)

Install from source

git clone https://github.com/shmindmaster/repocontext.git
cd repocontext
corepack enable
pnpm install --frozen-lockfile
pnpm build

Create repocontext.repositories.yaml in a location readable by RepoContext:

repositories:
  - name: storefront
    path: ../storefront
    branches: [main]
  - name: api
    path: ../api
    branches: [main]

Paths are relative to the registry file. Each entry must be a Git repository root.

Configure an MCP client with the compiled stdio server and the registry path:

{
  "mcpServers": {
    "repocontext": {
      "command": "node",
      "args": ["/absolute/path/to/repocontext/dist/server.js"],
      "env": {
        "REPOCONTEXT_REGISTRY": "/absolute/path/to/repocontext.repositories.yaml"
      }
    }
  }
}

For the published package, replace the source-server command with npx and args: ["-y", "@shmindmaster/repocontext@latest"]. On Windows, use npx.cmd when required by the client. The server uses stdio and writes protocol messages only to stdout.

Verify the registry before connecting an agent:

node dist/server.js doctor

doctor reports each repository's HEAD, documentation count, exposure confidence, and ready, attention, or blocked status. A stale checkout needs review; an unavailable repository or an empty registry blocks safe use.

Generate a deterministic Context Brief for a technical or cross-functional review:

node dist/server.js brief --audience technical --repository storefront

The JSON result separates knownFacts, inferences, and gaps; cites every known fact with a source path, line, and full commit SHA; and includes an evidenceSetId that stays the same across audience presentations. Add --change-repository, --base, and --head for a bounded commit-range brief. See CI evidence-brief guidance.

Configuration

VariableRequiredPurpose
REPOCONTEXT_REGISTRYRecommendedExplicit registry YAML path; conventional workspace and home paths are also discovered
REPOCONTEXT_MCP_TOKENHTTP onlyBearer token required by /api/mcp
REPOCONTEXT_ALLOWED_HOSTSRecommended for HTTPComma-separated hostname allowlist; omit schemes and ports
REPOCONTEXT_INDEX_PATHSnapshot builds onlyOverride the generated snapshot directory
REPOCONTEXT_MCP_URLRemote verification onlyFull /api/mcp endpoint checked by pnpm verify:remote
POSTHOG_REPOCONTEXT_PROJECT_KEYWebsite build onlyOptional public PostHog project key; blank keeps analytics disabled
HOSTNoHTTP bind address; defaults to 0.0.0.0
PORTNoHTTP listening port; defaults to 3000

Use .env.example as a reference when configuring a shell, container, or hosting platform. RepoContext does not parse .env files itself; pass the values through the process environment and keep real tokens out of source control.

Registry paths may be relative to the registry file. See configuration guidance for the complete schema and safety behavior.

What agents get

ToolUseful evidence
wiki.catalogRepository doc counts, HEAD SHA, and stale-document signals
wiki.searchBounded documentation snippets with source path, line, and SHA
wiki.getOne commit-pinned documentation page
wiki.analyzeDocumentation gaps, coverage comparison, or a deterministic source-cited Context Brief
repo.inspectHEAD-pinned status, commits, manifests, tests, and recent changes
repo.readSafe source slice with line numbers and provenance
repo.searchBounded code matches with source path, line, snippet, and SHA
repo.compareChanged paths and commit count between two revisions

Every local read comes from HEAD; uncommitted and untracked content is excluded. When documentation changes locally, catalog results flag it as stale so agents do not mistake old committed evidence for current work.

Why this exists

Coding agents are powerful inside one checkout and unreliable across a real system. The useful answer is rarely “search everything”; it is a small, inspectable set of evidence:

  • Which service owns this behavior?
  • What does the architecture document actually say at the current revision?
  • Where is the implementation, and what changed between two commits?
  • Which repositories are missing the documentation an agent needs to work safely?

RepoContext is built for those questions.

Repository exposure policy

By default, RepoContext indexes supported documentation files (.md, .mdx, .rst, .adoc, .txt) committed anywhere in a registered repository. Add docs/wiki.yaml or .repocontext/wiki.yaml to narrow exposure:

collections:
  - id: public-context
    include:
      - README.md
      - docs/**/*.md
safety:
  deny:
    - docs/internal/**

Malformed policies fail closed. Sensitive paths—including environment files, credentials, keys, tokens, and secrets—are blocked before reads and omitted from remote snapshots. See the policy template.

Self-hosted HTTP

Stdio is the full-code transport. For a documentation-only HTTP deployment, build a HEAD-pinned snapshot and run the supplied container:

pnpm validate
pnpm index:build
docker build -f Dockerfile.remote -t repocontext:local .
docker run --rm -p 3000:3000 -e REPOCONTEXT_MCP_TOKEN="replace-with-a-strong-token" repocontext:local

The HTTP server exposes GET /healthz and bearer-authenticated POST /api/mcp. It contains committed documentation, selected manifests, and workflow metadata—not local source or working-tree changes. See deployment guidance.

What RepoContext is not

IsIs not
Deterministic Git-derived evidenceA vector database or opaque retrieval layer
A read-only MCP serverA repository writer, task runner, or deployment tool
A bounded search and context layerA replacement for code review or testing
A documentation coverage signalProof that documentation is correct

Known limitations

  • Local reads are pinned to the checked-out HEAD. Dirty and untracked work is intentionally excluded and may make doctor report attention.
  • The HTTP transport serves a generated documentation and manifest snapshot, not repository source code or Git history.
  • Search is deterministic text matching, not semantic or embedding-based retrieval.
  • User registries containing local filesystem paths are excluded from the npm package and remote image. Snapshot builds generate a separate registry containing only image-local paths.
  • Client configuration schemas are verified from current official documentation; native-client activation remains a local client check.

Development

pnpm install --frozen-lockfile
pnpm validate
pnpm build
pnpm mcp:serve
CommandPurpose
pnpm lintRun Biome static lint rules
pnpm format:checkVerify formatting without changing files
pnpm formatFormat source and configuration files
pnpm typecheckRun strict TypeScript checks
pnpm testRun the Vitest suite
pnpm validateRun lint, formatting, types, client/environment/release validation, unit tests, and the site build
pnpm buildCompile the distributable JavaScript
pnpm verify:packagePack, install, run doctor, and request a first MCP answer in an isolated fixture
pnpm verify:containerBuild a fresh docs-only image, verify its authenticated HTTP contract, then remove the disposable container and image
pnpm verify:clientsParse and validate the four documented client configuration blocks
pnpm verify:envValidate the complete, secret-free environment template
pnpm index:buildGenerate the commit-pinned HTTP snapshot
pnpm verify:remoteVerify a configured remote MCP endpoint
pnpm site:serveRun the static product site locally
pnpm site:testRun Chromium, Firefox, WebKit, and mobile browser regression tests
pnpm site:buildBuild the deployable site, with analytics disabled unless configured

Maintainers prepare a release with pnpm install --frozen-lockfile, pnpm validate, pnpm build, pnpm verify:package, and npm pack --dry-run --json. A tag-triggered OIDC workflow is included; npm package ownership and the release.yml trusted-publisher relationship must be configured before the first tag is pushed.

For help, use GitHub issues. See client setup, website and analytics, CONTRIBUTING.md, SECURITY.md, ROADMAP.md, and CHANGELOG.md.

License

MIT

Keywords

mcp

FAQs

Package last updated on 29 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts