Skip to content
Back to search

mcp-xray

Static report card for an npm MCP server package: env vars, network hosts, files, child processes and eval in the shipped code, with file:line, checked against its README. Built on REA; never installs or runs the package.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/agentwik-labs--mcp-xray/badge.svg)](/listings/agentwik-labs--mcp-xray)

HTML

<a href="/listings/agentwik-labs--mcp-xray"><img src="/api/listings/agentwik-labs--mcp-xray/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Requires Node 22.19+ or 24.11+ (what `rea-agents` supports) and npm. Not published to npm yet; run it from a clone:

git clone https://github.com/agentwik-labs/mcp-xray.git
cd mcp-xray
npm ci --ignore-scripts                           # no dependency install scripts run
npm test                                          # 25 tests: fixtures, units, CLI, no-execution check

node bin/mcp-xray.mjs tavily-mcp                  # downloads the tarball, writes reports/tavily-mcp.html
node bin/mcp-xray.mjs @upstash/context7-mcp@4.5.1 --out card.html
node bin/mcp-xray.mjs fixtures/mcp-planted --json # an extracted package directory; JSON to stdout

Reproduce the measured results:

npm run fixtures     # fixtures -> results/fixture-scores.json, results/mcp-*.json
npm run fetch        # the 12 real packages at the versions pinned in targets.json -> targets/ (gitignored)
npm run reports      # REA on all of them (2-3 min) -> reports/*.html, results/measured.json

