Skip to main content
Glama
GuardianShield

GuardianShield

by sparkvibe-io

守护之盾

PyPI 版本 Python 许可证 测试

通用的AI安全层——一个开源的MCP服务器,用于代码扫描、PII检测、提示注入防御、秘密检测、依赖审计和审计日志记录。

零依赖 · 27个MCP工具 · 5个安全配置文件 · 108+检测模式

功能特性

  • 代码漏洞扫描 — SQL注入、XSS、命令注入、路径遍历,附带CWE ID和自动修复方案

  • 跨行数据流分析 — DeepEngine通过基于AST的污点传播(Python)和正则表达式(JS/TS)追踪跨多行的从源到汇的污点数据

  • 依赖安全性 — 针对PyPI、npm、Go和Packagist生态系统,通过OSV.dev进行版本感知的CVE匹配

  • 清单解析 — 自动检测11种格式(requirements.txt、package.json、yarn.lock、go.mod、composer.json等)

  • 提示注入防御 — 9+种检测模式,涵盖指令覆盖、角色劫持、ChatML注入

  • PII检测 — 电子邮件、社会安全号码、信用卡、电话、IP——在检测结果中自动进行脱敏处理

  • 秘密检测 — AWS密钥、GitHub令牌、Stripe密钥、JWT、密码、连接字符串

  • 安全配置文件 — 5个内置配置文件(通用、教育、医疗、金融、儿童)

  • 审计日志记录 — 基于SQLite的扫描历史,支持结果检索和筛选

Related MCP server: Cybrium MCP Server

安装

pip install guardianshield

快速开始

# Register with Claude Code
claude mcp add guardianshield -- guardianshield-mcp

# Or run directly
guardianshield-mcp

编辑器集成

# Claude Code
claude mcp add guardianshield -- guardianshield-mcp

# VS Code (.vscode/mcp.json)
{"servers": {"guardianshield": {"type": "stdio", "command": "guardianshield-mcp"}}}

# Cursor (.cursor/mcp.json)
{"mcpServers": {"guardianshield": {"command": "guardianshield-mcp"}}}

# Claude Desktop (claude_desktop_config.json)
{"mcpServers": {"guardianshield": {"command": "guardianshield-mcp"}}}

MCP工具

扫描

工具

描述

scan_code

扫描源代码中的漏洞和硬编码秘密

scan_file

扫描单个文件(根据扩展名自动检测语言)

scan_directory

递归扫描目录,支持过滤和进度流式传输

scan_input

检查用户/代理输入是否存在提示注入尝试

scan_output

检查AI输出是否存在PII泄露和内容违规

check_secrets

检测硬编码的秘密和凭证

scan_files

一次调用中扫描多个文件

scan_diff

解析统一差异并仅扫描新增的行

依赖安全

工具

描述

check_dependencies

通过OSV.dev检查包的已知CVE(PyPI、npm、Go、Packagist)

sync_vulnerabilities

同步本地OSV漏洞数据库

parse_manifest

将任何支持的清单文件(11种格式)解析为依赖对象

scan_dependencies

扫描目录中的清单文件并检查所有依赖是否存在漏洞

误报管理

工具

描述

mark_false_positive

将发现标记为误报(标记未来的匹配项)

list_false_positives

列出带有可选筛选器的活跃误报记录

unmark_false_positive

通过指纹移除误报记录

引擎管理

工具

描述

list_engines

列出可用分析引擎及其功能

set_engine

设置用于代码扫描的活跃分析引擎

三个内置引擎:regex(逐行模式匹配,默认启用)、deep(跨行污点追踪)和semantic(结构感知的置信度调整)。

CI与开发者工作流

工具

描述

export_sarif

以SARIF 2.1.0 JSON格式导出发现结果,用于GitHub代码扫描和CI

save_baseline

将当前发现结果保存为基线,用于增量扫描

scan_with_baseline

扫描代码并仅报告与基线相比的新发现结果

check_quality_gate

根据严重性阈值评估发现结果(通过/失败/警告)

scan_files

一次调用中扫描多个文件

scan_diff

解析统一差异并仅扫描新增的行

配置与工具

工具

描述

get_profile

获取当前安全配置文件配置

set_profile

切换安全配置文件(通用、教育、医疗、金融、儿童)

test_pattern

针对样本代码测试正则表达式模式,用于自定义模式开发

audit_log

查询安全审计日志

get_findings

检索带筛选器的历史发现结果

shield_status

获取健康状态、配置和OSV缓存统计信息

配置

设置环境变量以自定义行为:

变量

描述

默认值

GUARDIANSHIELD_PROFILE

默认安全配置文件

general

GUARDIANSHIELD_AUDIT_PATH

SQLite审计数据库路径

~/.guardianshield/audit.db

GUARDIANSHIELD_DEBUG

启用调试日志记录(1)

禁用

文档

完整文档:sparkvibe-io.github.io/GuardianShield

许可证

Apache 2.0

Available Tools

27 tools
audit_logB

Query the security audit log. Returns recent scan events with timestamps, scan types, finding counts, and input hashes.

Inputs: limit, scan_type.

check_dependenciesC

Check package dependencies for known vulnerabilities using the OSV.dev database. Provide a list of packages with names, versions, and ecosystems (PyPI or npm).

Inputs: dependencies (required).

check_quality_gateA

Scan code and evaluate findings against configurable severity thresholds. Returns a pass/fail/warn verdict suitable for CI pipelines. Exit codes: 0=pass, 1=fail.

Inputs: code (required), fail_on, warn_on, language, +2 more.

check_secretsA

Dedicated secret and credential detection. Scans text for AWS keys, GitHub tokens, Stripe keys, private keys, JWTs, Slack tokens, passwords, connection strings, Google API keys, and more. All matched secrets are redacted in findings.

