Token导航 LogoToken导航TokenDH.com
VSGuard MCP logo
安全风控stdio官方级别未说明来源级核验

VSGuard MCP

MCP Server

@smithery/cli

VSGuard是一款为AI辅助开发提供实时安全防护的MCP服务器,集成OWASP ASVS和LLM Top 10标准,能在编码过程中检测SQL注入、弱认证等50多种漏洞。

工具数

0

提示词数

0

GitHub Stars

3

资源数

0
安全PythonClaude静态分析ClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

harn1shmodi

提供方

harn1shmodi

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @smithery/cli install @harn1shmodi/vsguard

详细介绍

VSGuard MCP-AI编码代理的安全护栏

](https://smithery.ai/server/@harn1shmodi/vsguard) ![ASVS](https://owasp.org/www-project-application-security-verification-standard/) ![Python](https://www.python.org/downloads/) License

VSGuard是第一个使人工智能辅助开发的安全自动化的MCP服务器。它将OWASP ASVS和OWASP LLM Top 10标准直接集成到您的AI编码工作流程中,在编码时捕获SQL注入、提示注入、弱身份验证和50多个其他漏洞,而不是在部署后。

概述

此MCP服务器与Claude Code、Cursor和其他MCP客户端集成,以启用 代码生成过程中的主动安全。它通过提供以下功能从一开始就帮助AI代理编写安全代码:

  • OWASP ASVS要求 -基于ASVS v5.0的实时安全指导
  • 漏洞扫描 -使用带有自定义ASVS规则的Semgrep进行静态分析
  • 安全代码修复 -通过代码示例进行可操作的补救

特性

四个核心工具

  1. list_asvs_categories -发现可用的ASVS类别和章节

- 查看全部17章和80个类别 - 根据您的需求找到合适的搜索词

  1. check_security_requirements -在编写代码之前获取相关的ASVS要求

- 搜索方式 类别 (最精确)或 (更广泛) - 自由文本 怎么翻译 搜索自然语言 - 筛选依据 水平 减少令牌使用

  1. scan_code -使用ASVS映射分析代码中的漏洞
  2. suggest_fix -生成带有解释的安全代码替代方案

安全保障

  • ✅ 身份验证(ASVS第2章)
  • ✅ 会话管理(ASVS第3章)
  • ✅ 访问控制(ASVS第4章)
  • ✅ 输入验证和注射预防(ASVS第5章)
  • ✅ 密码学(ASVS第6-9章)
  • ✅ 数据保护

支持的语言

  • Python(初级)
  • JavaScript/TypeScript
  • Java、Go、Ruby、PHP、C/C++、C#、Rust(通过Semgrep)

快速开始

使用Cursor和Claude代码!使用基于HTTP的配置格式:

{
  "mcpServers": {
    "vsguard": {
      "type": "http",
      "url": "https://vsguard.fastmcp.app/mcp"
    }
  }
}

如果你更喜欢Smithery

通过以下方式自动安装VSGuard 史密瑟里:

npx -y @smithery/cli install @harn1shmodi/vsguard

如果您更喜欢远程安装

# Clone repository
git clone https://github.com/yourname/vsguard-mcp
cd vsguard-mcp

# Install dependencies
pip install -e .

为Claude Code/Coursor配置mcp.json

{
  "mcpServers": {
    "vsguard": {
      "command": "python",
      "args": ["/absolute/path/to/vsguard-mcp/src/server.py"]
    }
  }
}

使用示例

示例1:在代码生成过程中获取安全要求

在克劳德桌面中:

Create a user login endpoint, follow asvs requirements.

克劳德将致电:

check_security_requirements(
    chapter="Authentication",  # or category="Password Security" for precision
    language="python"
)

答复:

# OWASP ASVS Security Requirements

## Level 1 Requirements (8)

### 2.1.1: Password Security
Requirement: Verify that user set passwords are at least 12 characters in length.

Implementation Guide:
- Add validation during user registration and password change
- Reject passwords shorter than 12 characters
- Consider allowing longer passwords (64+ chars)

Code Example:

def validate_password_length(password: str) -> bool: if len(password) < 12: raise ValueError("Password must be at least 12 characters") return True


### 示例2:扫描现有代码以查找漏洞

**在克劳德桌面中:**

Can you check the login logic code for security issues?


**克劳德将致电:**

scan_code( code="""def login(username, password): query = f"SELECT * FROM users WHERE username = '{username}'" cursor.execute(query)""", language="python" )


**答复:**

❌ SCAN FAILED

Total Findings: 1

  • 🟠 HIGH: 1

ASVS Requirements Violated: 5.3.4, 5.3.5

Detailed Findings

1. 🟠 SQL Injection

Severity: HIGH ASVS Requirements: 5.3.4, 5.3.5

Issue: SQL injection vulnerability detected. User input is concatenated directly into SQL query.

Location: input.py:line 2

Vulnerable Code: query = f"SELECT * FROM users WHERE username = '{username}'"

Remediation: Use parameterized queries with placeholders instead of string concatenation.

Example: cursor.execute("SELECT * FROM users WHERE username = ?", (username,))


### 示例3:获取安全代码修复

**在克劳德桌面中:**

How do I fix this SQL injection vulnerability?


**克劳德将致电:**

suggest_fix( vulnerable_code="cursor.execute(f'SELECT * FROM users WHERE id = {user_id}')", vulnerability_type="sql_injection", language="python" )


**答复:**

Security Fix Suggestion

ASVS Requirements Addressed 5.3.4, 5.3.5

❌ Vulnerable Code

cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")

✅ Secure Code

cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))

