惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
小众软件
小众软件
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
Jina AI
Jina AI
云风的 BLOG
云风的 BLOG
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Engineering at Meta
Engineering at Meta
量子位
美团技术团队
I
InfoQ
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale

Hacker News: Show HN

Show HN: Quit All, an iOS app with an SOS mode for cravings GitHub - dmichael-fastly/fastly-examples-live-betting-fanout: A working example of distributing live game scores and betting odds to millions of concurrent users without overwhelming origin — built on Fastly's edge stack. 404 Page Generator — Make your 404 page a needle-mover Show HN: Neuz, a self-hosted news dashboard curated by Claude Senior SWE interview prep — Semicolony GitHub - DefangLabs/pulumi-defang: Defang Pulumi providers - Take your app from Docker Compose to a secure and scalable cloud deployment with Pulumi. OpenYardage — Printable Golf Yardage Books GitHub - uAIex/KeyMouseRecorder Ship Mobile Features Instantly — Nativeblocks SDUI Platform CoreMem - Your context, any AI agent Show HN: AI-Mirror - Self-optimising ranking engine for modern web applications. Show HN: Mechs.lol – a free, web-based autoshooter game SnapMeasureAI — AI Body Measurements For The Perfect Fit Show HN: Accurate body measurements from two images GitHub - jonhermansen/darnix: Darwin system built with Nix Show HN: My dad is a forensic accountant. I automated ~62% of his job Mobile presentations in 60 seconds - Flow2 GitHub - bigmacfive/appbun: Turn any webpage into an inspectable Electrobun desktop app with one command. Show HN: Interactive first-principles climate physics simulation with explainer Show HN: Lilo – An open source personal AI assistant that lives in Telegram Pablo. Recreate any UI component from the web. TinyCld - Your cloud, your rules GitHub - prisma/prisma-next Show HN: Blacknode – Visual workflow builder Claude can drive via MCP Anime AI Studio | Create AI Anime Dramas & Videos from Ideas Charm - Autocorrect that actually works Show HN: A botless meeting recorder and summarizer that runs in the browser GitHub - ninjahawk/swarmsim: Computational simulations of emergent flocking, phase transitions, and predator-prey dynamics GitHub - mljar/mercury: Create web apps from Python notebooks Show HN: Agent Capsule – versioned checkpoints for agents you run GitHub - yicheng47/runner: An editor for teams of local coding agents (Claude Code, Codex, and friends) iPhone 版“Today” - App Store GitHub - scosman/videowright: Build animated explainer videos with your coding agent Show HN: Auto – Execute cross-venue crypto strategies from one prompt GitHub - geoff1111/origin: A book examining Young-Earth-Creationism and naturalism as competing civilizational worldviews. Show HN: LocalPanel – Manage any SSH server from Mac/Windows, no server agents iPhone 版“Today” - App Store wwwatch · AI intel for builders Mnestica — AI-Powered Memory System GitHub - sumant1122/ringlog: A highly optimized, thread-per-core message broker built from scratch in Rust, utilizing io_uring for zero-copy, low-latency commit log streaming. Stacktower - AI-Powered Dependency Analysis | Stacktower Repo readiness infrastructure for developer onboarding and AI agents HeadlessPDF – HTML to PDF REST API Show HN: Myco – coordinate Claude and DeepSeek and other LLMs in one agent swarm Databricks — DecisionBox | DecisionBox VisuallyJs GitHub - czl9707/token-aware-image: A Skill Creates Images Respecting Design Tokens GitHub - unprovable/ShadowCat: Single file optical file transfer using a browser AgentRecall — Persistent Memory for AI Agents GitHub - ankurokok/hr: A colored bar that marks where you are in your terminal. Interactive AI Chat - Chrome 应用商店 Show HN: We're building an open-source battery [video] GitHub - The-CISO-Network/pqc: Post-Quantum Cryptography sdk-gen — your Stainless replacement GitHub - evilmarty/duex: Duex is a Go-based terminal utility for visualizing and analyzing disk usage, featuring interactive navigation, accurate sizing, and real-time feedback. Show HN: I threw away my analytics dashboard and replaced it with 42 MCP tools GitHub - getnao/sylph: The open-source company brain. Run your entire company with AI agents, skills, and a self-improving context. inkoscribe - Private Local Audio Transcription for macOS KVBoost — Pitch Deck Show HN: TLS Certificate Management and PKI GitHub - alonsovm44/tc-lang: A minimalistic portable assembly lenguage Roughform — 3D Modeling & Pose Reference Show HN: Spec-Driven Development Workflow for Claude Code Pocket TTS - WebAssembly Demo Deputies | Background agent control plane Mixfont — Make Any Font You Can Imagine Show HN: Traditional Card Game Website Show HN: Baby's First Cards – real photo flash cards for toddlers AI Local Recorder App - App Store Show HN: Agent-estimate, how long a coding task takes, at agent speed Smithereen — your social network Lumox - Wireless device screen mirroring for Mac Show HN: A Turing machine simulating a Turing machine simulating a... Show HN: Onda – a cross-platform alternative to DSView for DSLogic analyzers [video] Show HN: Glowing balls falling through a spinning maze GitHub - eigenpal/docx-editor: Open-source WYSIWYG .docx editor library with canonical OOXML, tracked changes, and real-time collaboration. ANML Foundation — Agentic Notation Markup Language Datasette Agent GitHub - simd-ai/agent ACAV: Overview Best AI Audiobook Maker | Warblize dhrive: Squarespace for mobile apps Kalerum — Booking platform for service businesses headroom — Built for the Rekordbox → CDJ workflow GitHub - fireharp/coherence: Git-native drift detector for agent-assisted repos: catch stale docs, ADRs, tests, metrics, and generated artifacts. Jig's Saw Puzzler by abionic Show HN: Synrix: hardware-verified memory routing for edge AI agents GitHub - bjcoombs/ai-native-toolkit: Claude Code configuration and customizations Show HN: Patchmark – LSP for reviewing code changes/diffs in text Reader view — paste a link to read distraction-free | Readplace GitHub - ghetea-patrick/filorithm: A fluent Python eDSL for high-level directory manipulation. It utilizes chainable filtering pipelines and intuitive operator overloading to replace boilerplate file system code with clean terminal-like actions. OSINT Arena | Open Source Intelligence Challenges Two Witness Shop Show HN: From one Claude agent to a fleet – in five small steps Show HN: Canonry tracks how AI cites you – agent-first, open source Sound Test Online – Check Speakers & Headphones Slick – Fast, Private, and Reliable Search GitHub - securient/ideviewer-oss: Security scanner for developer workstations — detects IDE extension risks, AI tool permissions, plaintext secrets, and vulnerable dependencies across VS Code, Cursor, JetBrains, and more. Computer Police Show HN: Agent.email – sign up via curl, claim with a human OTP
GitHub - allenwu-blip/mcpaudit: Static pre-install security scanner for MCP (Model Context Protocol) servers — `npx mcpaudit <path>` flags command injection, credential/env exfiltration into LLM-visible output, over-broad filesystem/tool scope and dynamic eval before you wire a server into your agent.
allenwu06 · 2026-05-23 · via Hacker News: Show HN

