MCP Hub
Back to servers

ai-context-inspector

Scan, export, and import your AI ecosystem. Discover MCP servers, skills, and memories.

Registrynpm477/wk
Stars
1
Updated
Mar 16, 2026

Quick Install

npx -y @cocaxcode/ai-context-inspector

@cocaxcode/ai-context-inspector

See everything your AI tools know about your project.
19 AI tools · 6 scanners · 5 MCP tools · Export/Import across 7 tools · CLI + MCP server

npm version npm downloads License Node 19 AI tools 104 tests

The Problem · The Solution · Installation · CLI Usage · Export/Import · MCP Server · What It Detects · HTML Dashboard · Architecture


The Problem

Your project has AI configuration scattered everywhere:

  • CLAUDE.md with project instructions, .cursorrules with coding rules, AGENTS.md with universal guidelines
  • MCP servers configured in .mcp.json, ~/.claude.json, .vscode/mcp.json — each with different tools
  • Custom skills installed via npx skills add, custom agents in ~/.claude/agents/
  • Persistent memories in engram, Claude memory files, agent-specific memory stores
  • You don't know the full picture. Each tool sees only its own slice.

The Solution

AI Context Inspector scans your entire AI ecosystem in one shot:

npx @cocaxcode/ai-context-inspector

It discovers every AI configuration file, MCP server (with live introspection), installed skill, custom agent, and persistent memory — then generates a beautiful HTML dashboard or exposes the data as an MCP server for your AI tools to consume.

Zero config. Zero dependencies. Just run it.


Installation

CLI (one-shot, no install)

npx @cocaxcode/ai-context-inspector

Claude Code (MCP server)

claude mcp add ai-context-inspector -- npx -y @cocaxcode/ai-context-inspector@latest --mcp

Or add to your .mcp.json:

{
  "mcpServers": {
    "ai-context-inspector": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "ai-context-inspector": {
      "command": "npx",
      "args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
    }
  }
}

Cursor / Windsurf

Add to .cursor/mcp.json or equivalent:

{
  "mcpServers": {
    "ai-context-inspector": {
      "command": "npx",
      "args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
    }
  }
}

Codex CLI

codex mcp add ai-context-inspector -- npx -y @cocaxcode/ai-context-inspector@latest --mcp

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "ai-context-inspector": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cocaxcode/ai-context-inspector@latest", "--mcp"]
    }
  }
}

CLI Usage

# Scan current directory → generates HTML report
npx @cocaxcode/ai-context-inspector

# Scan a specific directory
npx @cocaxcode/ai-context-inspector --dir /path/to/project

# Include user-level configs (~/.claude, ~/.gemini, etc.)
npx @cocaxcode/ai-context-inspector --user

# Enable live MCP server introspection (connects to each server)
npx @cocaxcode/ai-context-inspector --introspect

# Set introspection timeout (default: 10000ms)
npx @cocaxcode/ai-context-inspector --introspect --timeout 15000

# Output raw JSON instead of HTML
npx @cocaxcode/ai-context-inspector --json

# Run as MCP server (for AI tool integration)
npx @cocaxcode/ai-context-inspector --mcp

# All flags combined
npx @cocaxcode/ai-context-inspector --dir ./my-project --user --introspect --timeout 15000

CLI Flags Reference

FlagDescriptionDefault
--dir <path>Directory to scan. (current)
--userInclude user-level configs (~/)false
--introspectConnect to MCP servers and list toolsfalse
--timeout <ms>Introspection timeout per server10000
--jsonOutput JSON instead of HTMLfalse
--mcpRun as MCP server (stdio transport)false

Export/Import

Move your AI configuration between tools. Export from one project, import into another — or the same project with a different AI tool.

Quick Start

# Export your AI ecosystem to .aci/bundle.json
npx @cocaxcode/ai-context-inspector export

# Import into a project using Cursor
npx @cocaxcode/ai-context-inspector import --target cursor

# Non-interactive export (all categories, no secrets)
npx @cocaxcode/ai-context-inspector export --only mcp,context --secrets none

# Non-interactive import (auto-detect tool, skip confirmation)
npx @cocaxcode/ai-context-inspector import --yes --force

Export Flags

FlagDescriptionDefault
--dir <path>Directory to export. (current)
--output <path>Output directory.aci/
--include-userInclude user-level configs (~/)false
--only <categories>Filter: mcp,skills,agents,memories,contextall
--secrets <mode>none (redact all) or all (include all)interactive

Import Flags

FlagDescriptionDefault
[file]Path to bundle JSONauto-detect .aci/bundle.json
--dir <path>Target directory. (current)
--target <tool>Target tool (see table below)auto-detect
--scope <scope>project or userper-resource
--forceOverwrite existing resourcesfalse
--yesSkip confirmation promptfalse
--only <categories>Filter: mcp,skills,agents,memories,contextall
--secrets <mode>none or allinteractive

Supported Target Tools

