Sentinel-IR-MCP: Give Your AI Agent a Map, Not the Whole Codebase
Description and use
Sentinel-IR-MCP gives AI agents a compact structural map of JavaScript repositories instead of the full source, reducing context size and improving safety.
Problem
AI coding agents often read entire repositories, wasting context on irrelevant code and risking prompt injection.
Outcome
Agents can now focus on high-risk files, reducing context size, improving safety, and providing a clear inspection trail.
Workflow
- 1. Install Sentinel-IR-MCP via npx or npm.
- 2. Configure allowed directories and file extensions ('.js', '.mjs', '.cjs').
- 3. Start the MCP server which exposes three tools: analyze_directory, analyze_file, analyze_code.
- 4. An MCP-compatible AI client discovers the tools and requests a directory overview.
- 5. The server returns a compact IR summarizing imports, exports, risky patterns, and other structural facts.
- 6. The AI agent selects files of interest based on IR risk scores and requests detailed analysis of those files.
- 7. The server returns targeted IR for selected files, omitting full source code.
- 8. The agent uses the IR to reason, generate explanations, or propose fixes.
- 9. Developers review the IR and any agent outputs for safety and correctness.
Evidence
AI coding agents can inspect repositories, explain functions, investigate bugs and modify code.
Instead of immediately sending the entire JavaScript source to the model, "Sentinel-IR" extracts compact structural facts: imports, exports, routes, filesystem and network operations, environment-variable access, process execution and risk signals.
Sentinel-IR-MCP connects those facts to AI clients through the "Model Context Protocol (MCP)".
The server is read-only. It does not modify files or execute the analyzed JavaScript.
Sentinel-IR-MCP exposes three: analyze_code, analyze_file, analyze_directory.
The result does not need to repeat the complete function body to tell the agent that certain patterns were detected.
- Record date: 2026-10-21T03:41:24.874Z