Security Scan MCP Server

Security Scan MCP Server

An MCP server that provides CVE-driven security prompts for code review, enabling coding agents to get actionable security checks based on real vulnerabilities.

Category
访问服务器

README

Security Scan MCP Server

An MCP (Model Context Protocol) server that provides CVE-driven security prompts for code review.

What This Does

Security review checklists derived from real CVEs.

  1. Build phase: Ingests thousands of CVEs from NVD, then uses Claude to categorize them into generic software types (web-server, database, mobile-app, etc.)
  2. Runtime: Coding agents query "what security issues should I look for in a web server?" and get actionable prompts based on actual vulnerabilities that have occurred in that type of software

This means security guidance is:

  • Data-driven: Based on real CVEs, not theoretical vulnerabilities
  • Type-specific: Different checks for web servers vs databases vs mobile apps
  • Actionable: Written for code review, not product-specific

Installation

npm install
npm run build

Setup

Build the security prompts database

# 1. Ingest CVEs from NVD (can use NVD_API_KEY for faster rate)
npm run ingest

# 2. Build security prompts using Claude
ANTHROPIC_API_KEY=your-key npm run build-prompts

This analyzes all CVEs and creates a database of security check prompts organized by software type.

Usage as MCP Server

Add to your Claude Code configuration:

claude mcp add security-scan -- node /path/to/security-scan-mcp/dist/index.js

Or add to .claude.json:

{
  "mcpServers": {
    "security-scan": {
      "command": "node",
      "args": ["/path/to/security-scan-mcp/dist/index.js"]
    }
  }
}

MCP Tools

Security Prompts (Core Feature)

list_software_types

List all software types that have security prompts available.

Returns types like web-server, database, api-server, mobile-app, etc., along with:

  • code_signals: How to identify this type in code (e.g., "HTTP handling", "SQL queries")
  • prompt_count: Number of security checks available for this type

get_security_prompts_for_type

Get all security check prompts for a specific software type.

Parameters:

  • type_id (string, required): e.g., "web-server", "database"
  • severity (string, optional): Filter by critical/high/medium/low
  • format (string, optional): "json" or "checklist"

Returns: Security checks like:

{
  "title": "Header size validation",
  "check_prompt": "Verify that HTTP header sizes are validated before processing...",
  "severity": "high",
  "based_on_cves": ["CVE-2021-xxxx", "CVE-2022-yyyy"]
}

search_security_prompts

Full-text search across all security prompts.

Parameters:

  • query (string, required): e.g., "SQL injection", "buffer overflow"
  • limit (number, optional): Maximum results

Agent Workflow

1. Agent starts working on a codebase

2. Agent calls list_software_types
   → Sees types: web-server, database, api-server...
   → Sees code_signals for each type

3. Agent recognizes: "This code has Express routes, HTTP handling"
   → Matches "web-server" type

4. Agent calls get_security_prompts_for_type("web-server")
   → Gets 20+ security checks derived from real CVEs
   → "Verify header sizes are validated..."
   → "Check for request smuggling vulnerabilities..."

5. Agent reviews code against each prompt

CVE/CWE Database Tools

search_cves

Search the CVE database using full-text search.

get_cwe_info

Get detailed information about a specific CWE.

get_cves_by_cwe

Get CVEs related to a specific CWE.

get_top_cwes

Get the most dangerous CWEs for an application type.

get_database_stats

Get statistics about the vulnerability database.

How It Works

Building Security Prompts

  1. CVE Ingestion: Fetches CVEs from NVD API
  2. Analysis: Sends CVEs to Claude in batches
  3. Categorization: Claude identifies generic software type (web-server, database, etc.)
  4. Prompt Generation: Claude extracts the vulnerability pattern and creates actionable check prompts
  5. Storage: Saves to SQLite with full-text search

Database Schema

-- Software types (web-server, database, etc.)
software_types (
  type_id TEXT,           -- e.g., "web-server"
  name TEXT,              -- e.g., "Web Servers"
  description TEXT,
  code_signals TEXT       -- JSON: how to identify this type in code
)

-- Security check prompts by type
security_prompts (
  type_id TEXT,           -- References software_types
  title TEXT,             -- e.g., "Header size validation"
  check_prompt TEXT,      -- The actual prompt for code review
  severity TEXT,          -- critical/high/medium/low
  based_on_cves TEXT      -- JSON: CVE IDs this was derived from
)

Environment Variables

Variable Description Required
ANTHROPIC_API_KEY Claude API key for building security prompts For build-prompts
NVD_API_KEY API key for NVD CVE access Optional (rate limited without)
SECURITY_SCAN_DATA_DIR Database location Default: ~/.security-scan-mcp

CLI Testing

Test the MCP functions directly from the command line:

npm run cli help                    # Show all commands
npm run cli list-types              # List software types
npm run cli get-prompts web-server  # Get prompts for a type
npm run cli get-prompts web-server --severity critical --checklist
npm run cli search-prompts "SQL injection"
npm run cli search-cves "apache"
npm run cli cwe 79                  # Get CWE info
npm run cli top-cwes web            # Top CWEs for app type
npm run cli stats                   # Database statistics

Development

npm run build         # Build TypeScript
npm run dev           # Run in development mode
npm run ingest        # Ingest CVEs from NVD
npm run build-prompts # Build security prompts (requires ANTHROPIC_API_KEY)
npm run cli           # Test MCP functions via CLI
npm test              # Run tests

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选