TargetMCP ConfigContext FileRules DirSkillsAgents
claude.mcp.jsonCLAUDE.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.jsonGEMINI.md.gemini/rules/
codex.mcp.jsonAGENTS.md.codex/rules/
opencodeopencode.jsonOPENCODE.md.opencode/rules/

The .aci/ Directory

Export creates .aci/bundle.json — a self-contained, checksummed JSON bundle with all your AI resources. It is automatically added to .gitignore. Import auto-detects this directory when no file path is specified.

Secrets Handling

Environment variables in MCP server configs (API keys, tokens, passwords) are detected automatically. Three modes:

  • none — redact all sensitive values (safe for sharing)
  • all — include all values as-is
  • interactive (default in CLI) — prompt per variable

MCP Server

When running as an MCP server (--mcp), five tools are exposed:

scan

Scan a project directory to discover its complete AI ecosystem.

Parameters:

ParameterTypeRequiredDescription
directorystringNoPath to scan (default: cwd)
include_userbooleanNoInclude user-level configs
introspectbooleanNoLive-connect to MCP servers
timeoutnumberNoIntrospection timeout (ms)

Example prompt: "Scan this project and tell me what AI tools are configured"

introspect_mcp

Connect to a specific MCP server and list its tools, resources, and prompts.

Parameters:

ParameterTypeRequiredDescription
commandstringYes*Command to launch the server
argsstring[]NoArguments for the command
envobjectNoEnvironment variables
urlstringYes*URL for HTTP/SSE servers
transportstringNostdio (default) or http
timeoutnumberNoConnection timeout (ms)

*Either command (stdio) or url (http) is required.

Example prompt: "Introspect the MCP server at npx @anthropic/mcp-server-memory"

generate_report

Generate a standalone HTML dashboard from scan results.

Parameters:

ParameterTypeRequiredDescription
directorystringNoPath to scan
include_userbooleanNoInclude user-level configs
introspectbooleanNoIntrospect MCP servers
timeoutnumberNoIntrospection timeout (ms)

Example prompt: "Generate an HTML report of my project's AI context"

export_ecosystem

Export the complete AI ecosystem to a portable .aci/bundle.json.

Parameters:

ParameterTypeRequiredDescription
dirstringNoDirectory to scan (default: cwd)
include_userbooleanNoInclude user-level configs
onlystring[]NoCategories: mcp, skills, agents, memories, context
secretsstringNo"none" (default), "all", or ["VAR1", "VAR2"] to include specific vars

Example prompt: "Export my AI ecosystem without secrets"

import_ecosystem

Import a bundle into a project, adapting configuration to the target AI tool.

Parameters:

ParameterTypeRequiredDescription
filestringNoPath to bundle (auto-detects .aci/bundle.json)
dirstringNoTarget directory (default: cwd)
targetstringNoTarget tool (auto-detects). One of: claude, cursor, windsurf, copilot, gemini, codex, opencode
scopestringNoproject or user
forcebooleanNoOverwrite existing resources
confirmbooleanNoExecute import (default: false = dry-run plan only)
onlystring[]NoCategories to import
secretsstringNo"none", "all", ["VAR1"], or {"VAR1": "value"}

Example prompt: "Import the AI bundle into this project for Cursor"


What It Detects

19 AI Coding Tools

ToolContext FilesDescription
Claude CodeCLAUDE.md, .claude/, .mcp.jsonProject instructions + MCP config
Cursor.cursorrules, .cursor/rules/, .cursorignoreRules + ignore patterns
Windsurf.windsurfrules, .windsurf/rules/Codeium/Windsurf rules
GitHub Copilot.github/copilot-instructions.md, .github/agents/Instructions + custom agents
Gemini CLIGEMINI.md, .gemini/, .geminiignoreGoogle Gemini config
OpenAI CodexAGENTS.md, AGENT.md, .codex/Universal agent instructions
OpenCodeOPENCODE.md, .opencode/, opencode.jsonOpenCode CLI config
Aider.aider.conf.yml, .aiderignoreAider config + model settings
Cline.clinerules, .clineignoreCline rules (file or directory)
Roo Code.roo/rules/, .roorules, .rooignoreRoo Code rules
Continue.dev.continuerules, .continue/config.yamlContinue rules + config
Amazon Q.amazonq/rules/Amazon Q Developer rules
Augment.augment/rules/, .augment-guidelinesAugment Code rules
Replit.replit.mdReplit Agent instructions
Firebase Studio.idx/airules.mdFirebase Studio AI rules
VS Code.vscode/mcp.jsonVS Code MCP configuration
Tabnine.tabnine.yamlTabnine AI config
Sourcegraph.sourcegraph/Sourcegraph Cody config
UniversalCONVENTIONS.mdMulti-tool conventions

Plus user-level configs (~/.claude/, ~/.gemini/, ~/.codex/, ~/.continue/, ~/.aider.conf.yml, ~/.augment/, ~/.github/agents/, ~/.codeium/, ~/.opencode/, ~/.tabnine/).

