网络堆栈扫描
MCP服务器,用于从标题和HTML签名中提取网站技术栈的指纹。
特性
- 指纹网站 -分析任何URL以检测使用的技术
- 检测框架 -从HTML和头部识别前端/后端框架
- 检测分析 -查找分析和跟踪脚本
- 没有无头浏览器 -轻量级静态HTML分析
- 可扩展签名 -易于添加新的检测模式
安装
npm install
npm run build用法
作为MCP服务器(stdio)
# Start with stdio transport for MCP clients
npm run start:stdio
# or
node dist/cli.js --stdio作为HTTP服务器
# Start HTTP server (default port 3000)
npm run start:http
# or
node dist/cli.js --http --port 8080CLI选项
web-stack-scan [OPTIONS]
OPTIONS:
--stdio, -s Use stdio transport (default)
--http, -h Use HTTP transport
--port, -p Port for HTTP server (default: 3000)
--host Host for HTTP server (default: 127.0.0.1)
--version, -v Print version
--help Print this help messageMCP工具
指纹
完整指纹:获取URL,分析标头和HTML,返回检测到的技术。
参数:
url(字符串,必填)-指纹识别的URLtimeout(数字,可选)-超时(毫秒)(默认值:10000)
例子:
{
"method": "tools/call",
"params": {
"name": "fingerprint",
"arguments": {
"url": "https://example.com"
}
}
}答复:
{
"ok": true,
"data": {
"url": "https://example.com",
"technologies": [
{
"name": "React",
"version": "18.2.0",
"confidence": "high",
"category": "frontend-framework"
},
{
"name": "nginx",
"confidence": "high",
"category": "server"
}
],
"analytics": [
{
"name": "Google Analytics",
"type": "analytics"
}
],
"headers": {
"server": "nginx",
"content-type": "text/html"
}
},
"meta": {
"source": "https://example.com",
"retrieved_at": "2024-01-15T10:30:00.000Z",
"pagination": { "next_cursor": null },
"warnings": []
}
}检测框架
从HTML内容和可选标头中检测前端/后端框架。
参数:
html(string,必填)-要分析的HTML内容headers(对象,可选)-要分析的HTTP标头
例子:
{
"method": "tools/call",
"params": {
"name": "detect_frameworks",
"arguments": {
"html": "
",
"headers": {
"X-Powered-By": "Express"
}
}
}
}检测分析
从HTML内容中检测分析和跟踪脚本。
参数:
html(string,必填)-要分析的HTML内容
例子:
{
"method": "tools/call",
"params": {
"name": "detect_analytics",
"arguments": {
"html": "gtag('config', 'UA-12345-1');"
}
}
}REST API(HTTP模式)
在HTTP模式下运行时,以下REST端点可用:
POST/api/指纹
curl -X POST http://localhost:3000/api/fingerprint \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'POST/api/框架
curl -X POST http://localhost:3000/api/frameworks \
-H "Content-Type: application/json" \
-d '{"html": "...", "headers": {"X-Powered-By": "Express"}}'POST/api/分析
curl -X POST http://localhost:3000/api/analytics \
-H "Content-Type: application/json" \
-d '{"html": "..."}'GET/健康
curl http://localhost:3000/health
# Returns: {"status": "ok", "service": "web-stack-scan"}检测技术
从标题
| 标题 | 技术 |
|---|---|
| X-Powered By | Express、PHP、ASP。NET、Next.js |
| 服务器 | nginx、Apache、Cloudflare、微软IIS |
| X-Drupal-Cache | Drupal |
| X-Generator | WordPress、Ghost、Drupal、Joomla |
| X-Shopify-Stage | Shopify |
来自HTML/脚本
| 类别 | 技术 |
|---|---|
| 前端框架 | React、Vue.js、Angular、Svelte |
| 元框架 | Next.js、Nuxt、Gatsby、Remix |
| 库 | jQuery |
| CSS框架 | Bootstrap、Tailwind CSS |
| CMS | WordPress,Wix |
| 电子商务 | Shopify |
分析和跟踪
| 类型 | 服务 |
|---|---|
| 分析 | 谷歌分析、Hotjar、分段、混合面板、堆、振幅 |
| 跟踪 | 谷歌标签管理器 |
| 营销 | Facebook Pixel、Intercom、HubSpot、Drift、LinkedIn Insight、Twitter Pixel、Pinterest Tag、TikTok Pixel |
扩展签名
签名定义见 src/config.ts。要添加新签名,请执行以下操作:
添加框架签名
// In frameworkSignatures array
{
name: 'MyFramework',
patterns: [
/my-framework/i,
/myframework\.js/,
],
category: 'frontend-framework',
versionPattern: /myframework@(\d+\.\d+\.\d+)/,
}添加标题签名
// In headerSignatures array
{
header: 'x-my-header',
patterns: [
{ pattern: /mytech/i, technology: 'MyTech', category: 'backend-framework' },
],
}添加分析签名
// In analyticsSignatures array
{
name: 'My Analytics',
type: 'analytics',
patterns: [
/myanalytics\.com/,
/myanalytics\.track/,
],
}发展
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Type checking
npm run typecheck
# Build
npm run build环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
| 端口 | HTTP服务器端口 | 3000 |
| 主机 | HTTP服务器主机 | 127.0.0.1 |
| FETCH_TIMEOUT | URL获取超时(毫秒) | 10000 |
响应格式
所有工具都返回一个标准的响应信封:
{
ok: boolean; // Success status
data: T; // Response data
meta: {
source?: string; // Data source (URL for fingerprint)
retrieved_at: string; // ISO-8601 timestamp
pagination: {
next_cursor: string | null;
};
warnings: string[]; // Any warnings or errors
};
}许可证
麻省理工学院
