Ghosthunt

io.github.78degrees由 GitHub 账号 78degrees 发布v1.0.0更新于 Oct 24, 2026

Find every leaked secret on your machine — API keys in .env files, shell history, and configs.

已验证STDIO仅桌面文件与存储安全与监控

概览

AI 生成的概览

扫描本机,查找散落在 .env 文件、shell 历史和开发配置中的泄露 API 密钥、令牌和凭据。

可以做什么
Ghosthunt 是一个本地 MCP 服务器,用于在开发机器上搜索暴露的密钥。scan_secrets 工具返回详细结果,包括文件路径、行号、严重级别和修复建议;scan_summary 返回 0-100 的健康评分以及按严重级别统计的数量。它会检查环境文件、AWS 凭据、SSH 密钥、Docker 配置、npm 与 PyPI 令牌、GitHub CLI 令牌、shell 历史、Kubernetes 配置、netrc 以及 35 种以上的密钥模式。
适用场景
适合在轮换密钥、清理 shell 历史或确认 .env 文件未暴露之前,让助手审计自己的机器。定期运行一次摘要扫描也可作为安全卫生检查。
运行要求
通过 stdio 在本地运行,通常使用 npx ghosthunt 或写入 Claude Desktop 配置。清单声明需要一个名为 YOUR_API_KEY 的必需密钥环境变量,但 README 称扫描完全在本地离线进行。仅支持桌面端,不能在网页中运行。
安装前请注意
扫描会读取本机敏感文件,包括 SSH 私钥、云凭据和 shell 历史,结果会进入助手对话,可能包含密钥值或片段。清单要求名为 YOUR_API_KEY 的环境变量,这与 README 所称数据不离开本机相矛盾,安装前应弄清该密钥的用途。扫描为只读,不会写入或删除数据。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

GhostHunt

Find every leaked secret on your machine.

GhostHunt is an MCP server that scans your development machine for API keys, tokens, and credentials hiding in places you forgot to check: .env files scattered across projects, shell history, AWS/SSH/Docker configs, and more.

Everything runs locally. No data leaves your machine.

What It Scans

  • Environment files — recursively finds every .env, .env.local, .env.production, etc. under your home directory
  • AWS credentials — ~/.aws/credentials and session tokens
  • SSH keys — unprotected private keys in ~/.ssh/
  • Docker config — registry auth tokens in ~/.docker/config.json
  • npm/PyPI tokens — ~/.npmrc, ~/.pypirc auth tokens
  • GitHub CLI — OAuth tokens in ~/.config/gh/hosts.yml
  • Shell history — API keys pasted into bash, zsh, or fish commands
  • Kubernetes — ~/.kube/config credentials
  • Netrc — ~/.netrc passwords
  • 35+ secret patterns — AWS, Stripe, GitHub, OpenAI, Anthropic, Google, Slack, Twilio, SendGrid, database connection strings, private keys, and more

Install

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{  "mcpServers": {    "ghosthunt": {      "command": "npx",      "args": ["-y", "ghosthunt"]    }  }}

Restart Claude Desktop. Then ask Claude: "Scan my machine for leaked secrets"

Direct Usage

bash
npx ghosthunt

Tools

scan_secrets

Full detailed scan. Returns every finding with file paths, line numbers, severity ratings, and remediation steps.

Example prompt: "Run a full GhostHunt scan and show me everything"

scan_summary

Quick health check. Returns your health score (0-100) and a count by severity. Run this first to see if you have a problem.

Example prompt: "Give me a quick GhostHunt health check"

Example Output

# GhostHunt Scan Report
**Health Score: 37/100** (Critical)
- Secrets found: **12**- Critical: 3 | High: 5 | Medium: 2 | Low: 2- Locations scanned: 47- Scan time: 142ms
## Environment Files (.env)
- **[CRITICAL]** Stripe Live Secret Key  - File: `/Users/you/project-a/.env:4`  - Context: `STRIPE_SECRET_KEY`  - Value: `sk_l****_8xQ`
- **[CRITICAL]** OpenAI API Key  - File: `/Users/you/side-project/.env.local:12`  - Context: `OPENAI_API_KEY`  - Value: `sk-p****kFJ9`
## Shell History
- **[HIGH]** Bearer Token in Header  - File: `/Users/you/.zsh_history:8847`  - Context: `curl -H "Authorization: Bearer sk_live_...`  - Value: `sk_l****_m3K`
## Recommendations
1. **Rotate critical secrets immediately.** Any API key marked CRITICAL   should be revoked and regenerated from the provider's dashboard.2. **Clear your shell history** of sensitive commands.3. **Audit your .env files.** Ensure they are in .gitignore.

Health Score

Your score starts at 100 and drops based on what GhostHunt finds:

FindingPenalty
Critical secret-15
High severity-8
Medium severity-3
Low severity-1

A score below 50 means you have secrets that need immediate attention.

Privacy

GhostHunt runs entirely on your local machine. It does not:

  • Send any data to any server
  • Phone home or track usage
  • Store scan results anywhere
  • Access the internet

Your secrets stay on your machine. The scan results stay in your Claude conversation.

License

MIT

来源:README.md,提交 fde95aa

工具

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

版本历史

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

评分

已满足适用检查项的 40%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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

    请在仓库或注册中心条目中声明许可证。