MCP Servers

  • Discovers servers from .mcp.json, ~/.claude.json, .vscode/mcp.json, Claude Desktop config
  • Groups by source: project, user, VS Code, desktop
  • Live introspection: connects to each server, lists tools/resources/prompts with descriptions
  • Shows transport type (stdio/http/sse), command, args, environment variables

Custom Skills

  • Scans .claude/skills/ (project) and ~/.claude/skills/ (user)
  • Follows symlinks (installed via npx skills add)
  • Parses YAML frontmatter for name, description, triggers
  • Falls back to ## Purpose section parsing

Custom Agents

  • Scans .claude/agents/ (project) and ~/.claude/agents/ (user)
  • Parses YAML frontmatter for name, description, model
  • Detects if agent has persistent memory (via ~/.claude/agent-memory/)

Persistent Memories

  • Claude Memory: ~/.claude/projects/*/memory/MEMORY.md with preview
  • Agent Memory: ~/.claude/agent-memory/ files and directories
  • Engram: detected as MCP server or Claude Code plugin
  • OpenSpec: openspec/ directory with specs and changes count
  • ATL: .atl/ directory with file count

HTML Dashboard

The CLI generates a self-contained HTML file (no external dependencies) with:

  • Dark/light mode — auto-detects system preference
  • Summary badges — total MCPs, tools, files, skills, agents, memories at a glance
  • Collapsible sections — expand/collapse each category
  • Search — filter across all sections in real-time
  • File previews — inline preview of context file contents
  • MCP tool details — full tool listings with descriptions and input schemas
  • Tool badges — color-coded by AI tool (Claude, Cursor, Copilot, etc.)

Architecture

src/
├── index.ts              # Entry: CLI vs MCP mode routing
├── cli.ts                # CLI arg parsing + orchestration (scan, export, import)
├── server.ts             # createServer() MCP factory
├── scanner/              # Discovery engine
│   ├── types.ts          # All TypeScript interfaces
│   ├── catalog.ts        # AI_FILE_CATALOG (50+ entries, 19 tools)
│   ├── index.ts          # runAllScanners() orchestrator
│   ├── context-files.ts  # Scan context files (.md, rules, configs)
│   ├── mcp-configs.ts    # Parse .mcp.json, ~/.claude.json, etc.
│   ├── mcp-introspect.ts # Connect to MCP servers, list tools/resources
│   ├── utils.ts          # Shared utilities (parseFrontmatter)
│   ├── skills.ts         # Scan skill directories + parse frontmatter
│   ├── agents.ts         # Scan agent directories + detect memory
│   └── memories.ts       # Detect engram, openspec, .atl, claude memory
├── ecosystem/            # Export/import engine
│   ├── types.ts          # Bundle format, import targets, options
│   ├── index.ts          # Public API re-exports
│   ├── export.ts         # Scan → bundle → .aci/bundle.json
│   ├── import.ts         # Load bundle → plan → execute
│   ├── target-map.ts     # Path configs for 7 AI tools
│   ├── detect-target.ts  # Auto-detect AI tool in project
│   ├── secrets.ts        # Env var detection + sensitive patterns
│   └── prompts.ts        # Interactive CLI prompts
├── report/
│   ├── generator.ts      # generateHtml(ScanResult) → string
│   ├── sections.ts       # HTML section renderers
│   ├── styles.ts         # CSS (dark/light mode)
│   └── scripts.ts        # JS (collapse, search, preview)
├── tools/
│   ├── scan.ts           # MCP tool: scan project
│   ├── introspect.ts     # MCP tool: introspect specific MCP
│   ├── report.ts         # MCP tool: generate HTML report
│   ├── export.ts         # MCP tool: export_ecosystem
│   └── import.ts         # MCP tool: import_ecosystem
└── __tests__/
    ├── fixtures/          # Test projects (full, empty, mcp-only, export-project)
    ├── helpers.ts         # fixture() path helper
    └── *.test.ts          # 10 test files, 104 tests

6 Parallel Scanners

ScannerDetectsSources
context-filesConfig files for 19 AI toolsProject + user dirs
mcp-configsMCP server definitions.mcp.json, ~/.claude.json, VS Code, Desktop
mcp-introspectLive tool/resource/prompt listingsstdio/http connections
skillsCustom Claude Code skills.claude/skills/ + symlinks
agentsCustom Claude Code agents.claude/agents/ + memory detection
memoriesPersistent memory systemsengram, openspec, .atl, claude memory

All scanners run in parallel via Promise.all() for maximum speed.


Stack

  • TypeScript 5.x — strict mode, ESM
  • @modelcontextprotocol/sdk — MCP client + server
  • Zod — schema validation for MCP tool inputs
  • tsup — build (ESM output with shebang)
  • Vitest — testing (104 tests)

Zero runtime dependencies beyond MCP SDK and Zod.


Contributing

git clone https://github.com/cocaxcode/ai-context-inspector.git
cd ai-context-inspector
npm install
npm test          # Run all tests
npm run build     # Build with tsup
npm run typecheck # TypeScript check
npm run lint      # ESLint

License

MIT © cocaxcode

Reviews

No reviews yet

Sign in to write a review