Inputs: text (required), file_path.

export_sarifA

Export scan findings as SARIF 2.1.0 JSON for GitHub Code Scanning, VS Code, and CI integration

Inputs: code (required), language (required), engines, file_path.

get_findingsA

Retrieve past security findings from the audit database with optional filters by type, severity, or audit ID.

Inputs: limit, audit_id, severity, finding_type.

get_profileA

Get the current safety profile configuration including scanner settings and blocked content categories.

Inputs: no named parameters.

list_enginesA

List available analysis engines with their capabilities and enabled status. Returns each engine's name, whether it is enabled in the current profile, and its capabilities.

Inputs: no named parameters.

list_false_positivesB

List active false positive records. Shows findings that have been marked as false positives, with optional filtering by scanner.

Inputs: limit, scanner.

mark_false_positiveB

Mark a security finding as a false positive. The finding will be flagged in future scans, and similar patterns at other locations will be annotated as potential false positives.

Inputs: finding (required), reason.

parse_manifestB

Parse a dependency manifest file into a structured list of dependencies. Auto-detects format from the filename. Supports: requirements.txt, package.json, pyproject.toml, package-lock.json, yarn.lock, pnpm-lock.yaml, Pipfile.lock, go.mod, go.sum, composer.json, composer.lock.

Inputs: content (required), filename (required).

save_baselineA

Scan code and save the findings as a baseline JSON file. On subsequent scans with scan_with_baseline, only NEW findings (not in the baseline) are reported.

Inputs: code (required), language, file_path, output_path.

scan_codeB

Scan source code for security vulnerabilities (SQL injection, XSS, command injection, path traversal) and hardcoded secrets/credentials. Returns a list of findings with severity, type, and remediation guidance.

Inputs: code (required), engines, language, file_path.

scan_dependenciesA

Recursively scan a directory for manifest/lockfiles (requirements.txt, package.json, go.mod, composer.json, etc.), parse dependencies, and check them for known vulnerabilities using the OSV.dev database.

Inputs: path (required), exclude.

scan_diffA

Scan a unified diff (e.g. from git diff) for vulnerabilities. Only added lines are scanned; findings have correct line numbers and file paths from the diff context.

Inputs: diff (required).

scan_directoryA

Recursively scan a directory for vulnerabilities and secrets. Supports extension filtering, exclude patterns, and reports progress. Returns all findings across all scanned files.

Inputs: path (required), exclude, extensions.

scan_fileA

Scan a single source file for vulnerabilities and secrets. Auto-detects language from file extension. Returns findings with line numbers, severity, CWE IDs, and remediation.

Inputs: path (required), language.

scan_filesB

Scan multiple files in one call. Returns findings grouped by file with a summary of total findings.

Inputs: files (required).

scan_inputA

Check user or agent input for prompt injection attempts. Detects instruction override, role hijacking, system prompt extraction, delimiter abuse, ChatML injection, jailbreak keywords, and encoding evasion.

Inputs: text (required).

scan_outputA

Check AI-generated output for PII leaks (email, SSN, credit card, phone, IP) and content policy violations (violence, self-harm, illegal activity). PII is automatically redacted in findings.

Inputs: text (required).

scan_with_baselineA

Scan code and compare against a saved baseline, returning only NEW findings that are not in the baseline. Use save_baseline first to create a baseline.

Inputs: code (required), language, file_path, baseline_path.

set_engineB

Set which analysis engines are active for code scanning. Accepts a list of engine names to enable for the current session. Available engines can be listed with list_engines.

Inputs: engines (required).

set_profileA

Switch to a different safety profile. Available profiles: general, education, healthcare, finance, children. Each profile adjusts scanner sensitivity and blocked categories.

Inputs: name (required).

shield_statusA

Get GuardianShield health and configuration status including active profile, enabled scanners, and audit statistics.

Inputs: no named parameters.

sync_vulnerabilitiesA

Sync the local OSV vulnerability database for a given ecosystem. Call this to update the cache before checking dependencies.

Inputs: ecosystem (required), packages.

test_patternA

Test a regex pattern against sample code. Returns match details including positions and matched text. Useful for developing and debugging custom vulnerability patterns.

Inputs: regex (required), sample (required), language.

unmark_false_positiveA

Remove a false positive record by its fingerprint. The finding will no longer be flagged in future scans.

Inputs: fingerprint (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 27 tools

    Disambiguation3/5

    Several scan tools overlap in purpose: scan_file, scan_code, scan_directory, scan_files, and check_secrets all detect vulnerabilities and secrets. scan_input and scan_output are distinct, but the boundaries between the code scanning tools are blurry, potentially causing selection errors.

    Naming Consistency4/5

    Most tools follow a consistent verb_noun pattern with underscores. A few deviate with prepositions (scan_with_baseline) but overall the naming is predictable and readable.

    Tool Count3/5

    With 27 tools, the server is feature-rich but borderline heavy. Each tool serves a distinct function for code analysis, dependency checking, and security management, but the count is slightly above the ideal range for ease of agent navigation.

    Completeness4/5

    The tool set covers nearly all aspects of security scanning: static analysis, input/output checking, dependency scanning, false positive management, baselines, quality gates, and export. Missing advanced features like custom profile creation or result deletion, but these are minor gaps.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Security middleware for LLM apps and AI agent pipelines. Detects prompt injection attacks (22 signatures, 7 languages) and anonymizes PII (17 entity types). Deterministic, sub-25ms, GDPR Art.30 compliant.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI coding assistants with real-time security scanning superpowers, including SAST, secrets detection, dependency CVE scanning, and web vulnerability assessment.
      15 npm
      Apache 2.0