Or with SQLAlchemy ORM:

from sqlalchemy import select stmt = select(User).where(User.username == username) user = session.execute(stmt).scalar_one_or_none()


## 测试

Run tests

pytest tests/

Run specific test

pytest tests/test_asvs_loader.py

With coverage

pytest --cov=src tests/


## 覆盖

目前的实施包括:

- **40+ASVS要求** 跨身份验证、会话管理、输入验证和密码学
- **25+自定义Semgrep规则** 检测常见漏洞
- **10+修复模板** 带有安全代码示例
- **多种语言** 支持(Python、JavaScript、TypeScript等)

### 漏洞检测

- SQL注入(ASVS 5.3.4、5.3.5)
- 跨站点脚本(ASVS 5.3.3、5.3.10)
- 弱密码验证(ASVS 2.1.1、2.1.7)
- 弱密码学(ASVS 6.2.2、6.2.5)
- 硬编码秘密(ASVS 2.3.1、14.3.3)
- 会话管理问题(ASVS 3.x)
- XML外部实体(XXE)(ASVS 5.5.2)
- 命令注入(ASVS 5.3.4)
- 还有更多。..

## 运作原理

### ASVS需求数据库

服务器从结构化的YAML文件加载OWASP ASVS v4.0要求:

requirements: - id: "2.1.1" level: 1 category: "Password Security" requirement: "Verify that user set passwords are at least 12 characters in length." cwe: "CWE-521" description: "Passwords should be sufficiently long..." implementation_guide: "Add validation during registration..." code_examples: - | if len(password) < 12: raise ValueError("Too short")


### 2.使用Semgrep进行静态分析

自定义Semgrep规则检测ASVS违规:

rules: - id: asvs-5-3-4-sql-injection pattern: cursor.execute(f"... {$VAR} ...") message: "ASVS 5.3.4: SQL injection vulnerability" severity: ERROR metadata: asvs_id: "5.3.4" cwe: "CWE-89"


### 3.智能测图

调查结果通过以下方式自动映射到ASVS要求:

- 漏洞类型(sql_injection→ 与5.3.4相比)
- CWE-89→ 与5.3.4、5.3.5相比)
- 代码模式(登录端点→ 身份验证要求)

### 4.LLM优化输出

所有回复的格式都是为了最大限度地理解LLM:

- 结构清晰,有标题和部分
- 带有语法高亮显示的代码示例
- 严重性指标(🔴 🟠 🟡)
- 可采取的补救措施
- ASVS需求参考

## 🔧 扩展服务器

### 添加新的ASVS要求

在中创建/编辑YAML文件 `data/asvs/`:

requirements: - id: "X.Y.Z" level: 1 category: "Your Category" requirement: "Requirement text" cwe: "CWE-XXX" description: "Detailed explanation" implementation_guide: "How to implement" code_examples: - "Example code"


### 添加自定义Semgrep规则

在中创建YAML文件 `data/rules/`:

rules: - id: custom-rule-id patterns: - pattern: vulnerable_pattern() message: "Vulnerability description" severity: ERROR metadata: asvs_id: "X.Y.Z" cwe: "CWE-XXX" remediation: "How to fix"


### 添加修复模板

编辑 `src/fixes/templates.py`:

FIX_TEMPLATES = { "vulnerability_type": { "python": { "vulnerable": "# Bad code", "secure": "# Good code", "explanation": "Why it's better", "asvs_requirements": ["X.Y.Z"], } } }


## 🤝 贡献

欢迎投稿!需要改进的地方:

1. **更多ASVS要求** -涵盖其他章节
1. **更多语言** -扩展语言支持
1. **更多扫描仪** -集成Bandit,检测秘密
1. **更好的AI集成** -改进LLM输出格式
1. **演出** -优化扫描速度

## ⚡ 技术支持

- **FastMCP 2.0** -MCP服务器的现代Python框架
- **Semgrep** -静态分析引擎
- **OWASP ASVS** -安全验证标准

## 📝 许可证

MIT许可证-有关详细信息,请参阅许可证文件。

## 🔗 资源

- [OWASP ASVS](https://owasp.org/www-project-application-security-verification-standard/)
- [模型上下文协议](https://modelcontextprotocol.io/)
- [Semgrep](https://semgrep.dev/)
- [克劳德桌面版](https://claude.ai/download)

## 🙏 致谢

- ASVS标准的OWASP
- MCP协议的拟人化
- 扫描引擎的Semgrep

## 📧 支持

对于问题、疑问或贡献,请在GitHub上打开问题。

______________________________________________________________________

**内置于❤️ 用于安全的人工智能辅助开发**

目录标签

目录标签

安全PythonClaude静态分析AI安全本地部署代码审计漏洞检测OWASP

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

local-only

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosessionlocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP