npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-security-mcp

v1.3.1

Published

Vue Security MCP (Multi-Modal Co-Pilot) Tool - A tool for real-time security scanning of Vue code when using AI with advanced semantic analysis and enterprise-grade reporting

Readme

Vue Security MCP (Multi-Modal Co-Pilot) Tool

Vue Security MCP 是一个用于在使用AI时对Vue代码进行实时安全扫描的工具。它集成了Vue Security Scanner的强大功能,为AI生成的代码提供即时安全反馈。

安装

npm install vue-security-mcp vue-security-scanner

或者使用yarn:

yarn add vue-security-mcp vue-security-scanner

快速开始

基本用法

const VueSecurityMCP = require('vue-security-mcp');

const mcp = new VueSecurityMCP();

const vueCode = `
<template>
  <div v-html="userInput"></div>
</template>

<script>
export default {
  data() {
    return {
      userInput: '<script>alert("XSS")</script>'
    }
  }
}
</script>
`;

// 扫描代码
const results = await mcp.scanCode(vueCode, 'my-component.vue');
console.log(mcp.generateSecurityReport(results, 'text'));

与AI集成

const { generateWithSecurity } = await mcp.generateWithSecurity(
  async (prompt) => {
    // 这里集成您的AI生成逻辑
    return generatedCode;
  }, 
  'Create a Vue component'
);

console.log(`代码安全: ${generateWithSecurity.isSafe}`);
console.log(`发现漏洞: ${generateWithSecurity.securityScan.summary.totalVulnerabilities}`);

功能特点

  • 实时安全扫描:在AI生成代码时即时进行安全检测
  • 智能修复建议:基于安全规则提供修复建议
  • 风险等级分类:按严重程度分类显示安全漏洞
  • 多格式报告:支持JSON、文本和HTML格式的安全报告
  • 批量处理:支持批量扫描多个代码片段
  • AI集成:易于与各种AI模型集成

API参考

VueSecurityMCP类

构造函数

const mcp = new VueSecurityMCP(options);

选项:

  • batchSize: 批量处理大小 (默认: 5)
  • enableMemoryOptimization: 启用内存优化 (默认: true)
  • reportFormat: 报告格式 ('json', 'text', 'html') (默认: 'json')
  • outputDir: 输出目录 (默认: './output')
  • tempDir: 临时目录 (默认: './temp')
  • gcThreshold: 垃圾回收阈值 (默认: 100)
  • maxBuffer: 最大缓冲区大小 (默认: 10485760)

方法

  • scanCode(code, fileName): 扫描代码字符串
  • generateWithSecurity(aiGenerateFn, prompt, options): 与AI集成生成安全代码
  • batchScan(codeSnippets): 批量扫描代码片段
  • generateSecurityReport(scanResults, format): 生成安全报告

配置

Vue Security MCP 支持多种配置方式:

1. 代码中配置

你可以通过配置对象自定义MCP的行为:

const mcp = new VueSecurityMCP({
  batchSize: 10,
  enableMemoryOptimization: true,
  reportFormat: 'json',
  outputDir: './reports',
  tempDir: './temp-files',
  gcThreshold: 100,
  maxBuffer: 10 * 1024 * 1024  // 10MB
});

2. 配置文件

MCP会自动查找并加载以下配置文件之一:

  • mcp-config.json
  • vue-security-mcp.config.json

配置文件示例 (mcp-config.json):

{
  "batchSize": 5,
  "enableMemoryOptimization": true,
  "reportFormat": "json",
  "outputDir": "./output",
  "tempDir": "./temp",
  "gcThreshold": 100,
  "maxBuffer": 10485760
}

配置加载优先级:

  1. 代码中传入的配置参数
  2. 配置文件中的设置
  3. 默认值

许可证

MIT