`scripts/record-demo.mjs` re-records `demo/demo.mp4` from the built reports; it needs Playwright, which is not a dependency (see `scripts/pw.mjs`).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 169 lines
  1. # mcp-xray
  2. **On our planted test MCP server, mcp-xray finds 13 of 13 planted behaviours with 0 false positives; plain grep over
  3. the same files finds 12 of 13 with 8 false positives.** Measured by `npm run fixtures`, which scores both against
  4. `fixtures/truth.json` (committed before the analyser existed); numbers in `results/fixture-scores.json`
  5. (rea-agents 6.7.0, 2026-11-18). The fixture is ours, and the 13th (an env read by destructuring) was fixed after we saw
  6. it missed: read [what this number is and is not](#what-the-fixture-number-is-and-is-not).
  7. **What does this MCP server actually do?** Point mcp-xray at an npm MCP server package and get a one-screen report of
  8. what the shipped code can do: environment variables it reads (secret-looking names marked), network calls and hosts,
  9. files read and written (sensitive paths marked), child processes, and dynamic code (`eval`, `new Function`, `vm`),
  10. each with `file:line`, checked against what the README says.
  11. Static analysis only. The package is fetched as a registry tarball (`npm pack --ignore-scripts`) into a temporary
  12. directory, extracted, and parsed; it is never installed or executed (a test plants code that would write a marker file
  13. and checks it is never written). Built on [REA](https://github.com/morluto/rea) (`rea-agents`, MIT), used as a local CLI.
  14. ## Install and run
  15. Requires Node 22.19+ or 24.11+ (what `rea-agents` supports) and npm. Not published to npm yet; run it from a clone:
  16. ```sh
  17. git clone https://github.com/agentwik-labs/mcp-xray.git
  18. cd mcp-xray
  19. npm ci --ignore-scripts # no dependency install scripts run
  20. npm test # 25 tests: fixtures, units, CLI, no-execution check
  21. node bin/mcp-xray.mjs tavily-mcp # downloads the tarball, writes reports/tavily-mcp.html
  22. node bin/mcp-xray.mjs @upstash/context7-mcp@4.5.1 --out card.html
  23. node bin/mcp-xray.mjs fixtures/mcp-planted --json # an extracted package directory; JSON to stdout
  24. ```
  25. Reproduce the measured results:
  26. ```sh
  27. npm run fixtures # fixtures -> results/fixture-scores.json, results/mcp-*.json
  28. npm run fetch # the 12 real packages at the versions pinned in targets.json -> targets/ (gitignored)
  29. npm run reports # REA on all of them (2-3 min) -> reports/*.html, results/measured.json
  30. ```
  31. `scripts/record-demo.mjs` re-records `demo/demo.mp4` from the built reports; it needs Playwright, which is not a
  32. dependency (see `scripts/pw.mjs`).
  33. ## How it works
  34. 1. `rea analyze-javascript-application <dir> --format json` builds REA's application graph and semantic graph.
  35. 2. **REA facts** used directly (`layer: "rea"`): environment config sources, `process.env.X` member reads, file config
  36. sources, request nodes, and outbound endpoints (fetch / http(s) / axios-style clients).
  37. 3. **Our classifier on REA call sites** (`layer: "rea-site"`): REA gives every call an exact AST range, so comments and
  38. strings never match. We name the callee and gate on the imports REA recorded for that file (`execSync` only counts
  39. if the file imports `child_process` or has a computed `require`; `.exec()` on a regex does not). A host held in a
  40. `const` string is resolved.
  41. 4. **Our AST layer** (`layer: "ast"`, `@babel/parser`, one pass per file): env vars read by destructuring
  42. `process.env` (`const { GITHUB_TOKEN } = process.env`, also renamed, defaulted, and in assignments and parameter
  43. defaults), and hosts named in URL string literals.
  44. 5. README check: env names and hosts the README never mentions are labelled "not in README". A text match, not a verdict.
  45. 6. **grep baseline** over the same files: the regexes a careful reviewer would use (`process.env.X`, URLs, `fetch(`,
  46. `readFile(`, `exec(`, `eval(`, ...), line by line. These rules are unchanged since the first measurement.
  47. ## Measured results (rea-agents 6.7.0)
  48. ### Ground truth: our test fixture
  49. Two twins of a small weather/notes MCP server in `fixtures/`. The planted twin adds 13 behaviours (secret env reads,
  50. `~/.aws/credentials` and `~/.ssh/id_rsa` reads, a POST to an undeclared host, a host in a constant, a base64-hidden URL,
  51. `eval` and `new Function` of downloaded text, `execSync`, a `spawn` via `require("child_" + "process")`, appending to
  52. `~/.zshrc`). The clean twin has only its 6 declared behaviours plus decoys (comments mentioning eval/env/URLs, a help
  53. string, `RegExp.exec`). A finding counts if category, file and line match an entry in `fixtures/truth.json`.
  54. | on the planted twin | planted found | declared found | false positives |
  55. | --- | --- | --- | --- |
  56. | **mcp-xray** (REA + our layers) | **13 / 13** | 6 / 6 | **0** |
  57. | REA facts alone | 4 / 13 | 3 / 6 | 0 |
  58. | plain grep | 12 / 13 | 6 / 6 | 8 |
  59. | on the clean twin | false positives |
  60. | --- | --- |
  61. | mcp-xray | 0 |
  62. | plain grep | 7 |
  63. grep misses P2 (`const { GITHUB_TOKEN } = process.env`); a `} = process.env` rule would catch this one-line case.
  64. grep's false positives are comments, a help string, `RegExp.exec`, import lines and a URL constant. The base64-hidden
  65. host (P9) is found as a network call but its host is not recovered. Hosts named at the call: mcp-xray 3 of 4, grep 2 of 4.
  66. #### What the fixture number is and is not
  67. - We wrote the fixture and its truth list, so it tests the behaviours we thought of. `truth.json` was committed before
  68. the first analyser run (`git log -- fixtures/truth.json`) and has not changed since.
  69. - The first measurement was 12 of 13: both mcp-xray and grep missed P2. We then added the AST layer for destructured
  70. env reads and re-measured: 13 of 13. So that one point was fixed after we saw the miss. On the 12 real packages the
  71. fix added no findings (none of them destructure `process.env`). A second fix in the same pass, for
  72. `process.env.X?.trim()` chains (REA reports them with a longer property path), added one env var to firecrawl; its
  73. row and the grep comparison below are re-measured with both fixes.
  74. - The planted code is not obfuscated beyond one base64 string. A fixture score says nothing about recall on real
  75. malware.
  76. ### 12 real MCP server packages from npm
  77. Versions pinned in `targets.json`; numbers from `results/measured.json`. "REA coverage" is REA's own status: `partial`
  78. means its semantic pass hit its limits on that package; `unknown` means REA did not flag it partial. "REA s" is wall
  79. time on one laptop and varies run to run; every other column reproduced exactly from a fresh clone (pinned tarballs,
  80. REA run from scratch).
  81. | package | version | files | REA coverage | REA s | env | secret? | env not in README | hosts named | hosts not in README | file r/w | proc | eval |
  82. | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
  83. | @modelcontextprotocol/server-filesystem | 2.2.0 | 10 | unknown | 3.4 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 0 |
  84. | @modelcontextprotocol/server-memory | 2.1.0 | 2 | unknown | 2.3 | 1 | 0 | 0 | 0 | 0 | 5 | 0 | 0 |
  85. | @modelcontextprotocol/server-sequential-thinking | 2.1.1 | 3 | unknown | 1.9 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
  86. | @modelcontextprotocol/server-everything | 2.2.1 | 50 | unknown | 4.3 | 5 | 0 | 1 | 2 | 1 | 2 | 0 | 0 |
  87. | @modelcontextprotocol/server-github | 2025.4.8 | 12 | unknown | 2.9 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
  88. | @modelcontextprotocol/server-brave-search | 0.6.2 | 1 | unknown | 1.8 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
  89. | @modelcontextprotocol/server-puppeteer | 2025.5.12 | 1 | unknown | 1.8 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
  90. | @upstash/context7-mcp | 4.5.1 | 27 | unknown | 4.2 | 22 | 3 | 12 | 6 | 1 | 2 | 0 | 0 |
  91. | firecrawl-mcp | 3.38.0 | 8 | unknown | 13.7 | 25 | 4 | 14 | 8 | 2 | 2 | 0 | 0 |
  92. | @notionhq/notion-mcp-server | 2.6.1 | 15 | **partial** | 21.7 | 6 | 2 | 2 | 5 | 3 | 2 | 0 | 0 |
  93. | tavily-mcp | 0.2.22 | 1 | unknown | 2.1 | 3 | 1 | 0 | 2 | 0 | 0 | 0 | 0 |
  94. | mcp-remote | 0.16.5 | 5 | **partial** | 29.0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 1 |
  95. What the counts show, not a verdict: no package starts a child process; every secret-looking env var is the
  96. service's own credential (`BRAVE_API_KEY`, `NOTION_TOKEN`, `FIRECRAWL_API_KEY`, ...) or a secret for its hosted-server
  97. mode (`MCP_DELEGATED_CREDENTIAL_SECRET`, `OPENAI_APPS_CHALLENGE_TOKEN`, ...); the one `new Function`
  98. (mcp-remote, `dist/proxy.js:7261`) is bundled Ajv compiling a JSON-schema validator. "Not in README" items are mostly
  99. hosting and config knobs (ports, OAuth issuers, proxies) of packages that also ship a hosted server.
  100. ### Our layers vs grep (same files, 12 real packages, matched by category + file + line)
  101. | found by both | only our layers | only grep | of which: comments | URL strings | regex `.exec()` | localhost | real code our layers missed |
  102. | --- | --- | --- | --- | --- | --- | --- | --- |
  103. | 139 | 12 | 424 | 21 | 270 | 52 | 10 | **71** |
  104. **Plainly: on real packages our layers added little that grep did not already find.** The 12 we found and grep did
  105. not are firecrawl's API client calls (`client.http.post(...)`), which the grep rules do not cover. What REA buys is
  106. precision (no comment, string or regex hits; 0 vs 7 false positives on the clean twin) and structure (imports per
  107. file, resolved literals, exact ranges). grep reached 71 real code lines our layers missed: 28 in firecrawl (24 `client.http.get(...)`
  108. calls and 4 `.fetch(...)` on framework objects), 2 in context7, and 41 in the two packages where REA's semantic pass returned partial coverage
  109. (19 in notion's 1.4 MB minified `bin/cli.mjs`, 20 in mcp-remote's 1.7 MB bundled chunk, 2 elsewhere in mcp-remote). URL-string hits are covered by the AST host layer
  110. in the report.
  111. ## Limitations
  112. - **Static only.** It reports what the shipped code *can* do, not what it does at runtime. Not seen: computed names
  113. (`process.env[name]`, `const { env } = process; env.X`, `...rest` from `process.env`), decoded or obfuscated URLs
  114. and code, code downloaded at runtime, native addons, and dependencies (they are not in the tarball).
  115. - **Large minified bundles:** REA's coverage is partial on 2 of 12 packages even with raised node ceilings; findings
  116. there are incomplete (see the 41 lines above).
  117. - **Names, not data flow.** It does not trace which env var or file is sent to which host.
  118. - **"Not in README"** is a text match on names and domains; a README can name a host without disclosing what is sent.
  119. - **Fixture numbers are on our own fixture** (see above). Real-package numbers are counts, not verified behaviour.
  120. - **Dependency weight:** `rea-agents` is a general reverse-engineering toolkit (about 140 MB installed). It is pinned
  121. to 6.7.0, the version measured; `npm audit` reports advisories in its transitive dependencies that a newer
  122. `rea-agents` release addresses. Bumping it means re-measuring.
  123. - **Fetching:** the argument is passed to `npm pack` (with `--ignore-scripts`); give it registry packages.
  124. Symlinks inside a package are not followed.
  125. - No LLM step is used.
  126. ## Name
  127. Unrelated to the `mcp-xray` package already on npm (a debugging proxy). If this is published it will be
  128. `@agentwik-labs/mcp-xray`.
  129. ## Layout
  130. `bin/` CLI · `src/` analyser (REA runner, facts, AST layer, grep baseline, README claims, scoring, report card) ·
  131. `fixtures/` our twins + frozen `truth.json` · `test/` · `scripts/` fetch, build reports, record demo · `results/`
  132. measured JSON · `reports/` HTML cards · `demo/` video, poster, `hub.json`.
  133. ## License
  134. MIT, see [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.