Back to Browse

Xwatch MCP Server

Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Free local security checks for coding agents: scans git changes, alerts only on proven findings.

About

Free local security checks for coding agents: scans git changes, alerts only on proven findings.

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

5 files analyzed · 1 issue 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.

env_vars

Check that this permission is expected for this type of plugin.

file_system

Check that this permission is expected for this type of plugin.

Shell Command Execution

Runs commands on your machine. Be cautious — only use if you trust this plugin.

What You'll Need

Set these up before or after installing:

Colon-separated absolute folders XWatch may scan (set to where your code lives).Optional

Environment variable: DH_MCP_ALLOWED_ROOTS

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "xwatch": {
      "command": "npx",
      "args": [
        "-y",
        "@xtarwall/xwatch@0.1.3"
      ],
      "env": {
        "DH_MCP_ALLOWED_ROOTS": "your-dh-mcp-allowed-roots-here"
      }
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

XWatch: open-source app security for coding agents that alerts only on a proven exploit

License: AGPL-3.0 npm xtarwall/xwatch MCP server

XWatch is a free, open-source security check that runs before you push. It reads what changed in your git repo, works out which security risks the change reaches, and returns findings your coding agent can act on, with a fix. It raises an alert only when a test actually reproduced the problem: no exploit, no alert. It runs on your laptop, in CI, or inside Claude Code, Codex and Cursor as an MCP server, with your own AI key. Nothing is hosted.

What it does

  • Change-aware. Scans staged, unstaged and untracked changes against HEAD or a base branch, not the whole repo every time.
  • Four honest states. Every finding is Confirmed (a test reproduced it, with proof), Suspected, No issue or Not assessed. Only Confirmed is an alert.
  • Passive by default. Nothing is executed against anything until you give consent for one named target and a live scope grant; active tests run only against the short-lived copy you name, never production.
  • Your key, your machine. Anthropic, OpenAI, Google Gemini or Groq. With no key set, every model call goes to an offline mock and costs nothing; a paid call needs a run budget you set.
  • Built for the flaws that cost money. Free credits drained, browser-only quotas, AI endpoints anyone can call on your bill, one tenant reading another's data.

The engine behind it, measured

These are results of Xtarwall's engine (the recipe layer and the full engine), not of an xwatch run on your machine. XWatch carries the same "no exploit, no alert" rule. Last re-run: 29 Nov 2026.

Public test appPinned commitClasses found, of those in our test planSafe controls that raised an alertRun layer
crAPI: REST API with a shop, coupons and a store creditb5fc307f3e5f5 of 50 of 5Full engine: proof stored per finding, signed ledger
VAmPI: REST API (Flask)f16052dce83f5 of 50 of 5Recipe layer, then the full engine with a signed ledger
DVGA: GraphQL API (Flask)a961308c02d16 of 60 of 6Recipe layer (no ledger on this run)
Total16 of 160 of 16
  • 16 of 16 classes confirmed by running the exploit (crAPI 5 of 5 · VAmPI 5 of 5 · DVGA 6 of 6), with 0 of 16 safe controls raising an alert.
  • 3 of 3 money flaws proven on crAPI, each with a stored proof in a signed ledger of 35 hash-chained events.
  • Recall is per app, against the classes in our test plan for that app, not against every weakness the app documents. crAPI documents 18 challenges; this run attempted 4 of them and confirmed all 4. The others were not attempted, so they count neither as found nor as missed.

Definitions, pinned versions and misses: how we measured.

Try it: one command, a real proof

The demo boots a fictional vulnerable app, attacks it, and checks that the safe version of each feature stays quiet. Offline, no AI key, no spend.

git clone https://github.com/xtarwall/xwatch
cd xwatch
node --experimental-strip-types demo/run.ts

It prints the proven attacks and the false alarms, then PASS (or exits non-zero on any failure).

Install

Requirements: Node.js 22.6 or newer and git 2.40 or newer.

npx -y @xtarwall/xwatch mcp          # run it without installing
npm install -g @xtarwall/xwatch      # or install the `xwatch` command
xwatch --help

Or use the one-line installer shown at https://xtarwall.com/watch/.

From a clone of this repository: run npm install once, then node --experimental-strip-types bin/dh.ts mcp (TypeScript runs through Node's type stripping). npm run build writes the compiled JavaScript to dist/.

Add it to Claude Code (Codex and Cursor are in Add it to your coding agent below):

claude mcp add xwatch --scope user -e DH_MCP_ALLOWED_ROOTS="$HOME/code" -- npx -y @xtarwall/xwatch mcp

Point it at your app

  1. Ask your agent to scan your changes. With nothing else set, you get a change summary and passive findings.
  2. Describe what to check: DH_CANDIDATES (your candidate list) and DH_TARGET (the target your grants name).
  3. To allow active tests on that one target: a live scope grant in DH_GRANTS, and DH_MCP_ACTIVE_CONSENT set to exactly DH_TARGET, confirming written authorisation (CONSENT.md).

Every variable is in Environment below.

Upgrade: XGuard and XShield

XWatch runs where you run it. The paid tiers run it for you, and go further:

  • XGuard: proof on every push. Attacks a short-lived copy of your app (never production) across all your repos, writes the fix, and keeps a signed, hash-chained record of each finding that you can re-check.
  • XShield: everything in XGuard, plus a wall around your live app: known attacks blocked, repeat sources slowed, decoy keys that alert when touched. Starts in observe mode; alerts at any hour.

Compare plans on xtarwall.com/pricing.

What it doesn't cover yet

XWatch is not the full engine: no hosted checks on every push, no live protection, and its findings output is redacted (no proof-of-concept, only a digest prefix). The harness behind the numbers above and the ledger verifier are not public yet. None of those results come from a customer's app. All stated gaps.

Add it to your coding agent

Every agent runs the same command, xwatch mcp (or npx -y @xtarwall/xwatch mcp without a global install). DH_MCP_ALLOWED_ROOTS limits which folders may be scanned; set it to where your code lives.

Claude Code:

claude mcp add xwatch --scope user -e DH_MCP_ALLOWED_ROOTS="$HOME/code" -- npx -y @xtarwall/xwatch mcp

Codex:

codex mcp add xwatch --env DH_MCP_ALLOWED_ROOTS="$HOME/code" -- npx -y @xtarwall/xwatch mcp

Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project), and any other MCP client that takes a JSON config:

{
  "mcpServers": {
    "xwatch": {
      "command": "npx",
      "args": ["-y", "@xtarwall/xwatch", "mcp"],
      "env": { "DH_MCP_ALLOWED_ROOTS": "/path/to/your/code" }
    }
  }
}

Configs written for 0.1.x that run xtarwall-watch mcp keep working: the alias runs the same program.

The four tools

MCP toolA2A skillWhat it does
xtarwall_scan_changesscan_changesLists staged, unstaged and untracked changes in a local repo (against HEAD or the merge-base of baseRef), finds which configured candidates the change reaches, assesses them and returns four-state findings plus the signed-ledger check. Arguments: repoPath (absolute local path), baseRef?, paths?, active?.
xtarwall_get_findingsget_findingsThe last scan's findings, redacted: no PoC, no target, no evidence; only a 16-hex-character prefix of the proof digest.
xtarwall_explain_findingexplain_findingOne finding (id like f1): what its state means, the CWE, what to do next.
xtarwall_statusstatusModel mode and vendor, which model key variables are set (names only, never a value), the run budget, candidates, grants, whether active tests are allowed, the ledger.

Findings have four states: Confirmed (a test actually reproduced it, with proof), Suspected, No issue and Not assessed. Only Confirmed is an alert.

Passive by default; active tests need consent per target

Nothing is executed against anything unless all of these hold:

  1. the agent calls xtarwall_scan_changes with active: true;
  2. you set DH_MCP_ACTIVE_CONSENT to exactly the value of DH_TARGET (your confirmation that written authorization for that one target is signed and the owner has a backup; see CONSENT.md);
  3. DH_GRANTS holds a live active scope grant for that target.

Otherwise every grant is capped at passive: the result is Suspected or Not assessed. Active tests run only against the ephemeral copy that your candidate's provisioner names. Tool arguments can narrow a scan but cannot grant scope: target, grants, candidates and keys come only from the environment you set.

Repo access is confined: repoPath must be an absolute local path in a git work tree (URLs and git@host: remotes are refused), symlinks that leave the repo are dropped, and DH_MCP_ALLOWED_ROOTS narrows which folders may be scanned. Git runs without a shell, with hooks, fsmonitor, filters, textconv and global config off, and a timeout.

Your own AI key

XWatch calls the model provider you choose, with your key, from your machine. Supported providers:

ProviderKey variable (or <NAME>_FILE with an absolute path to a key file, preferred)Model id example
AnthropicANTHROPIC_API_KEYclaude-haiku-5-5
OpenAIOPENAI_API_KEYopenai:gpt-5-nano
Google GeminiGEMINI_API_KEYgemini-3.5-flash-lite
GroqGROQ_API_KEYgroq:openai/gpt-oss-20b
  • XTARWALL_MODEL_CHEAP and XTARWALL_MODEL_FRONTIER pick the model for each tier as [vendor:]model. Left unset, XWatch uses the defaults of the first provider that has a key (Anthropic, OpenAI, Google, then Groq).
  • A paid call also needs DH_RUN_BUDGET_CENTS (whole cents per run). Without it every paid call is refused before the provider is called, so nothing is spent.
  • Models are priced from a dated table. For a model the table does not know, set XTARWALL_MODEL_CHEAP_PRICE / XTARWALL_MODEL_FRONTIER_PRICE to "<in $/1M>,<out $/1M>"; without a price an unknown model is refused.
  • A vendor-neutral DH_MODEL_API_KEY (or XTARWALL_MODEL_KEY_FILE) is used only when every tier names the same vendor, so a key is never sent to another vendor's host. There is no base-URL variable: hosts are fixed.
  • With no key set, every model call goes to an offline mock and costs nothing.

xtarwall_status shows which vendor and models are in use and which key variables are set, never their values.

Environment

VariableMeaning
DH_CANDIDATESAbsolute path to a module that export defaults your candidate list (needs DH_TARGET). For the shape, see the test fixture. Without it a scan is a change summary only.
DH_TARGETThe scope target your grants name. Shown only as a sha256 prefix.
DH_GRANTSAbsolute path to a JSON array of {orgId, target, tier, expiresAt} scope grants.
DH_MCP_ACTIVE_CONSENTSet to the exact DH_TARGET to allow active tests on it.
DH_RUN_BUDGET_CENTSRun budget in whole cents (unset = no paid model call).
DH_ORG_ID, DH_APPLICATION_IDLedger ids (defaults local, local-repo).
DH_KEY_DIRAbsolute key directory for a persistent ledger signing key.
DH_MCP_LEDGER_DIRAbsolute directory (outside the repo) to also write each run's sealed chain.
DH_MCP_ALLOWED_ROOTS:-separated absolute folders that may be scanned.

A .ts module in DH_CANDIDATES is loaded by your own Node, so it needs a Node that strips types for files outside node_modules (22.18+ or 23.6+ by default); a .js or .mjs module works everywhere.

Command line and CI

xwatch mcp                                    # stdio MCP server (what coding agents run)
xwatch a2a serve [--host h] [--port p] [--allow-remote]   # A2A 1.0 agent
xwatch scan [--repo dir] [--base ref|auto] [--sarif file] [--comment file] [--json] [--fail-on confirmed|never]

xwatch scan runs one change scan from the command line or CI. It uses the same logic and the same gates as the scan_changes tool, and takes its config from the same environment variables. It is passive unless you also pass --active and the environment grants it (see above).

  • --repo: the repo folder (default: the current folder).
  • --base: diff against the merge-base of this branch, tag or commit and HEAD (default: HEAD, which means uncommitted changes). auto means the last commit when it exists, else uncommitted changes.
  • --sarif: write SARIF 2.1.0 to this file. Only Confirmed findings become results.
  • --comment: write the pull-request comment as Markdown. The proof is always redacted there; finding text is escaped.
  • --json: print the redacted result as JSON.
  • Exit codes: 0 ok, 1 a Confirmed finding (with --fail-on confirmed, the default), 2 error or bad arguments.
  • Code under review never configures its own review: DH_CANDIDATES (a module XWatch imports), DH_GRANTS (scope grants), DH_KEY_DIR and DH_MCP_LEDGER_DIR are refused when they sit anywhere in the scanned repo's work tree, and output files must be written outside it. Output files are written atomically and never through a symlink.

As an A2A agent, for another agent or a CI job:

DH_A2A_TOKEN_SHA256_FILE=~/.xtarwall/a2a.sha256 xwatch a2a serve --port 8787

The Agent Card is at GET /.well-known/agent-card.json; JSON-RPC 2.0 is at POST /a2a/v1 with a bearer token whose sha256 is in that file. It binds to loopback unless you pass --allow-remote. Clients send A2A-Version: 1.0. In CI, start it in the job, call scan_changes on the checked-out repo, and fail the job on a Confirmed finding.

GitHub Action

Add XWatch to your pull requests with one workflow file, .github/workflows/xwatch.yml:

name: XWatch
on: pull_request            # never pull_request_target
permissions:
  contents: read
  security-events: write    # SARIF upload to code scanning
  pull-requests: write      # the one XWatch comment
jobs:
  xwatch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          fetch-depth: 0              # the base commit must exist
          persist-credentials: false  # XWatch refuses a repo whose git config pulls in other files
      - uses: xtarwall/xwatch@v0

It scans the pull request's changes against its base, writes SARIF and uploads it to code scanning, posts or updates one comment on the pull request, and fails the job only on a Confirmed finding. The free mode needs no secret: it is passive, makes no network call for the scan and spends nothing.

InputDefaultMeaning
basethe pull request's base sha (on push: the before sha)Commit or ref to diff against.
fail-onconfirmedconfirmed fails the job on a Confirmed finding; never only reports.
upload-sariftrueUpload SARIF to code scanning. Set false on a private repo without code scanning.
commenttruePost or update one comment on the pull request.
ai-key(none)Your own model key, from a secret. Used only together with run-budget-cents.
ai-provideranthropicanthropic, openai, gemini or groq.
run-budget-cents(none)Spending cap per run in whole cents. Unset means no paid model call.

On a private repo, also add actions: read to permissions: (the SARIF upload needs it there). The comment is posted with the job's own GITHUB_TOKEN, so there is always exactly one XWatch comment per pull request.

Outputs: exit-code, confirmed, sarif-file. Candidates, grants and the other variables in the table above come from the job's env:, and must point outside the checkout (for example a file your workflow writes under $RUNNER_TEMP from a secret or a trusted branch). Without DH_CANDIDATES a run lists the changed files and assesses nothing, and the comment says so (it never shows a pass for a run that assessed nothing). On a pull request from a fork (or from Dependabot) the token is read-only, so the upload and the comment are skipped with a notice and the result is in the job summary. Every input reaches the shell only through environment variables, and third-party actions are pinned to full commit shas.

The SARIF 2.1.0 and pull-request comment renderers are also library modules (dist/engine/src/report/).

Signed record

Every scan seals start and finish events (plus each assessment's own events) onto an Ed25519 hash-chained ledger and verifies the chain before answering.

Tests

npm test

Hosted plans

XWatch is free and open source. XGuard and XShield are the hosted, paid plans: https://xtarwall.com/pricing/.

Security and licence

Report a vulnerability in XWatch privately as described in SECURITY.md. Use XWatch only on systems you own or are authorized to test (CONSENT.md).

XWatch is licensed under the GNU Affero General Public License, version 3 only (AGPL-3.0-only). In plain words:

  • Free to use and modify. Run it on your laptop, in CI or inside your coding agents, and change it as you like.
  • Share your changes if you serve them. If you run a modified version as a service for other people (over a network, for example), you must publish your changes under the same licence. The same applies if you hand a modified copy to someone else.
  • Commercial licences on other terms are available on request: email licensing@xtarwall.com.

LICENSE holds the full, binding text and NOTICE the copyright notice; this summary does not replace them.


XWatch is part of Xtarwall. An Xtarvrse company. Licence: AGPL-3.0.

Reviews

No reviews yet

Be the first to review this server!