web-security-mcp

Public

Passive web security review for LM Studio. Inspect HTTP headers, CSP, cookie attributes, SRI, and static HTML while separating observed facts from hypotheses and conditional risks. Save complete JSON reports locally and generate fixed Japanese risk explanations to reduce unsupported claims.

15 Downloads

README

Web Security MCP

Passive web security review for LM Studio, with observed evidence, unverified conditions and complete local JSON reports.

Publisher: yuanjumay · Version: 0.6.0 · License: MIT

This is an original plugin. It is not an Advanced-series fork. The LM Studio tools provider runs the same Python scanner used by the standalone Web Security MCP.

What it does

  • Fetches one public HTTP(S) URL using GET and a limited redirect chain.
  • Reviews response headers, CSP directives, final-response Set-Cookie attributes, static forms, external script references, SRI candidates and mixed-content references.
  • Separates observed facts from hypotheses, unverified required conditions, conditional impact and recommendations.
  • Generates Japanese tables and fixed conditions/impact/caveats in review format 3.0 to reduce model paraphrasing errors.
  • Saves the complete UTF-8 JSON before returning it. saved_report reports the save outcome and absolute path.

It does not execute JavaScript, render a browser, submit forms, crawl a site, attempt exploits, attack credentials or query a CVE database. Missing hardening is not proof of XSS, CSRF, account takeover or compromise. The legacy configuration score is not a safety certification. Review the generated prose before acting on it.

Install in LM Studio

After this plugin is published, install yuanjumay/web-security-mcp from Integrations, or use:

lms get yuanjumay/web-security-mcp

Python 3.10+ must be installed separately. Windows with Python 3.12 is the tested environment. LM Studio supplies the Node runtime; this plugin does not download Python itself. macOS/Linux paths are supported by the launcher but have not been tested on those systems.

During dependency installation, the optional setup hook creates a dedicated Python environment under ~/.lmstudio/web-security-mcp and installs the bundled python/requirements.txt. Initial setup requires internet access to the Python package index. Later website scans require only target-site access. The environment is outside the plugin folder so updates do not replace it.

If automatic setup did not run or Python was missing, install Python and run npm run setup from this plugin's folder. Explicit setup reports failure instead of silently succeeding. The plugin remains loadable and shows a setup message if its Python environment is unavailable.

Alternatively, set Python executable to the absolute path of an existing Python executable that already has all dependencies from python/requirements.txt. This setting is an executable path, not a shell command. It supports paths with spaces.

For example, an existing standalone installation may use C:/Tools/web-security-mcp-env/Scripts/python.exe; that machine-specific path is optional and is not the plugin default.

Report directory

Leave Report directory empty to save in web-security-reports inside the chat's LM Studio working directory. Or select an absolute directory path in the plugin settings. Reports are never automatically deleted and may contain URLs, cookie names and other site metadata; cookie values are masked by the scanner. Choose a directory you want to keep for your review records.

If the old mcp/web-security integration is installed, enable either it or this Hub plugin for a chat, rather than both copies of the same tools.

Tools

ToolPurpose
scan_urlInspect one public URL and save complete JSON. include_review_markdown defaults to false.
explain_capabilitiesReturn checks, limits and the configured report directory without fetching a site.

Private, loopback, link-local and other non-public IP targets are blocked. Each redirect target is checked. DNS validation is not connection-pinned, so DNS rebinding is a known limitation; use trusted targets you own or are authorized to assess. This plugin is a defensive review aid, not a penetration-test certificate.

Replace the earlier Web Security MCP instructions with the complete text in MODEL_PROMPT.md. Do not append repeated rules. The file is also included in the installed plugin folder.

Keep review.fixed_tables_markdown, each row's protected_markdown, and review.mandatory_caveats_markdown unchanged. English source findings remain available in the complete JSON, but the protected Japanese rule text should not be translated again. Free-form observations, hypotheses and recommendations still require manual review.

An example request:

https://example.com をWeb Security MCPで診断してください。
観測できた事実と推測を分離してください。
各指摘の成立条件と条件付き影響を保持し、防御側の修正方法を提示してください。

The result covers only the fetched response and static HTML. Header presence does not prove browser enforcement; a preload token does not prove HSTS list membership; SRI attributes do not prove a valid hash, CORS eligibility or successful script execution.

Developer and publishing instructions

This folder is the Hub artifact, including manifest.json, package.json, package-lock.json, TypeScript entry, Python backend and tests. There is no dependency on the developer's C:/Tools installation.

npm install
npm run typecheck
npm test
lms dev

lms dev is for local development. To install a local copy instead, use lms dev --install. Stop the development process when done.

To publish, sign in to the intended account and check it before pushing:

lms whoami
lms push --write-revision

On Windows, publish.ps1 performs the account/manifest checks and invokes the same interactive lms push --write-revision. Run it only when you intend to publish the prepared package.

The manifest identifies yuanjumay/web-security-mcp. lms push uploads publicly; the preparation of this package does not itself publish it. Keep node_modules, .lmstudio, environments, live reports, local logs and credentials out of the upload. The supplied .gitignore excludes generated/runtime content.

Official LM Studio documentation: Plugin publication, lms push.

Recovery

  • Missing Python or packages: install Python and run npm run setup, or select a prepared Python executable.
  • Interrupted setup: confirm there is no running setup/Python package installation, then remove only setup.lock inside ~/.lmstudio/web-security-mcp and retry npm run setup.
  • Broken runtime after a Python installation was moved: choose a working prepared Python executable, or move the dedicated environment directory shown in the setup output aside and run setup again. Do not remove saved report directories.
  • Website fetch/decompression error: retain the exact error and target URL. Do not infer findings when observations were not obtained.
  • Display/copy truncation: use the file in saved_report.path; it contains the complete result even if the client display is shortened.

Source layout

src/: LM Studio registration, settings and two tools. scripts/: portable setup/process launcher. python/: unchanged scanner plus a one-request bridge. tests/: Hub wrapper regressions. MODEL_PROMPT.md: Japanese report instructions. VALIDATION.md: scope and verification record.