mcp-digger

io.github.janeksm由 GitHub 账号 janeksm 发布v1.1.3更新于 Oct 24, 2026

Progressive on-demand access to .NET NuGet package source for AI coding agents.

发布方自己的服务:digger.fans

概览

AI 生成的概览

让 AI 编程助手浏览、搜索并阅读已配置 Git 仓库中的私有 .NET / NuGet C# 包源码。

可以做什么
mcp-digger 会为包含 .csproj 包和 .cs 源码的 NuGet 风格仓库建立索引,并提供十个由浅入深的工具。助手可以检查健康状态与连通性(dig_status)、列出仓库与包(dig_list)、阅读仓库与包概览(dig_repo_overview、dig_package_overview、dig_package_files)、按名称、接口实现或引用搜索已索引符号(dig_lookup)、读取剥离方法体的公共 API 签名(dig_signatures),以及获取单个文件的完整源码(dig_file)。运维类工具可重建缓存(dig_refresh)并生成初始配置(dig_init)。
适用场景
当助手需要准确了解内部或私有 C# 库、而这些库以源码作为主要文档时适用,可让它自主收集上下文,而不必执行 clone、find、grep、cat 等命令链。该服务器仅面向 .NET / C#,其他语言不在范围内。
运行要求
通过 npx 或全局 npm 安装以 stdio 在本地运行;需要 Node.js 20+ 以及 PATH 中的 git。需要一个包含 .csproj 与 .cs 文件的 .NET / C# 源码仓库,以及列出仓库的 .digger/config.json。私有仓库可能需要个人访问令牌,可内联填写或通过配置中指定的环境变量提供;工作区根目录的 .env 文件会自动加载。可选环境变量可覆盖配置路径、托管克隆目录和缓存目录。
安装前请注意
配置中可能保存个人访问令牌,可内联填写或通过环境变量名(如 GIT_PAT)引用;此类机密应放在 .env 或真实环境中,而非配置文件中。托管克隆会拉取到项目目录树之外的目录,dig_refresh 会重建缓存。本地仓库声明为只读,不会被拉取或修改。调试与错误日志写入 .digger 目录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 mcp-digger,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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 .csproj packages and .cs source 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 + cat chains 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)

TierToolWhat it does
Health🩺 dig_statusConfig summary, connectivity check per repo, index health stats
Discovery📋 dig_listLists configured repos + their packages with one-line .csproj summaries
L1 Overview📖 dig_repo_overviewRepo README.md (filtered to architecture sections) + package count
L1 Overview📦 dig_package_overviewPackage 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_lookupIndexed symbol search — symbol, implements, or references mode. Cross-package supported.
L2 Search📝 dig_signaturesStripped C# public API surface filtered by keyword (no method bodies)
L3 Source📄 dig_fileFull source of a single file (capped at 1 MB)
Operational🔄 dig_refreshForce-rebuild caches for one or all repos
Bootstrap🌱 dig_initCreates starter .digger/config.json (registered only when no config is found)

Search modes for dig_lookup:

ModeFinds
symbol (default)Type/method declarations matching a name substring
implementsClasses/structs implementing an interface or extending a base class
referencesFiles referencing a given type name (word-boundary, case-sensitive)

🚀 Quick start

Install

bash
npm install -g mcp-digger# or run directlynpx 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:

jsonc
{  "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

Claude Code

Add to .claude/settings.json or project settings:

json
{  "mcpServers": {    "digger": {      "command": "npx",      "args": ["-y", "mcp-digger"]    }  }}
Codex CLI

Add to ~/.codex/config.toml (or .codex/config.toml for project-scoped):

toml
[mcp_servers.mcp-digger]command = "npx"args = ["-y", "mcp-digger"]
Claude Desktop

Add to claude_desktop_config.json:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
json
{  "mcpServers": {    "digger": {      "command": "npx",      "args": ["-y", "mcp-digger"]    }  }}
VS Code

Add to .vscode/mcp.json (workspace) or your user mcp.json:

json
{  "servers": {    "digger": {      "type": "stdio",      "command": "npx",      "args": ["-y", "mcp-digger"]    }  }}
Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

json
{  "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:

OptionBehavior
"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.

Branch tracking

By default, managed clones use the repo's default branch. Pin to a specific one:

jsonc
{  "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.

Local repos (Mode B)

Skip managed cloning when the repo is already on disk. The local path is read-only — mcp-digger never fetches or modifies it.

jsonc
{  "localRepos": {    "my-libraries": "C:/repos/shared-libs"  },  "repos": [    {      "name": "my-libraries",      "sourceRoot": "src"    }  ]}
Auth strategies
StrategyBehavior
auto (default)Try unauthenticated, fall back to PAT if set
patAlways use PAT (fatal if not set)
noneNever 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.

Environment variables
VariableDefaultPurpose
DIGGER_CONFIG.digger/config.jsonOverride config file path
MANAGED_SOURCE_DIR.digger/sourceOverride managed clone directory
CACHE_DIR.digger/cacheOverride cache directory

Secrets (PAT values) belong in .env or the real environment — never as env vars in this table.


🩺 Diagnostics & recovery

SymptomFirst callThen
Connection / auth issuesdig_statusReports auth attempts, exact error, actionable hints
"No matches" but you expect somedig_refresh <repo>Force-rebuilds index, picks up new extraction logic
Server starts but no tools visibledig_statusIf unconfigured, only dig_status + dig_init are registered
Need a config from scratchdig_initScaffolds .digger/config.json (atomic — won't overwrite existing)

Debug log

Enable debug logging in your config:

jsonc
{ "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.

来源:README.md,提交 ee966a2

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Digger 集成