A quick security X-ray for AI agent plugins, to run before you plug one in.

An MCP server (MCP = Model Context Protocol, the standard way to give an AI assistant new tools) is code you download and let an AI agent run. mcpaudit reads that code before you trust it and points out the dangerous bits — the quick safety check that doesn't really exist for these plugins yet.

npx allenwu-blip/mcpaudit ./path-to-an-mcp-server

No install, no setup, no API key, no internet needed. It reads the plugin's source code and its settings file and flags risky patterns, ranked by how bad they are, each with a concrete fix. It never runs the code it is checking — it only reads it.


Why

These plugins run with real power inside the AI agent's loop — they can get a shell, your files, and the network on your machine, and whatever a plugin's tools output flows straight back into the AI's context where it can steer what the AI does next. Published MCP servers get inconsistent security review before people wire them in — the 2026 surveys from dev.to and The Register give differing pictures of how widespread the risk is — but the failure modes are concrete: command injection, environment/credential leakage into LLM-visible context, and over-broad filesystem/tool scope.

mcpaudit exists so you can run a concrete check for those patterns yourself, in seconds, offline, before letting someone else's plugin run inside your agent.

Install / run

It's zero-install via npx. A local path is scanned fully offline:

# scan a server you cloned / vendored
npx allenwu-blip/mcpaudit ./vendor/some-mcp-server

# machine-readable output for CI / tooling
npx allenwu-blip/mcpaudit ./server --json

