# AI use cases for Repo Context MCP (nduc99911/repo-context-mcp)

Repo: [nduc99911/repo-context-mcp](https://github.com/nduc99911/repo-context-mcp) | Use cases: 3 | Page: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/

repo-context-mcp is a local MCP server and CLI that gives AI coding agents a repository map, fast code search and token-budgeted context packs instead of dumping whole repos into prompts.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Give your coding agent a repo map and code search: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/give-agent-repo-map-and-search/
- Build a token-budgeted context pack for a prompt: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/build-token-budgeted-context-pack/
- Generate repo maps as JSON for CI and scripts: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/repo-map-json-for-ci/

## How to give your coding agent a repo map and code search with Repo Context MCP

Repo: [nduc99911/repo-context-mcp](https://github.com/nduc99911/repo-context-mcp) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Add the MCP server so the agent can map the repo, search code and pack context without walking node_modules.

**Who it is for:** A developer whose agent wastes tokens re-reading irrelevant files in a monorepo.

**The problem:** Agents miss entrypoints and paste random files into context.

**The outcome:** Three focused tools: repo_map, search_code and pack_context.

### Steps

1. Install Node.js 18+
2. Add a server with command npx, args -y Repo Context MCP, and REPO_CONTEXT_ROOT set to your repo
3. Restart your MCP client
4. Ask the agent to call repo_map before editing

### Prompt to paste into your agent

```text
With repo-context-mcp configured for <repo>, call repo_map, then search_code for <symbol>, and list the path:line hits. Confirm node_modules was not included.
```

### Caveat

It uses stdio transport, so each client starts its own local server process.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/give-agent-repo-map-and-search/

## How to build a token-budgeted context pack for a prompt with Repo Context MCP

Repo: [nduc99911/repo-context-mcp](https://github.com/nduc99911/repo-context-mcp) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Use the CLI to pack the files about one area into Markdown under a token limit.

**Who it is for:** A developer pasting code into a chat model with a limited context window.

**The problem:** Choosing files by hand either overflows the window or misses key code.

**The outcome:** A Markdown pack focused on the areas you name, within your token budget.

### Steps

1. Clone and build with `npm install` and `npm run build`
2. Run `node dist/cli.js pack . --focus auth,api --max-tokens 8000`
3. Paste the pack into your prompt
4. Use --json for scripts

### Prompt to paste into your agent

```text
Run `node dist/cli.js pack . --focus <area> --max-tokens 8000` from repo-context-mcp on <repo> and report which files were included. Verify the pack stays under the token budget.
```

### Caveat

search_code is substring search, not semantic search.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/build-token-budgeted-context-pack/

## How to generate repo maps as JSON for CI and scripts with Repo Context MCP

Repo: [nduc99911/repo-context-mcp](https://github.com/nduc99911/repo-context-mcp) | Difficulty: Intermediate | Time: 15 minutes | Basis: From the README

Generate a repository map and a token-budgeted context pack as JSON so CI jobs and scripts can feed agents the right files.

**Who it is for:** A DevOps engineer building an AI review step in CI that should not paste the whole repo into a prompt.

**The problem:** Dumping a full repo into an LLM blows the token budget and buries the relevant code.

**The outcome:** map.json and pack.json your pipeline can pass to a model, focused on the folders that matter.

### Steps

1. Run `git clone https://github.com/nduc99911/repo-context-mcp.git`, `cd repo-context-mcp`, `npm install` and `npm run build`
2. Run `node dist/cli.js map . --json` from your project root and save the output as map.json
3. Run `node dist/cli.js pack . --focus src --json` for a focused pack and save it as pack.json
4. Cap size with `node dist/cli.js pack . --focus auth,api --max-tokens 8000`
5. Feed the JSON to your review script in CI

### Prompt to paste into your agent

```text
In CI, run repo-context-mcp's `map . --json` and `pack . --focus <dirs> --max-tokens <n>`, then review only the packed files for <goal>. Report the token count and list any changed file the pack left out.
```

### Caveat

The npx package is marked as after publish in the README, so build from source in CI until it is on npm.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/nduc99911-repo-context-mcp/repo-map-json-for-ci/
