Listed from the MCP registry; nobody on Odel publishes it.
Structural IR of JS/TS/Python/Rust files for AI agents: risk and signals instead of raw source.
Runs on your machine from its package; the steps are below.
At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y sentinel-ir-mcp
MCP client config
{
"mcpServers": {
"sentinel-ir": {
"command": "npx",
"args": [
"-y",
"sentinel-ir-mcp"
]
}
}
}MCP server for sentinel-ir:
it lets AI agents in Claude Desktop, Cursor, Windsurf or any other
Model Context Protocol client read a
compact structural IR of JavaScript, TypeScript, Python and Rust files instead of the raw source.
io.github.jakcmencz/sentinel-ir-mcpsentinel-irRequires Node.js 20 or newer. In your project folder:
npx -y sentinel-ir-mcp@stable-0.5 setup # asks which AI app, shows the change, writes after you confirm
# restart the AI app
npx -y sentinel-ir-mcp@stable-0.5 doctor # checks that the app can start the server
Then ask the agent, for example, "Use sentinel-ir to find the riskiest files in this project." Details and other options: Setup.
The IR tells the agent what a file does (risk level, dangerous
capabilities such as eval or child_process, routes, exports, imports,
environment reads, network / filesystem / process / crypto calls) in a few
hundred characters. The agent can triage a folder first and then read the raw
source only of the files that matter.
Supported: JavaScript (.js, .mjs, .cjs, .jsx; .jsx since 0.5.8), TypeScript (.ts, .mts,
.cts, .tsx; since 0.2.0), Python (.py, .pyi; since 0.3.0) and Rust
(.rs; since 0.5.0). The
language is picked from the file extension, so analyze_file refuses a file
without one (a shell script, Makefile); analyze_code also takes target
or an explicit language (javascript/js, typescript/ts, tsx,
python/py, rust/rs; case-insensitive since 0.5.10). Every result carries language and
analysisStatus; a file that does not parse cleanly (including JSX in a .ts
file) is "incomplete", and a low risk on an incomplete result is not evidence
of safety. Other languages are not supported yet. What is detected in Python
and Rust (and what is not) is listed in the
sentinel-ir README.
Older versions: CHANGELOG.md.
0.5.23 fixes from a test with real agents (Cursor, VS Code Copilot) on Linux, macOS and Windows:
analyze_directory lists them in allowedFolders. A relative path that
exists in more than one folder is refused as ambiguous.setup refuses --project given twice (it used to keep only the last one).analyze_code refuses empty code instead of answering complete / low.doctor: no min-release-age warning on npm 10 (it ignores the setting);
before shows the date and that npx may find no version at all
(ENOVERSIONS); with only a global Cursor config every hint names
--global, also when the project config is broken; an exclusion is
"matches nothing" only when it matches in none of the folders.max_files.sentinel-ir 0.5.16 and 0.5.17: an unsupported script (install, Makefile, .sh,
.ps1, .rb) that pipes a download to a shell, opens a reverse shell,
sends secrets or spawns processes is critical; deletes and persistence
are high. 0.5.17: these checks take milliseconds even on a 1 MB line.SECURITY.md names a real version instead of <version>.| tool | input | returns |
|---|---|---|
analyze_code | code (string), optional target (file name; its extension picks the language), optional language (javascript, typescript, tsx, python, rust, or js/ts/py/rs since 0.5.9) | compact IR of the given source |
analyze_file | path | compact IR of one file inside the allowed folders, plus sha256 of the exact bytes analyzed (0.5.12) |
analyze_directory | optional path, max_files (default 50, max 500), recursive (default true), detail ("summary" default, or "full") | one short entry per file (path, risk, status, language, lines, operations, up to 3 risk signals, sha256 since 0.5.12; "full": all facts), sorted from highest to lowest risk, plus riskCounts, statusCounts and incomplete (paths whose analysis did not finish; check them separately, their low risk is not evidence of safety); files that could not be read are listed in skipped.unreadable and are not counted as analyzed; excluded files and folders are only counted in skipped.excluded; truncated, notScanned (source files left out past max_files, since 0.5.15; notScannedAtLeast: true when counting stopped early and it is a lower bound, since 0.5.16), warning (only on a partial answer) and skipped |
Every tool returns the result twice: as JSON text (for clients that only read
text) and as structuredContent. All three are annotated
readOnlyHint: true, destructiveHint: false, openWorldHint: false.
Example analyze_file result for a three-line file that calls eval and
child_process (real output, wrapped for reading):
{"analysisStatus":"complete",
"mission":{"target":"danger.js","objective":"general_optimization"},
"world":{"pressure":0.5,"confidence":0.75,"budget":0.015,"risk":"critical"},
"constraints":["preserve_api","avoid_breaking_changes"],
"forbidden":["eval","child_process","process_spawn"],
"summary":{"size":93,"lines":3,"hasCrypto":false,"hasFilesystem":false,"hasNetwork":false},
"facts":{"ast":true,"exports":["default"],"imports":["child_process"],
"operations":["dynamicEval","processSpawn","childProcess"],
"calls":{"process":["cp.exec","require(child_process)"],"dynamic":["eval"]},
"dangerous":["eval","child_process","process_spawn"],
"riskSignals":["child_process_import:require(child_process)@1","dynamic_code:eval@2","process_spawn:cp.exec@2"]}}
Rely on world.risk, forbidden and facts. mission.objective is a coarse
hint from sentinel-ir and can stay general_optimization even for risky
files, as above.
Requires Node.js 20 or newer. npx downloads and runs the server; there is
nothing to compile (the parser is WebAssembly).
Run it in your project folder:
npx -y sentinel-ir-mcp@stable-0.5 setup --client cursor # or windsurf, claude-desktop, vscode, claude-code
npx -y sentinel-ir-mcp@stable-0.5 doctor --client cursor # after restarting the client
npx -y sentinel-ir-mcp@stable-0.5 guide # optional: text for AGENTS.md / client rules
setup (without --client it asks which client):
--yes);
--dry-run shows the change and writes nothing;"sentinel-ir" entry; other servers and other
fields in the file stay as they are, and running it again changes nothing;<file>.bak-<timestamp> before writing and writes
through a temporary file plus rename; a file with invalid JSON is never
touched;--project, default: the current folder) and
refuses your home folder or a whole disk;sentinel-ir-mcp@stable-0.5, an npm tag for the newest 0.5.x, so
clients get 0.5.x fixes on their next start but no unexpected new features;--exclude <name>,
repeatable, skips the question; see Excluding files);code --add-mcp ..., claude mcp add ...) instead.--client | file written by setup |
|---|---|
cursor | <project>/.cursor/mcp.json with ${workspaceFolder}; --global: ~/.cursor/mcp.json with the absolute path |
windsurf | ~/.config/devin/mcp_config.json (or $XDG_CONFIG_HOME/devin/), Windows %APPDATA%\devin\mcp_config.json. Servers from an older ~/.codeium/windsurf/mcp_config.json are copied over; that file stays unchanged |
claude-desktop | macOS ~/Library/Application Support/Claude/claude_desktop_config.json, Windows %APPDATA%\Claude\claude_desktop_config.json; elsewhere pass --config <file> |
vscode, claude-code | nothing; prints the command to run |
On Windows the entry is "command": "cmd", "args": ["/c", "npx", "-y", "sentinel-ir-mcp@stable-0.5", "<folder>"]: there npx is npx.cmd, and starting it
without a shell failed with ENOENT on a real Windows runner. For VS Code and
Claude Code, setup prints a PowerShell and a Command Prompt version of the
command. What was measured on which system: COMPATIBILITY.md.
doctor checks Node.js, the package version (and asks the npm registry, or
npm_config_registry, through npm's proxy settings, whether its stable-X.Y tag has a newer release), the client config (valid JSON, a
"sentinel-ir" entry that starts sentinel-ir-mcp, existing folders), then
starts its own server with the same folders, performs a real MCP
handshake, expects exactly the three tools and calls analyze_directory with
max_files: 1. It lists your exclusions, how many files and folders they skip
in the project right now, and warns about one that matches nothing (a typo).
It never runs the command stored in the client config. Exit
code 0 when everything passes, 1 otherwise; --json gives a machine-readable
report.
Only setup writes files, and only the client config. The MCP server itself
reads only; the one exception is the audit log, if you turn it on.
Cursor: a server from a project .cursor/mcp.json starts switched off.
Open Cursor Settings → Customize → MCPs and turn on the switch next to
sentinel-ir (its source is the project's .cursor/mcp.json). It then shows
Connected and 3 tools. A server installed with the link below (user-level
~/.cursor/mcp.json) connected without this step.
Keep sentinel-ir in only one of the two files: with both, Cursor may start
the global one, which does not have the project's --exclude and
--audit-log. Since 0.5.22 setup and doctor warn about it, and
doctor --client cursor checks the global file when the project has no entry.
npx keeps the package it downloaded for a version or range
(sentinel-ir-mcp@0.5, @0.2, ...) and keeps starting that copy, together
with the sentinel-ir it got then, even when newer versions are on npm
(measured with npm 10.8.2, 10.8.3, 10.9.9 and 11.21.2; on npm 10
--prefer-online and npm cache clean --force did not change it; other npm
versions may refresh a range, a pinned version such as @0.5.8 never changes). The tag
setup writes since 0.5.1 (@stable-0.5) is looked up again on every start
instead. If a client still starts an old copy:
npx -y sentinel-ir-mcp@stable-0.5 doctor. It prints the versions it
runs and lists every cached copy with a sentinel-ir older than the
version it needs, with its folder.npm cache npx rm <key>; npm 10 has no such command). Deleting the whole _npx folder in npm's cache also works
(npm config get cache shows where it is; usually ~/.npm/_npx, on
Windows %LocalAppData%\npm-cache\_npx); it removes all packages cached
by npx, which are downloaded again when needed.npx -y sentinel-ir-mcp@stable-0.5 setup for your client and start the
client again.If doctor warns about min-release-age or before (npm.policy), an
.npmrc (in the project, a parent folder or your npm config) tells npm to
install only older releases, so @stable-0.5 starts an older version and
deleting the cache does not help. npm config list in that folder shows which
file sets it.
A folder that is literally named setup, doctor or guide must now be
passed as ./setup (or an absolute path); the bare word is the command.
Configs written by older versions pin sentinel-ir-mcp@0.3 (or @0.2) and
keep running that line. 0.3.x has no native-code detection, and its parser
stops working in long sessions (see 0.4.0 in CHANGELOG.md); 0.2.x also has no Python
support. Run setup again for your client (it replaces only the
"sentinel-ir" entry); doctor warns about an entry that still pins 0.3 or
older. If the client still starts an old version, see
Getting a newer version.
These links follow the Cursor and VS Code documentation. They were opened in
VS Code 1.143 and Cursor 3.26 (see COMPATIBILITY.md). A link cannot know your
project path, so it uses ${workspaceFolder}; if your client does not expand
it, use setup instead.
Some sites (including GitLab and npm) may not open cursor:// or vscode:
links; copy the link into the browser address bar or use setup.
The links write "command": "npx". On Windows setup writes
"command": "cmd", "args": ["/c", "npx", ...] instead, because some clients
there do not find npx without a shell; doctor warns about a plain npx
entry on Windows.
Pass the folder(s) the agent may read as arguments. Use absolute paths.
Settings → Developer → Edit Config opens claude_desktop_config.json
(macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):
{
"mcpServers": {
"sentinel-ir": {
"command": "npx",
"args": ["-y", "sentinel-ir-mcp@stable-0.5", "/Users/you/projects/my-app"]
}
}
}
Restart Claude Desktop afterwards.
Project .cursor/mcp.json (or ~/.cursor/mcp.json for all projects).
${workspaceFolder} is the folder that contains .cursor/mcp.json. A
project entry has to be switched on once in Cursor Settings → Customize → MCPs:
{
"mcpServers": {
"sentinel-ir": {
"command": "npx",
"args": ["-y", "sentinel-ir-mcp@stable-0.5", "${workspaceFolder}"]
}
}
}
Windsurf 3 (Devin Desktop) reads ~/.config/devin/mcp_config.json
(Windows: %APPDATA%\devin\mcp_config.json); older versions read
~/.codeium/windsurf/mcp_config.json. Add the same entry as for Claude Desktop
with your project's absolute path.
Any MCP client that starts stdio servers works with
command: "npx", args: ["-y", "sentinel-ir-mcp@stable-0.5", "<folder>"]
(on Windows: command: "cmd", args: ["/c", "npx", "-y", "sentinel-ir-mcp@stable-0.5", "<folder>"]).
Without folder arguments the server uses the client's
MCP roots
if the client offers them; if it offers none, only analyze_code works.
npx -y sentinel-ir-mcp@stable-0.5 setup --client cursor --exclude secrets --exclude "*.min.js"
| you write | excludes |
|---|---|
secrets | every file or folder named secrets, anywhere in the project, with everything inside |
config/prod.js | only this path, relative to the project folder |
*.min.js | files by mask; * and ? stay within one name |
generated/**/out | ** stands for any number of folders |
! to re-include something. Absolute paths,
.. and the characters " & | < > ^ % ! are refused.\ works like /. On Windows and macOS letter case does not
matter (SECRETS/a.js is excluded by secrets), on Linux it does.lib/../secrets/a.js, a symlink to an
excluded file and a Windows short name (SECRE~1) are refused too. It is
repeated when the file is opened.analyze_code is not affected: it analyzes text the agent already has.The exclusions only bind this server. An agent that can read files with other tools of its client is told about them, but this server cannot stop it.
npx -y sentinel-ir-mcp@stable-0.5 setup --client cursor --audit-log # or answer "y" in setup
npx -y sentinel-ir-mcp@stable-0.5 log # what the agent asked for
| system | folder |
|---|---|
| Windows | %LOCALAPPDATA%\sentinel-ir-mcp\audit-log\ |
| macOS | ~/Library/Logs/sentinel-ir-mcp/ |
| Linux | ~/.local/state/sentinel-ir-mcp/audit-log/ (or $XDG_STATE_HOME) |
--audit-log=<folder> uses another folder: a full path outside the project
(the characters " & | < > ^ % ! are refused because Windows starts the
server through cmd). Then read it with log --dir <folder>.
audit-YYYY-MM-DD.jsonl
(local date): time, client name, tool, the path the agent asked for, the
result (risk, analysisStatus, file counts, up to 20 critical/high file
paths of a folder) or why it was refused (excluded, outside,
not-found, too-large, hardlink, symlink, unsupported,
not-a-file, not-a-folder, url, no-folders), and the duration. A line when the server starts.
Since 0.5.21 the line is on disk before the agent gets the answer.sha256 for analyze_file; for
analyze_directory the folder line gets a call id and hashed count,
and the hashes follow in "event": "hashes" lines (40 files each, same
call id), so no line gets long. log shows the first 12 digits for
files and the risky files of a folder; log --json has all of them. To check whether a file is still the
one the agent saw, compare with certutil -hashfile <file> SHA256
(Windows), shasum -a 256 <file> (macOS) or sha256sum <file> (Linux).
Pasted code (analyze_code) gets no hash: a very short snippet could be
guessed from it. Since 0.5.12 the agent gets the same sha256 in the
analyze_file answer and in every analyze_directory entry, so it can
check that a file is still the one it saw before running or relying on it.analyze_code only the size in
bytes, the language and the risk. Names of excluded files are not written
either, only their count. Long values are cut to 300 characters.log shows control and bidi characters as \u{1b}, so a
path cannot recolor or rewrite your terminal.doctor reports it as [FAIL]. Several servers can share the folder: each
line is one append, so lines do not mix.doctor adds one line, doctor checked that the log can be written, and
none of its own tool calls.0600, folder 0700; on Windows
the folder in %LOCALAPPDATA% is private to your account).sentinel-ir-mcp [--exclude <name>]... [--audit-log[=<folder>]] [--max-file-bytes <n>] [--max-files <n>] [--time-budget-ms <n>] [folder ...]
--exclude <name> file or folder the file tools refuse (repeatable, max 100); see Excluding files
--audit-log[=<folder>] keep a log of the tool calls (never source code); see Audit log
--max-file-bytes <n> largest file to analyze (default 1048576 = 1 MiB, max 2097152 = 2 MiB)
--time-budget-ms <n> analyze_directory starts no new file after this (default 30000, max 600000)
--max-files <n> default file limit for analyze_directory (default 50, max 500)
setup command writes
only the client config file you confirm; doctor starts this package's own server. The only files it opens are .js/.mjs/.cjs/.jsx/.ts/.mts/.cts/.tsx/.py/.pyi/.rs files up to
--max-file-bytes.../,
absolute paths elsewhere and symlinks pointing outside are refused, with the
same answer whether or not the path exists (since 0.5.8).analyze_directory lists the folders in allowedFolders (since 0.5.23).
A relative path is taken from the allowed folder in which it exists; one
that exists in more than one is refused as Ambiguous path (since 0.5.23;
0.5.22 took the first, older versions always the first folder).
analyze_directory without path scans only the first folder and lists
the others in otherFolders. setup writes one folder; add more to the
server's args in the config by hand.http://…, data:, mailto:, file:src/x.js),
network paths (\\server\share\x.js, //server/share/x.js) and
file://server/… are refused as Not a file path: … is a URL or as
outside the allowed folders before any file system call, so Windows does
not open an SMB connection to another machine (since 0.5.9). Local
file:///… paths work.setup), never from the agent or from files in the
project. Excluded paths are refused by analyze_file and counted, not
named, in skipped.excluded.analyze_directory skips node_modules, .git, hidden folders and
every symlink, and stops after max_files files (truncated: true, the
number left out in notScanned) or when the time budget is spent
(timedOut: true, rest in notAnalyzed). A partial answer carries a
warning: its riskCounts are not a result for the whole folder.
Each file is checked again when it is opened: it must still be a regular
file inside the allowed folders.analyze_file error,
skipped.hardlinks in analyze_directory). This also refuses harmless hard
links, e.g. pnpm's in node_modules.sentinel-ir; code that hides its behaviour (e.g. building
a module name at runtime) can look harmless.The library's own published sources (sentinel-ir@0.1.3), read through
analyze_file / analyze_directory over stdio. Tokens counted with
gpt-tokenizer@4.0.4 (o200k_base encoding); other models' tokenizers give
different numbers.
| file | raw chars | raw tokens | IR chars | IR tokens |
|---|---|---|---|---|
src/ast-facts.js | 39,877 | 8,439 | 450 | 120 |
src/sentinel-ir.js | 9,123 | 2,084 | 515 | 133 |
src/tree-parser.js | 4,393 | 891 | 465 | 121 |
examples/basic.js | 600 | 150 | 461 | 120 |
all 4 via analyze_directory | 11,564 | 317 |
The IR has a floor of roughly 120 tokens per file, so it does not pay off for
very small files. analyze_file on src/ast-facts.js took about 160 ms per
call (average of 10, Node 24, Linux cloud VM); the first call also loads the
WebAssembly parser.
Long session (one server process over stdio, 6,000 analyze_code calls on
the same 17.8 KB JavaScript file, about 107 MB in total, Node 24):
| version | calls with a different analysisStatus than the first | first such call |
|---|---|---|
0.3.0 + sentinel-ir 0.3.1 | 1,083 | 4,918 |
0.4.0 + sentinel-ir 0.4.2 | 0 | — |
Three runtime dependencies: the official
@modelcontextprotocol/sdk,
zod (its schema peer dependency) and sentinel-ir (0.5.11 or newer;
doctor fails when an older copy is loaded). With their own
dependencies that is about 100 packages in node_modules; npm audit
reported 0 vulnerabilities at release time (0.4.0: after updating
body-parser to 2.4.0 in the lock file). Unlike sentinel-ir itself,
this package is not dependency-free.
npm ci
npm test # starts the real server over stdio and talks to it with the MCP SDK client
Tests cover the tool list and annotations, all three tools, refusals for
../, absolute paths, symlinks out of the folder, unsupported file types and
size limits, MCP roots from the client, and the command-line options.
setup/doctor tests run against temporary HOME/APPDATA folders: new
file, keeping other servers and fields, backup, idempotent second run, invalid
JSON left untouched, --dry-run, refused home/root folders, symlinked config,
Claude Desktop/Windsurf macOS/Windows paths (simulated), a real MCP
handshake, failing configs and old Node.js.
A second CI job runs on a real Windows runner (Node 20/22/24): the full test
suite, the packed package with setup/doctor against the real %APPDATA%,
starting the published package through npx, and the printed VS Code/Claude
Code commands pasted into PowerShell 5.1, PowerShell 7 and cmd.exe. See
COMPATIBILITY.md. On every push it runs on GitHub Actions
in the mirror (.github/workflows/windows.yml); on GitLab it runs on release
tags before publish, and by hand on other branches. The informational
large-file size probe runs on release tags only.
Release: bump version in package.json and both version fields in
server.json (a test checks they match), push a protected tag vX.Y.Z;
GitLab CI tests and publishes to npm with provenance through npm trusted
publishing (GitLab OIDC, no stored npm token). The GitLab mirror pushes
the tag to GitHub, where .github/workflows/release.yml waits for npm, creates
the GitHub release and publishes the tag's server.json to the MCP Registry
(by hand: mcp-publisher login github and mcp-publisher publish).
sentinel-ir-mcp has one maintainer, Jakub (@jakcmencz). He decides what it should do, tests it on his own machines and approves every release. Most of the code is written by an AI coding agent working from his specs, and every change goes through the tests and CI described above. Sponsorship pays for that agent time, for CI and Linux, macOS and Windows test machines, and for the next language, Go.
For company sponsorship, grants or integration, write to sentinel.ir.contact@gmail.com.
Development, CI and npm releases run on
GitLab. The
GitHub repository is a mirror
that GitLab updates on every push to main and every tag. Issues are welcome
on either; a pull request opened on GitHub is applied on GitLab, and the mirror
then brings it back.
Apache-2.0. See NOTICE.