Server data from the Official MCP Registry
Structural IR of JS/TS/Python/Rust files for AI agents: risk and signals instead of raw source.
About
Structural IR of JS/TS/Python/Rust files for AI agents: risk and signals instead of raw source.
Security Report
Valid MCP server (4 strong, 3 medium validity signals). 1 code issue detected. 1 known CVE in dependencies (0 critical, 1 high severity) Imported from the Official MCP Registry. 1 finding(s) downgraded by scanner intelligence.
5 files analyzed · 2 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"sentinel-ir-mcp": {
"command": "npx",
"args": [
"-y",
"sentinel-ir-mcp@0.5.19"
]
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
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.
- npm: https://www.npmjs.com/package/sentinel-ir-mcp
- Official MCP Registry:
io.github.jakcmencz/sentinel-ir-mcp - GitLab (main repository): https://gitlab.com/jakubrojicek11/sentinel-ir-mcp
- GitHub (mirror): https://github.com/jakcmencz/sentinel-ir-mcp
- Library behind it:
sentinel-ir - See what the agent sees, in your browser: https://sentinel-ir-playground-dc30c8.gitlab.io/
Quick start
Requires 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.
What the agent gets
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.
What's new
Older versions: CHANGELOG.md.
0.5.19 re-release of 0.5.18 with the same code: on some npm CDN
locations 0.5.18 lacks npm's publish attestation, so npm audit signatures
on npm 10 failed there.
Tools
| 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.
Setup
Requires Node.js 20 or newer. npx downloads and runs the server; there is
nothing to compile (the parser is WebAssembly).
Quick setup (since 0.2.2)
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):
- shows the change first and writes only after you confirm (or with
--yes);--dry-runshows the change and writes nothing; - adds or replaces only the
"sentinel-ir"entry; other servers and other fields in the file stay as they are, and running it again changes nothing; - copies the old file to
<file>.bak-<timestamp>before writing and writes through a temporary file plus rename; a file with invalid JSON is never touched; - gives the agent one folder (
--project, default: the current folder) and refuses your home folder or a whole disk; - writes
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; - asks which files or folders the agent must not read (
--exclude <name>, repeatable, skips the question; see Excluding files); - for VS Code and Claude Code it writes nothing and prints their own install
command (
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.
Getting a newer version
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:
- Run
npx -y sentinel-ir-mcp@stable-0.5 doctor. It prints the versions it runs and lists every cached copy with asentinel-irolder than the version it needs, with its folder. - Close the client app and delete those folders (npm 11:
npm cache npx rm <key>). Deleting the whole_npxfolder in npm's cache also works (npm config get cacheshows where it is; usually~/.npm/_npx, on Windows%LocalAppData%\npm-cache\_npx); it removes all packages cached bynpx, which are downloaded again when needed. - Run
npx -y sentinel-ir-mcp@stable-0.5 setupfor your client and start the client again.
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.
Upgrading from 0.3.x or older
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.
One-click install links
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.
- Cursor: Install in Cursor
- VS Code: Install in VS Code
Some sites (including GitLab and npm) may not open cursor:// or vscode:
links; copy the link into the browser address bar or use setup.
Manual setup
Pass the folder(s) the agent may read as arguments. Use absolute paths.
Claude Desktop
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.
Cursor
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
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.
Other clients
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.
Excluding files
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 |
- Only additions: there is no
!to re-include something. Absolute paths,..and the characters" & | < > ^ % !are refused. - Windows
\works like/. On Windows and macOS letter case does not matter (SECRETS/a.jsis excluded bysecrets), on Linux it does. - The check uses the real path, so
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_codeis 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.
Audit log
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>.
- What is written: one JSON line per tool call in
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 20critical/highfile 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. - Which version of a file (0.4.5): for every file the server read, the
SHA-256 of the exact bytes it analyzed:
sha256foranalyze_file; foranalyze_directorythe folder line gets acallid andhashedcount, and the hashes follow in"event": "hashes"lines (40 files each, samecallid), so no line gets long.logshows the first 12 digits for files and the risky files of a folder;log --jsonhas all of them. To check whether a file is still the one the agent saw, compare withcertutil -hashfile <file> SHA256(Windows),shasum -a 256 <file>(macOS) orsha256sum <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 samesha256in theanalyze_fileanswer and in everyanalyze_directoryentry, so it can check that a file is still the one it saw before running or relying on it. - What is not written: source code. For
analyze_codeonly 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. - Cleanup: day files older than 30 days are deleted; a day stops 1 MB below 50 MB with one line saying so, so parallel servers stay under 50 MB too. Other files in the folder are never touched.
- Set by you only, like exclusions: the agent and the project cannot turn it on, off or move it. The log is never written inside the project.
- Safe to read: a path with a newline cannot add a fake line (JSON
escapes it), and
logshows control and bidi characters as\u{1b}, so a path cannot recolor or rewrite your terminal. - Never breaks the tools: when the log cannot be written (disk full, no
permission) the tools answer as usual and the server says so once on stderr;
doctorreports it as[FAIL]. Several servers can share the folder: each line is one append, so lines do not mix. doctoradds one line,doctor checked that the log can be written, and none of its own tool calls.- A day file that is a symlink, junction or hard link is not written to, on Windows too, so the log cannot be used to overwrite another file.
- It records only what the agent asked this server for. Other file tools of your AI app are not in it.
- Files are created readable by you only (
0600, folder0700; on Windows the folder in%LOCALAPPDATA%is private to your account).
Options
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)
What the server can and cannot do
- Reads only. The MCP server never writes project files, runs commands or
opens network connections. It writes only the audit log when
you turn it on (outside the project). The separate
setupcommand writes only the client config file you confirm;doctorstarts this package's own server. The only files it opens are.js/.mjs/.cjs/.jsx/.ts/.mts/.cts/.tsx/.py/.pyi/.rsfiles up to--max-file-bytes. - Only inside the allowed folders. Every path is resolved to its real path
(symlinks followed) and must lie inside a folder given on the command line,
or, without folder arguments, inside one of the client's MCP roots.
../, absolute paths elsewhere and symlinks pointing outside are refused, with the same answer whether or not the path exists (since 0.5.8). - Local paths only. URLs (
http://…,data:,mailto:,file:src/x.js), network paths (\\server\share\x.js,//server/share/x.js) andfile://server/…are refused asNot a file path: … is a URLor 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). Localfile:///…paths work. - Exclusions are yours. They come only from the command line the client
starts (written by
setup), never from the agent or from files in the project. Excluded paths are refused byanalyze_fileand counted, not named, inskipped.excluded. analyze_directoryskipsnode_modules,.git, hidden folders and every symlink, and stops aftermax_filesfiles (truncated: true, the number left out innotScanned) or when the time budget is spent (timedOut: true, rest innotAnalyzed). A partial answer carries awarning: itsriskCountsare 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.- Hard links are refused. A hard link inside the folder can point to a
file outside it, and the other names of a file cannot be found. So files
with more than one hard link are refused (
analyze_fileerror,skipped.hardlinksinanalyze_directory). This also refuses harmless hard links, e.g. pnpm's innode_modules. - The IR is still untrusted text. Comments, string bodies and function bodies are not copied into it, so instructions hidden there do not reach the agent through the IR. It does contain identifiers and some literals from the code (route paths, module names, export names, env variable names). That reduces the prompt-injection surface; it does not remove it.
- It is not a security scanner. The risk level comes from a fixed set of
AST patterns in
sentinel-ir; code that hides its behaviour (e.g. building a module name at runtime) can look harmless.
Measurements
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 | — |
Dependencies
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.
Development
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).
Sponsor
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.
Contributing
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.
License
Apache-2.0. See NOTICE.
Reviews
No reviews yet
Be the first to review this server!
More Security MCP Servers
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
mcp-creator-python
Freeby mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Lharries · Communication
Read, search, and send WhatsApp messages through your AI assistant
FinAgent
Freeby mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.
Memory
Freeby Modelcontextprotocol · Productivity
Knowledge graph-based persistent memory across sessions