# SARIF v2.1.0 (a standard scan-results format GitHub understands) —
# upload it so findings show in GitHub's Code scanning tab
npx allenwu-blip/mcpaudit ./server --sarif > mcpaudit.sarif

# stricter gate: any high or critical fails the command
npx allenwu-blip/mcpaudit ./server --fail-on high

# continuous monitoring: accept current state, then gate only on NEW
# regressions (offline, no accounts) — see "Continuous monitoring" below
npx allenwu-blip/mcpaudit ./server --baseline-write .mcpaudit-baseline.json
npx allenwu-blip/mcpaudit ./server --baseline .mcpaudit-baseline.json

Scanning by bare package name (npx mcpaudit some-mcp-pkg) needs a registry/tarball fetch wired up; the published build asks you to pass a path instead (it does not silently do nothing and does not hit the network). The path scan is the fully-functional path today.

Exit codes (so you can wire it into CI)

CI ("continuous integration" — the automated checks that run on every code push) reads these exit codes:

code meaning
0 scan completed, gate not tripped. Also internal error — see below.
1 scan completed and a finding met/exceeded --fail-on (default high).
2 usage error (bad arguments).

Fails open on purpose: if mcpaudit itself breaks (a bug, a folder it can't read), it prints a loud error and exits 0. A security checker that is itself broken should not block every build in your project. If you want it to be a hard stop, make it a required check with --fail-on set, so a missing or zero result is visible rather than silently passing.

What it detects

This is the detailed reference for developers. The rules are fixed and give the same answer every time (no AI, no guessing). Each finding has a stable id, a severity (how serious), the exact file:line:col location, a plain explanation of why it fired, and how to fix it.

id severity what it flags
MCP001 critical Command injectionchild_process exec/execSync/spawn/fork (or execFile with shell:true) built from a non-literal command (template interpolation, + concat, or a variable). A pure string literal does not fire.
MCP002 high Credential / env exfiltration to the LLMprocess.env flowing into a tool result text, a returned value, or a tool/handler description. Env read into a local used only for outbound auth does not fire.
MCP003 high Over-broad filesystem scope — an MCP manifest granting /, ~, a drive root, *, or a ../-escaping path as an allowed directory.
MCP004 medium Unrestricted tool scope — a wildcard tool allowlist ("*", ["*"], allowAllTools: true).
MCP005 high Dangerous dynamic eval — a bare global eval() / new Function(), or the vm builtin's runInThisContext/runInNewContext/runInContext/compileFunction, with a non-literal argument. eval("1+1") does not fire; a method of the same name on another object (mathExpr.compile(x), parser.eval(x)) does not fire; a userland-bound vm does not fire (provenance).
MCP006 medium Unpinned remote code executioncurl … | sh, npx …@latest, uvx, etc. in source strings or the manifest start command. A pinned pkg@1.2.3 does not fire.
MCP007 high Prototype pollution — a recursive/deep merge or deep-set (_.merge, defaultsDeep, setWith, deepmerge, …) from a non-literal source, or a computed obj[key]=v assignment where key can be __proto__/constructor. An inline-object-literal merge source and numeric array indices do not fire.
MCP008 high SSRF-able outbound requestfetch/axios/got/https.request with an attacker-influenceable URL origin (a bare variable, ${host} in the authority, or a leading-variable concat). A hardcoded origin with only the path/query varying ("https://api.x/v1?q=" + enc(q), `https://api.x/${id}`) does not fire.
MCP009 critical Hardcoded secret in source — a string literal that looks like a real credential (AWS/GitHub/Slack/Google key, an OpenAI- or Anthropic-style key, a PEM private key, a JWT). Obvious placeholders (your-…, XXXX, <…>, example) and comment-only mentions do not fire.
MCP010 high Path traversal in a file tool — an fs.* call whose path is a bare variable or a concat/template with no path.join/resolve/normalize/basename containment. Requires an fs binding (provenance). A pure literal path does not fire; a bare path variable whose nearest prior assignment is a path.join/resolve/normalize/basename expression (hoisted containment) does not fire.
MCP011 critical / high Unsafe deserializationnode-serialize/serialize-javascript unserialize/deserialize of non-literal data (critical, RCE), or js-yaml load() with the default schema (high). JSON.parse and yaml.load(x, { schema: yaml.JSON_SCHEMA }) do not fire.
MCP012 critical Dangerous npm lifecycle script — a preinstall/install/postinstall/prepare script that pipes a network download into a shell, base64-decodes into a shell, or is an obvious obfuscated one-liner. A normal build hook (tsc, node build.js, husky install) does not fire; a curl in a non-lifecycle script does not fire.
MCP013 critical Secret committed in a manifest — a credential pattern (as MCP009) embedded in package.json/mcp.json (e.g. an env block). Placeholders and ${VAR} references do not fire.
MCP014 medium / low Risky declared dependency — a git+/url/tarball dependency source that bypasses the registry/lockfile (medium); or, as a low advisory only, a dependency name one edit away from a popular package (typosquat shape). Static and offline — no registry/network and no CVE/malware claim is ever made.

The rules are intentionally conservative — they aim to avoid the obvious false-positive patterns (literal exec/eval, env used only for auth, scoped relative directories, fixed-origin URLs, path.join-contained file access, safe-schema YAML, placeholder secrets, normal build hooks, and scary tokens that are only in comments). The bundled borderline fixture is a legit MCP server full of code that looks dangerous and must produce zero findings; it is part of CI.

Output formats

flag format use
(default) human a developer reading the terminal before npx-ing a server
--json JSON CI/tooling (stable schema, summary counts); includes a baseline block when --baseline is used
--sarif SARIF v2.1.0 upload with github/codeql-action/upload-sarif@v3 to populate the Code scanning tab; each result carries the stable finding id as a partialFingerprint so GitHub de-dupes across runs
--monitor-json JSON (with --baseline) the structured monitoring record — the machine contract a hosted tier would consume; this build only prints it locally

Continuous monitoring (baseline diff — free, offline, no accounts)

A one-shot scan tells you today's state. A team usually wants "did anything get worse since we last reviewed this server?" That is a diff against a committed baseline — pure, deterministic, offline, no sign-up:

# 1. accept the current state into a baseline and commit it
npx allenwu-blip/mcpaudit ./server --baseline-write .mcpaudit-baseline.json
git add .mcpaudit-baseline.json && git commit -m "mcpaudit baseline"

# 2. in CI: re-scan and gate ONLY on NEW findings (regressions). An
#    already-triaged finding no longer re-breaks every build; a freshly
#    introduced one does.
npx allenwu-blip/mcpaudit ./server --baseline .mcpaudit-baseline.json --fail-on high

The baseline file is intentionally timestamp/host/user-free so re-writing an unchanged repo is byte-identical (clean, reviewable PR diffs); when a finding appeared is git's job, not the file's.

Note (honest scope): the hosted/continuous-monitoring product — a service that watches a server over time, alerts on a new critical, or shows a fleet view — is not in this repo. This OSS CLI ships only the baseline-diff mechanic and emits the machine record a hosted tier would consume (--monitor-json). There is no network call, no upload, no account, no billing anywhere in this codebase, by design.

GitHub Action

A thin wrapper around the same scan. Copy examples/mcpaudit.yml into .github/workflows/:

- uses: allenwu-blip/mcpaudit@v0
  with:
    path: "."
    fail-on: "high"
    sarif: "true"          # optional: write mcpaudit.sarif
    # baseline: ".mcpaudit-baseline.json"  # optional: gate on NEW only

It posts a GitHub annotation per finding and sets outputs (total, critical, high, medium, low, gate, plus new/fixed with a baseline and sarif-file with sarif: true). With sarif: true it writes a SARIF v2.1.0 file you upload via github/codeql-action/upload-sarif@v3 (see examples/mcpaudit.yml for the security-events: write permission and upload step). No token or secret is needed for the scan itself; the Action does no network I/O and never runs the scanned code. It fails open on internal error — make the job a required check for hard enforcement.

Limitations (read this)

mcpaudit reads code and matches known-dangerous patterns. It does not run the code in a locked box (a "sandbox") and it does not trace exactly how a value flows from input to a dangerous spot ("taint analysis"). Be clear-eyed about what that means:

  • It will miss things (false negatives). Obfuscated code, vulnerability reached through indirection/aliasing, dynamic require, behaviour that only manifests at runtime, or a malicious dependency several layers deep are largely out of scope. A clean result is not a security guarantee or an audit — review the server's tools and scope yourself.
  • It does not do taint tracking. It cannot prove a sink is reachable from tool input; it flags the dangerous shape and tells you to verify reachability. Conversely it deliberately under-reports to stay quiet: e.g. MCP010 does not flag path.join("./dir", x) even though a .. in x can still escape — full path-containment analysis is beyond a lexical scanner, so that is a known, accepted false negative, not a guarantee the call is safe. Treat every path.*/merge/fetch on tool input as worth a human look regardless of whether a rule fired.
  • Provenance-gated, conservative by design (favor a false negative over cry-wolf). A few rules deliberately stay quiet on idiomatic-safe shapes:
    • MCP005 fires only on a bare global eval( / new Function(, and on the vm builtin's runInThisContext/runInNewContext/runInContext/ compileFunction. A method call that merely shares those names — mathExpr.compile(x), parser.eval(x), engine.compile(tmpl), an ORM .run() — does not fire (it is not the global / vm). The vm.* sink is suppressed when vm is provably a userland binding (e.g. const vm = makeSandboxShim()). Bare eval(userInput) still fires by design — that is the sink.
    • MCP010 also treats hoisted containment as safe: when the fs.* path is a bare variable whose nearest prior assignment is built from path.join/resolve/normalize/basename(...) (e.g. const safe = path.resolve(BASE, path.basename(name)); fs.readFileSync(safe)), it does not fire. This look-back is the nearest declaration/ assignment of that identifier and is intentionally single-hop — a containment value passed through additional indirection (further aliasing, a helper return) is a known, accepted false negative (same stance as the path.join note above), not a safety guarantee.
  • It will sometimes be wrong (false positives). The rules use a lexical model (comments and static string text are excluded; template interpolation is treated as code). Unusual code can still trip a rule. Please report misfires — that is how it improves.
  • No accuracy/benchmark numbers are claimed. There is no published labeled corpus behind this tool, so it ships with no precision/recall or detection-rate figures, and it makes no claim about how it compares to any external survey of the MCP ecosystem.
  • The dependency layer is static and offline — and makes no CVE claim. MCP014 flags non-registry dependency sources and, as a low advisory only, names that are one edit from a popular package. It contacts no registry, bundles no vulnerability database, and asserts nothing about whether a given package/version is malicious or has a known CVE. Pair it with a real SCA/advisory tool (npm audit, OSV, Dependabot). Registry/tarball fetching for mcpaudit <name> remains an unimplemented, honest interface — the published build asks you to pass a path.
  • Scope is the documented MCP/Node patterns. JS/TS source + JSON manifests. Servers written in other languages, or that hide configuration outside the manifest, are not fully covered. Minified/bundled, binary/non-UTF8, and symlinked files are deliberately skipped (and surfaced as diagnostics) — audit the original source, not build artifacts.
  • It is one layer. Use it alongside dependency scanning, least-privilege configuration, and human review — not instead of them.

How it works

  • src/rules.js — the pure, deterministic analyzer (no I/O, no network, no code execution): 14 source/manifest rules. Fully unit-tested.
  • src/analyze.js — the only filesystem touch: walks the tree, never follows symlinks (cannot be steered out of the target), skips minified/binary/non-UTF8 blobs and pathological depth, never throws (errors are collected and returned), and never runs the project.
  • src/format.js — pure presentation: human, --json, and SARIF v2.1.0.
  • src/baseline.js — pure baseline build + diff for continuous monitoring; contains the documented // PAID TIER seam (no network/account code).
  • bin/mcpaudit.js / src/action.js — thin CLI / Action glue.

Finding ids are a deterministic hash of rule|file|line|col|message, so two distinct findings at the same location stay distinct and the id is stable across runs and machines — CI baselines, SARIF de-dup, and suppression lists are reproducible.

Development

npm ci
npm test          # vitest — no network, no API key required
node bin/mcpaudit.js test/fixtures/vulnerable-server   # try it
node bin/mcpaudit.js test/fixtures/vulnerable-server --sarif | head

Tests run against three fixture MCP servers — a clean one (zero findings), a vulnerable one (every one of the 14 rules fires with the right severity and location), and a borderline one (legit code that looks scary across all 14 rules and must stay at zero findings) — plus dedicated suites for SARIF schema correctness, baseline-diff behaviour, and adversarial hardening (symlink escape, minified/binary/non-UTF8, deep trees, never-throws).

Feedback

False positives and missed vulns are the most valuable input. See FEEDBACK.md: add the mcpaudit-feedback label to an issue, or use the issue template. Reports are captured verbatim — read exactly as written, never paraphrased.

License

MIT — see LICENSE.