Skip to main content
Glama

lockshield-mcp — Offline Multi-Lockfile SPDX, Supply-Chain & CycloneDX 1.5 SBOM MCP Server, CLI & GitHub Action

z121245017-ai/lockshield-mcp MCP server

Zero-dependency, 100% offline Model Context Protocol (MCP) Server, CLI, and GitHub Action enabling AI coding agents (Claude Desktop, Claude Code, Cursor, Windsurf, Antigravity) and pull-request CI pipelines to audit package-lock.json (v1/v2/v3), pnpm-lock.yaml, Cargo.lock, poetry.lock, and uv.lock for deal-blocking SaaS / On-Prem copyleft & source-available contamination (AGPL-3.0, SSPL-1.0, BUSL-1.1, FSL-1.1, Commons-Clause, CC-BY-NC), postinstall supply-chain traps & ecosystem typosquats, and deterministic EU Cyber Resilience Act (CRA) CycloneDX 1.5 JSON SBOM generation.

MCP Tools Exposed (stdio)

Tool

Purpose

Safety Annotations

audit_lockfile_compliance

Parses package-lock.json, pnpm-lock.yaml, Cargo.lock, poetry.lock, or uv.lock offline and evaluates transitive SPDX licenses (AGPL-3.0, SSPL-1.0, BUSL-1.1, GPL-3.0, dual OR/AND) plus supply-chain risks across saas, binary, or internal modes.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

evaluate_spdx_expression_policy

Evaluates single or compound SPDX boolean expressions ((MIT OR GPL-3.0-only), GPL-3.0-only AND MIT, Apache-2.0 WITH Commons-Clause) simultaneously across saas, binary, and internal deployment modes.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

scan_supply_chain_hazards

Detects preinstall/postinstall/hasInstallScript/requiresBuild hooks, cleartext http:// or unpinned Git origins, deprecated SHA-1 hashes, and Damerau-Levenshtein typosquats against top npm, PyPI, and Cargo packages.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

generate_cyclonedx_sbom

Emits deterministic CycloneDX 1.5 JSON SBOMs (bomFormat: "CycloneDX", specVersion: "1.5") with canonical purls, hexadecimal SHA-512/SHA-256 hashes, SPDX license objects/expressions, and optional Markdown due-diligence summaries.

readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false

Related MCP server: license-guardian

Quick Start (MCP Client & Local CLI)

# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/lockshield-mcp

# List MCP tool schemas from terminal
npx -y github:z121245017-ai/lockshield-mcp --list

# Audit a lockfile in SaaS mode and emit a CycloneDX 1.5 JSON SBOM (exits 2 on blocking findings)
npx -y github:z121245017-ai/lockshield-mcp --lockfile ./package-lock.json --mode saas --sbom ./bom.cdx.json

# Invoke any MCP tool directly via --cli
npx -y github:z121245017-ai/lockshield-mcp --cli evaluate_spdx_expression_policy '{"expression":"(MIT OR GPL-3.0-only)","deploymentMode":"saas"}'

Claude Desktop / Cursor / Windsurf / Antigravity Config

{
  "mcpServers": {
    "lockshield": {
      "command": "npx",
      "args": ["-y", "github:z121245017-ai/lockshield-mcp"]
    }
  }
}

Docker (node:22-alpine, non-root USER node)

docker build -t lockshield-mcp .
docker run -i --rm lockshield-mcp

GitHub Action (z121245017-ai/lockshield-mcp@v1)

Block AGPL-3.0, SSPL-1.0, BUSL-1.1, postinstall hooks, and typosquats in pull requests while automatically generating a deterministic CycloneDX 1.5 SBOM artifact:

name: LockShield License & Supply-Chain Gate

on:
  pull_request:
    paths:
      - '**/package-lock.json'
      - '**/pnpm-lock.yaml'
      - '**/Cargo.lock'
      - '**/poetry.lock'
      - '**/uv.lock'

permissions:
  contents: read

jobs:
  lockshield:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Audit lockfiles & generate CycloneDX 1.5 SBOM
        uses: z121245017-ai/lockshield-mcp@v1
        with:
          paths: '.'
          deployment-mode: 'saas'
          sbom-output: 'bom.cdx.json'

3-Mode SPDX Deployment Policy Matrix

License Family

Examples

saas (Hosted Network)

binary (Client / On-Prem)

internal (In-House Tool)

Permissive

MIT, Apache-2.0, BSD-3-Clause, ISC, 0BSD, BSL-1.0

