npm mcp-diggerstdioMITupdated 3mo ago
Code context for AI coding agents. Progressive, on-demand access to your internal .NET / NuGet package source โ agents browse, search, and read private C# libraries autonomously, with zero workspace pollution.
What can you do with mcp digger?
mcp-digger
Code context for AI coding agents. Progressive, on-demand access to your internal .NET / NuGet package source โ agents browse, search, and read private C# libraries autonomously, with zero workspace pollution.
โ Scope: .NET / C# only. mcp-digger indexes NuGet-style repos containing
.csprojpackages and.cssource files. It is not a general-purpose source indexer โ other languages (TypeScript, Python, Java, Go, etc.) are out of scope.
โจ Why
Public NuGet packages have documentation ecosystems โ API references, tutorials, community Q&A. Tools like context7 serve that well.
Internal .NET packages often have source code as their primary documentation. mcp-digger turns that source into structured, searchable, token-efficient context that any MCP-compatible agent can consume โ bridging the documentation gap in private C# library ecosystems.
Without it:
- ๐ข Slow context gathering โ
git clone+find+grep+catchains burn tokens on infrastructure before useful context is retrieved. - ๐ No semantic search โ file system tools find text, not API surfaces. "Every type implementing this interface" means writing extraction scripts on demand.
- ๐ธ Token waste โ agents read whole files when a single method signature would do.
- ๐ฑ Permission click fatigue โ dozens of shell-command approvals per session.
- ๐งน Workspace noise โ referenced repos pollute file search, git status, and the agent's context window.
With it:
- โ Correct code on the first try โ real signatures, generic constraints, interface contracts, base class patterns.
- โก Self-service context โ point the agent at your NuGet repos once; it browses, searches, and reads autonomously.
- ๐ช Progressive disclosure โ 200-token overview before 5,000 tokens of source. Most questions resolve at L1 or L2.
- ๐งผ Zero workspace pollution โ managed clones live outside your project tree.
- ๐ Any Git host โ GitHub, GitLab, Azure DevOps, Bitbucket, self-hosted โ HTTPS or SSH.
๐ How it works
Ten purpose-built tools, escalating from broad to deep. The agent picks the cheapest tool that answers its question.
โโโ ๐ฆ dig_package_overview โโ
โ (docs, key types) โ
๐ฉบ dig_status โ ๐ dig_list โ ๐ dig_repo_overview โค โโโ ๐ dig_lookup โ ๐ dig_file
(health) (discover) (README + summaries) โ โ (symbol โ file) (full source)
โโโ ๐ dig_package_files โโโโโค
โ (file listing) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโ ๐ dig_signatures
(stripped API)
Operational: ๐ dig_refresh (force cache invalidation, on demand)
Bootstrap: ๐ฑ dig_init (only when no config exists)
๐งฐ Tools (10)
| Tier | Tool | What it does |
|---|---|---|
| Health | ๐ฉบ dig_status |
Config summary, connectivity check per repo, index health stats |
| Discovery | ๐ dig_list |
Lists configured repos + their packages with one-line .csproj summaries |
| L1 Overview | ๐ dig_repo_overview |
Repo README.md (filtered to architecture sections) + package count |
| L1 Overview | ๐ฆ dig_package_overview |
Package docs, key interfaces, abstract classes, file count |
| L1 Overview | ๐ dig_package_files |
.cs file listing for a package, with directory summary header |
| L2 Search | ๐ dig_lookup |
Indexed symbol search โ symbol, implements, or references mode. Cross-package supported. |
| L2 Search | ๐ dig_signatures |
Stripped C# public API surface filtered by keyword (no method bodies) |
| L3 Source | ๐ dig_file |
Full source of a single file (capped at 1 MB) |
| Operational | ๐ dig_refresh |
Force-rebuild caches for one or all repos |
| Bootstrap | ๐ฑ dig_init |
Creates starter .digger/config.json (registered only when no config is found) |
Search modes for dig_lookup:
| Mode | Finds |
|---|---|
symbol (default) |
Type/method declarations matching a name substring |
implements |
Classes/structs implementing an interface or extending a base class |
references |
Files referencing a given type name (word-boundary, case-sensitive) |
๐ Quick start
Install
npm install -g mcp-digger
# or run directly
npx mcp-digger
Requires Node.js 20+, git on PATH, and a .NET / C# source repo (NuGet packages with .csproj + .cs sources).
Minimal config
Create .digger/config.json in your workspace root:
{
"repos": [
{
"name": "my-libraries",
"url": "https://github.com/org/shared-libs.git",
"packageFilter": "MyCompany.*",
"auth": {
"strategy": "pat",
"PAT-EnvVarName": "GIT_PAT"
}
}
]
}
Don't have a config yet? Start the server, then call dig_init to scaffold one.
Agent setup
Add to .claude/settings.json or project settings:
{
"mcpServers": {
"digger": {
"command": "npx",
"args": ["-y", "mcp-digger"]
}
}
}
Add to ~/.codex/config.toml (or .codex/config.toml for project-scoped):
[mcp_servers.mcp-digger]
command = "npx"
args = ["-y", "mcp-digger"]
Add to claude_desktop_config.json:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"digger": {
"command": "npx",
"args": ["-y", "mcp-digger"]
}
}
}
Add to .vscode/mcp.json (workspace) or your user mcp.json:
{
"servers": {
"digger": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcp-digger"]
}
}
}
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"digger": {
"command": "npx",
"args": ["-y", "mcp-digger"]
}
}
}
Verify
Once connected, ask your agent to call dig_status โ it reports config validation, per-repo connectivity, and index health.
โ Configuration
Repos & packages
A repos[] entry has three ways to declare packages:
| Option | Behavior |
|---|---|
"packages": ["A", "B"] |
Explicit list โ these packages plus any local sibling project they pull in via <ProjectReference> (transitive, sibling-only). |
"packageFilter": "MyCompany.*" |
Wildcard โ narrows to packages matching the prefix, found via .sln/.slnx/Directory.Packages.props workspace scan. Follows transitive ProjectReference links automatically. |
| (omit both) | Auto-discover all non-test .csproj directories under sourceRoot (recursive โ nested layouts supported). |
sourceRoot defaults to "src" โ set it to whichever directory holds your package folders. The walk is recursive, so nested layouts like src/Group/Foo/Foo.csproj are picked up.
By default, managed clones use the repo's default branch. Pin to a specific one:
{
"repos": [
{
"name": "my-libraries",
"url": "https://github.com/org/shared-libs.git",
"branch": "develop"
}
]
}
The branch is used for both initial clone and subsequent fetches. Only applies to managed clones โ for local repos, you control the checked-out branch yourself.
Skip managed cloning when the repo is already on disk. The local path is read-only โ mcp-digger never fetches or modifies it.
{
"localRepos": {
"my-libraries": "C:/repos/shared-libs"
},
"repos": [
{
"name": "my-libraries",
"sourceRoot": "src"
}
]
}
| Strategy | Behavior |
|---|---|
auto (default) |
Try unauthenticated, fall back to PAT if set |
pat |
Always use PAT (fatal if not set) |
none |
Never authenticate |
PATs can be inline ("PAT": "...") or via environment variable indirection ("PAT-EnvVarName": "MY_TOKEN"). The .env file in your workspace root is loaded automatically โ values containing # should be quoted.
| Variable | Default | Purpose |
|---|---|---|
DIGGER_CONFIG |
.digger/config.json |
Override config file path |
MANAGED_SOURCE_DIR |
.digger/source |
Override managed clone directory |
CACHE_DIR |
.digger/cache |
Override cache directory |
Secrets (PAT values) belong in .env or the real environment โ never as env vars in this table.
๐ฉบ Diagnostics & recovery
| Symptom | First call | Then |
|---|---|---|
| Connection / auth issues | dig_status |
Reports auth attempts, exact error, actionable hints |
| "No matches" but you expect some | dig_refresh <repo> |
Force-rebuilds index, picks up new extraction logic |
| Server starts but no tools visible | dig_status |
If unconfigured, only dig_status + dig_init are registered |
| Need a config from scratch | dig_init |
Scaffolds .digger/config.json (atomic โ won't overwrite existing) |
Debug log
Enable debug logging in your config:
{ "debug": true, "repos": [...] }
Logs go to .digger/debug.log (capped at 5 MB, auto-truncated). Critical errors and crash output land in .digger/error.log.
๐ฌ Feedback
Tried mcp-digger on your codebase? Share what worked, what broke, what's missing in GitHub Discussions. Bug reports go in Issues.
๐ License
MIT License โ see LICENSE.
Install
Add mcp digger to your client. Pick the one you use.
claude mcp add mcp-digger -- npx -y mcp-diggercodex mcp add mcp-digger -- npx -y mcp-diggeramp mcp add mcp-digger -- npx -y mcp-digger{
"mcpServers": {
"mcp-digger": {
"command": "npx",
"args": [
"-y",
"mcp-digger"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mcp-digger": {
"command": "npx",
"args": [
"-y",
"mcp-digger"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"mcp-digger","command":"npx","args":["-y","mcp-digger"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"mcp-digger": {
"command": "npx",
"args": [
"-y",
"mcp-digger"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mcp-digger": {
"command": "npx",
"args": [
"-y",
"mcp-digger"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mcp-digger": {
"command": "npx",
"args": [
"-y",
"mcp-digger"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mcp-digger": {
"type": "local",
"command": "npx",
"args": [
"-y",
"mcp-digger"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mcp-digger": {
"command": {
"path": "npx",
"args": [
"-y",
"mcp-digger"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y mcp-diggerRun `goose configure`, choose **Add Extension โ Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance13/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 97 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint โ no local install
Version history
| Versions | Published |
|---|---|
| 1.1.3Latest | May 26, 2026 |
| 1.1.2 | May 25, 2026 |