@cocaxcode/ai-context-inspector
One command. Every AI config in your project. Instantly.
CLI + MCP server · 19 tools detected · Export/Import across 7 targets
Quick Start ·
MCP Server ·
What It Detects ·
Features ·
Tool Reference ·
Architecture
可用的最全面的AI生态系统扫描仪。AI上下文检查器可以在19个工具中发现项目中的每个AI配置文件、MCP服务器、自定义技能、代理和持久内存,并在几秒钟内为您提供全貌。导出整个AI设置,并将其导入到7个支持的工具(Claude、Cursor、Windsurf、Copilot、Gemini、Codex、OpenCode)中的任何一个,并自动进行秘密编辑。零配置。除了MCP SDK和Zod之外,零运行时依赖性。 一切都在本地运行——你的配置和凭据永远不会离开你的机器。
快速开始```bash
npx -y @cocaxcode/ai-context-inspector@latest
就是这样。一个HTML仪表板打开,其中包含你的AI工具所知道的关于你的项目的一切。```bash
# Scan a specific directory
npx -y @cocaxcode/ai-context-inspector@latest --dir /path/to/project
# Include user-level configs (~/.claude, ~/.gemini, etc.)
npx -y @cocaxcode/ai-context-inspector@latest --user
# Live-connect to each MCP server and list its tools
npx -y @cocaxcode/ai-context-inspector@latest --introspect
# Output raw JSON instead of HTML
npx -y @cocaxcode/ai-context-inspector@latest --json
All CLI flags
| 标志 | 描述 | 默认值 |
|---|---|---|
--dir |
要扫描的目录 | . (当前) |
--user |
包括用户级别配置(~/) |
false |
--introspect |
连接到MCP服务器并列出工具 | false |
--timeout |
每台服务器的自检超时 | 10000 |
--json |
输出JSON而不是HTML | false |
--mcp |
作为MCP服务器运行(stdio传输) | false |
MCP服务器设置
作为MCP服务器运行,这样你的AI工具就可以检查自己的生态系统。
克劳德代码```bash
claude mcp add --scope user ai-context-inspector -- npx -y @cocaxcode/ai-context-inspector@latest --mcp
### 克劳德桌面
添加 `claude_desktop_config.json`:```json
{
"mcpServers": {
"ai-context-inspector": {
"command": "npx",
"args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
}
}
}
Cursor / Windsurf / VS Code / Codex CLI
光标/风帆 --添加到 .cursor/mcp.json 或同等产品:```json
{
"mcpServers": {
"ai-context-inspector": {
"command": "npx",
"args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
}
}
}
**VS代码** --添加到 `.vscode/mcp.json`:```json
{
"servers": {
"ai-context-inspector": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
}
}
}
Codex CLI:```bash
codex mcp add ai-context-inspector -- npx -y @cocaxcode/ai-context-inspector@latest --mcp
或直接添加到任何 `.mcp.json`:```json
{
"mcpServers": {
"ai-context-inspector": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
}
}
}
它检测到什么
| 工具 | 上下文文件 | 找到了什么 |
|---|---|---|
| 克劳德代码 | CLAUDE.md, .claude/, .mcp.json |
指令、MCP配置、技能、代理、内存 |
| 光标 | .cursorrules, .cursor/rules/, .cursorignore |
规则,忽略模式 |
| 帆板运动 | .windsurfrules, .windsurf/rules/ |
Codeium/风帆规则 |
| GitHub Copilot | .github/copilot-instructions.md, .github/agents/ |
说明、定制代理 |
| 双子星命令行工具 | GEMINI.md, .gemini/, .geminiignore |
配置、规则 |
| OpenAI 代码专家 | AGENTS.md, AGENT.md, .codex/ |
代理商说明 |
| 开源代码 | OPENCODE.md, .opencode/, opencode.json |
CLI配置 |
| 教唆者 | .aider.conf.yml, .aiderignore |
配置、模型设置 |
| 克莱恩 | .clinerules, .clineignore |
规则(文件或目录) |
| Roo代码 | .roo/rules/, .roorules, .rooignore |
规则 |
| Continue.dev | .continuerules, .continue/config.yaml |
规则、配置 |
| 亚马逊Q | .amazonq/rules/ |
开发者规则 |
| 增强 | .augment/rules/, .augment-guidelines |
代码规则 |
| 回复 | .replit.md |
代理商说明 |
| Firebase工作室 | .idx/airules.md |
AI规则 |
| VS代码 | .vscode/mcp.json |
MCP配置 |
| 塔布宁 | .tabnine.yaml |
AI配置 |
| 源代码图 | .sourcegraph/ |
科迪配置 |
| 通用 | CONVENTIONS.md |
多工具惯例 |
> 提示: 通过 --user 还要扫描用户级别配置: ~/.claude/, ~/.gemini/, ~/.codex/, ~/.continue/, ~/.aider.conf.yml, ~/.augment/, ~/.github/agents/, ~/.codeium/, ~/.opencode/, ~/.tabnine/.
除了上下文文件,扫描仪还检测:
- MCP服务器 从
.mcp.json,~/.claude.json,.vscode/mcp.json,Claude Desktop配置——具有可选的实时自检功能 - 定制技能 在
.claude/skills/(包括来自的符号链接npx skills add) - 自定义代理 在
.claude/agents/具有内存检测功能 - 持久记忆 --克劳德内存、代理内存、engram、OpenSpec、ATL
特性
扫描```bash
npx -y @cocaxcode/ai-context-inspector@latest
npx -y @cocaxcode/ai-context-inspector@latest --user --introspect
生成一个包含暗/亮模式、搜索、可折叠部分、文件预览和颜色编码工具徽章的独立HTML仪表板。通过 `--json` 对于原始产量。
### 出口```bash
# Export your AI ecosystem to .aci/bundle.json
npx -y @cocaxcode/ai-context-inspector@latest export
# Export only MCP and context configs, redact secrets
npx -y @cocaxcode/ai-context-inspector@latest export --only mcp,context --secrets none
Export flags
| 标志 | 描述 | 默认值 |
|---|---|---|
--dir |
要导出的目录 | . |
--output |
输出目录 | .aci/ |
--include-user |
包括用户级别配置 | false |
--only |
筛选器: mcp,skills,agents,memories,context |
全部 |
--secrets |
none (修订)或 all (包括) |
互动 |
导入```bash
Import into a Cursor project
npx -y @cocaxcode/ai-context-inspector@latest import --target cursor
Auto-detect tool, skip confirmation, overwrite existing
npx -y @cocaxcode/ai-context-inspector@latest import --yes --force
Import flags
|标志|描述|默认值|
|------|-------------|---------|
| `[file]` |JSON捆绑包路径|自动检测 `.aci/bundle.json` |
| `--dir ` |目标目录| `.` |
| `--target ` |目标工具(见表)|自动检测|
| `--scope ` | `project` 或 `user` |按资源|
| `--force` |覆盖现有资源| `false` |
| `--yes` |跳过确认提示| `false` |
| `--only ` |筛选器: `mcp,skills,agents,memories,context` |全部|
| `--secrets ` | `none` 或 `all` |交互式|
### 支持的导入目标
|目标|MCP配置|上下文文件|规则目录|技能|代理|
|--------|-----------|-------------|-----------|--------|--------|
| `claude` | `.mcp.json` | `CLAUDE.md` | -- | `.claude/skills/` | `.claude/agents/` |
| `cursor` | `.cursor/mcp.json` | `.cursorrules` | `.cursor/rules/` | -- | -- |
| `windsurf` | `.mcp.json` | `.windsurfrules` | `.windsurf/rules/` | -- | -- |
| `copilot` | `.vscode/mcp.json` | `.github/copilot-instructions.md` | `.github/instructions/` | -- | `.github/agents/` |
| `gemini` | `.gemini/settings.json` | `GEMINI.md` | `.gemini/rules/` | -- | -- |
| `codex` | `.mcp.json` | `AGENTS.md` | `.codex/rules/` | -- | -- |
| `opencode` | `opencode.json` | `OPENCODE.md` | `.opencode/rules/` | -- | -- |
> **注:** 秘密处理有三种模式: **无** (全部编辑——安全共享), **全部** (按原样包括),或 **交互式** (每个变量提示,CLI默认值)。MCP配置中的环境变量会自动检测。
______________________________________________________________________
## MCP工具参考
作为MCP服务器运行时(`--mcp`),暴露了五种工具:
### `scan`
在项目目录中发现完整的AI生态系统。
|参数|类型|必填|说明|
|-----------|------|----------|-------------|
| `directory` |string |否|扫描路径(默认:cwd)|
| `include_user` |boolean |否|包括用户级配置|
| `introspect` |boolean |否|实时连接到MCP服务器|
| `timeout` |number |否|自检超时(ms)|
### `introspect_mcp`
连接到特定的MCP服务器并列出其工具、资源和提示。
|参数|类型|必填|说明|
|-----------|------|----------|-------------|
| `command` |string | Yes\*|启动服务器的命令|
| `args` |string\[\]|否|命令的参数|
| `env` |object |否|环境变量|
| `url` |string |是\*|HTTP/SSE服务器的URL|
| `transport` |string |否| `stdio` (默认)或 `http` |
| `timeout` |number |否|连接超时(毫秒)|
\*要么 `command` (stdio)或 `url` (http)是必需的。
### `generate_report`
根据扫描结果生成独立的HTML仪表板。
|参数|类型|必填|说明|
|-----------|------|----------|-------------|
| `directory` |string |否|扫描路径|
| `include_user` |boolean |否|包括用户级配置|
| `introspect` |boolean |否|内省MCP服务器|
| `timeout` |number |否|自检超时(ms)|
### `export_ecosystem`
将完整的AI生态系统导出到便携式 `.aci/bundle.json`.
|参数|类型|必填|说明|
|-----------|------|----------|-------------|
| `dir` |string |否|要扫描的目录(默认:cwd)|
| `include_user` |boolean |否|包括用户级配置|
| `only` |string\[\]|否|类别: `mcp`, `skills`, `agents`, `memories`, `context` |
| `secrets` |string |否| `"none"` (默认), `"all"`,或 `["VAR1", "VAR2"]` |
### `import_ecosystem`
将捆绑包导入项目,使配置适应目标工具。
|参数|类型|必填|说明|
|-----------|------|----------|-------------|
| `file` |string |否|捆绑包路径(自动检测 `.aci/bundle.json`) |
| `dir` |string |否|目标目录(默认:cwd)|
| `target` |string |否|目标工具(自动检测): `claude`, `cursor`, `windsurf`, `copilot`, `gemini`, `codex`, `opencode` |
| `scope` |string |否| `project` 或 `user` |
| `force` |boolean |否|覆盖现有资源|
| `confirm` |boolean |否|执行导入(默认值: `false` =干运行)|
| `only` |string\[\]|否|要导入的类别|
| `secrets` |string |否| `"none"`, `"all"`, `["VAR1"]`,或 `{"VAR1": "value"}` |
> **警告:** `import_ecosystem` 默认为干运行模式(`confirm: false`).集 `confirm: true` 实际写入文件。
______________________________________________________________________
## 建筑```
src/
├── index.ts # Entry: CLI vs MCP mode routing
├── cli.ts # CLI arg parsing + orchestration
├── server.ts # createServer() MCP factory
├── scanner/ # 6 parallel scanners (Promise.all)
│ ├── catalog.ts # AI_FILE_CATALOG — 50+ entries, 19 tools
│ ├── context-files.ts # Scan .md, rules, configs
│ ├── mcp-configs.ts # Parse .mcp.json, ~/.claude.json, etc.
│ ├── mcp-introspect.ts # Connect to servers, list tools/resources
│ ├── skills.ts # Skills + symlinks + frontmatter
│ ├── agents.ts # Agents + memory detection
│ └── memories.ts # engram, openspec, .atl, claude memory
├── ecosystem/ # Export/import engine
│ ├── export.ts # Scan → bundle → .aci/bundle.json
│ ├── import.ts # Load → plan → execute
│ ├── target-map.ts # Path configs for 7 AI tools
│ ├── detect-target.ts # Auto-detect tool in project
│ └── secrets.ts # Env var detection + redaction
├── report/ # HTML dashboard generator
│ ├── generator.ts # generateHtml(ScanResult) → string
│ ├── sections.ts # Section renderers
│ ├── styles.ts # CSS (dark/light)
│ └── scripts.ts # JS (collapse, search, preview)
└── tools/ # 5 MCP tool handlers
├── scan.ts
├── introspect.ts
├── report.ts
├── export.ts
└── import.ts
堆栈: TypeScript 5(严格版,ESM)/MCP SDK/Zod/tsup/Vitest
麻省理工学院 ·建造于 可卡因