SAFE

SAFE

SAFE

Weak Copyleft

LGPL-2.1, LGPL-3.0, MPL-2.0, EPL-2.0

SAFE

CONDITIONAL (Notice / Dynamic Link)

SAFE

Strong Copyleft

GPL-2.0, GPL-3.0

REVIEW (Isolate from browser JS/WASM)

RESTRICTED (::error)

SAFE

Network Copyleft

AGPL-3.0, OSL-3.0, EUPL-1.2

RESTRICTED (::error)

RESTRICTED (::error)

CONDITIONAL

Source-Available

SSPL-1.0, BUSL-1.1, FSL-1.1, Commons-Clause, ELv2

RESTRICTED (::error)

RESTRICTED (::error)

CONDITIONAL / RESTRICTED

Non-Commercial

CC-BY-NC-4.0, UNLICENSED

RESTRICTED (::error)

RESTRICTED (::error)

RESTRICTED (::error)

Commercial Air-Gapped Browser Workbench & DevSecOps Suite

Need a zero-install Bilingual Air-Gapped Browser Workbench (connect-src 'none') for M&A legal counsel, procurement security questionnaires, 1080×1440 compliance sign-off cards, and Excel BOM inventory exports without touching the command line?

Explore LockShield Pro Workbench and our full offline DevSecOps & developer utility catalog at https://z121245017-ai.github.io/.

Verification

npm test

License

MIT License — 0 external npm dependencies, 0 network calls, 100% local deterministic execution.

Available Tools

4 tools
audit_lockfile_complianceB
Read-onlyIdempotent

Parses package-lock.json (v1/v2/v3), pnpm-lock.yaml, Cargo.lock, poetry.lock, or uv.lock offline and evaluates transitive SPDX copyleft/SaaS license contamination and supply-chain hazards.

Inputs: includeDev, filenameHint, lockfilePath, deploymentMode, +4 more.

evaluate_spdx_expression_policyB
Read-onlyIdempotent

Evaluates single or compound SPDX boolean license expressions (OR, AND, WITH, parentheses) across SaaS, Commercial Binary, and Internal Tool deployment modes.

Inputs: expression (required), deploymentMode.

generate_cyclonedx_sbomA
Read-onlyIdempotent

Generates a deterministic CycloneDX 1.5 JSON Software Bill of Materials (SBOM) with canonical Package URLs (purl), hex SHA-512/SHA-256 digests, and SPDX license objects.

Inputs: excludeDev, filenameHint, lockfilePath, applicationName, +4 more.

scan_supply_chain_hazardsA
Read-onlyIdempotent

Scans lockfile dependencies specifically for preinstall/postinstall lifecycle hooks, cleartext HTTP or unpinned Git origins, deprecated SHA-1 hashes, and ecosystem typosquats.

Inputs: filenameHint, lockfilePath, allowedPackages, lockfileContent.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool has a recognizable core action (audit lockfile, evaluate SPDX expression, scan hazards, generate SBOM), so selection is mostly clear. However, audit_lockfile_compliance's description also claims to evaluate "supply-chain hazards," which overlaps directly with scan_supply_chain_hazards, and its license-contamination check blurs with evaluate_spdx_expression_policy.

    Naming Consistency5/5

    All four names follow a strict verb_noun snake_case pattern (audit_…, evaluate_…, scan_…, generate_…) with descriptive domain objects. No mixed conventions or vague one-word verbs.

    Tool Count4/5

    Four tools is lean but each maps to a distinct stage of lockfile analysis, so nothing feels redundant. It sits at the low end of the ideal range, leaving little room for supporting operations.

    Completeness3/5

    The analysis-to-SBOM pipeline is covered, but there is no way to inspect or list raw resolved dependencies, no diff/compare between two lockfiles, and no remediation or policy-configuration tool despite policy evaluation being a core feature. Agents would have to work around these gaps for a full audit workflow.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Audits package lockfiles for vulnerabilities, supporting npm, yarn, and pnpm. Runs via CLI or as an MCP server over stdio.
      1
      13 npm
      73
      MIT
    • -
      license
      Not graded
      quality
      B
      maintenance
      Audits npm dependencies for license compatibility, catching copyleft and source-available traps before shipping.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables auditing npm, Yarn, and pnpm lockfiles from local project directories or remote Git repositories and returning unified vulnerability reports with configurable severity thresholds, dev-dependency skipping, and text or JSON output.
      13 npm
      MIT