scanpay-mcp
Enables AI agents to scan code for security vulnerabilities before execution, supporting Python and JavaScript/TypeScript with deterministic AST-based analysis and optional Solana micropayments.
README
ScanPay — Code Security Scanner with x402 v2 Micropayments
Deterministic AST-based security scanning for Python and JavaScript/TypeScript. No code execution. No AI inference. Just fast, reliable vulnerability detection. Pay per scan with Solana micropayments — $0.10/scan.
🎯 What It Does
ScanPay analyzes source code for security vulnerabilities using deterministic AST parsing. No AI, no code execution — just fast, reliable pattern matching that catches 45+ vulnerability classes before code runs.
Built for AI agents that generate code: scan before execution, block dangerous patterns, log audit trails.
✨ Features
- 45+ vulnerability patterns across Python and JS/TS/TSX
- Deterministic analysis — same input always produces same output
- x402 v2 payment protocol — pay per scan with SOL on Solana
- Dual language support — Python (
astmodule) and JS/TS (tree-sitter) - No false AI hallucinations — pure rule-based detection
- FastAPI-powered — sub-100ms scan latency
- SARIF output — industry-standard vulnerability report format
- Batch scanning — scan multiple files in one request
🚀 Quick Start
Using the Live API (testnet)
# Health check
curl https://repository-nil-camcorder-divx.trycloudflare.com/api/v1/health
# List available products
curl https://repository-nil-camcorder-divx.trycloudflare.com/api/v1/products
# Scan code (requires payment)
curl -X POST https://repository-nil-camcorder-divx.trycloudflare.com/api/v1/scan \
-H "Content-Type: application/json" \
-d '{"source_code":"eval(userInput)","language":"python"}'
# → 402 Payment Required (0.0007 SOL)
Self-Host
git clone https://github.com/Misterio070/scanpay.git
cd scanpay
pip install -r requirements.txt
python main.py
# → http://localhost:8484
💳 Payment Flow (x402 v2)
- Client requests scan → receives
402 Payment Required - Client pays 0.0007 SOL (~$0.10) to merchant wallet via Solana
- Client retries with
X-PAYMENTheader containing payment proof - Server verifies payment on-chain, runs scan, returns results
Merchant wallet: JDKXvegmW5j4sAJPB6YCA9ffJbN422WLMmCWCcpy1vm4
🤖 For AI Agents (MCP Server)
ScanPay includes an MCP server for AI agents to scan code before execution:
{
"mcpServers": {
"scanpay": {
"command": "npx",
"args": ["-y", "scanpay-cli", "scanpay-mcp"],
"env": { "SCANPAY_URL": "https://repository-nil-camcorder-divx.trycloudflare.com" }
}
}
}
Agents call scan_code to check code for vulnerabilities before running it.
Network: Solana testnet (mainnet coming soon)
📋 Configuration
cp .env.example .env
| Env Var | Default | Description |
|---|---|---|
SCANPAY_PAYMENT_MODE |
disabled |
disabled, testnet, or mainnet |
SCANPAY_MERCHANT_WALLET |
— | Solana wallet address |
SCANPAY_PRICE_LAMPORTS |
700000 |
Price in lamports (0.0007 SOL) |
SCANPAY_RPC_URL |
https://api.devnet.solana.com |
Solana RPC endpoint |
SCANPAY_PORT |
8484 |
Server port |
🧪 Detected Vulnerabilities
Python
eval()/exec()— code injectionsubprocesswithshell=True— command injectionpickle.loads()— deserialization attacksos.system()— command injection- SQL injection patterns
- Path traversal (
../) - Hardcoded credentials
- And more...
JavaScript/TypeScript
eval()— code injectioninnerHTML— XSSdocument.write()— XSSnew Function()— code injection- SQL injection patterns
- Prototype pollution
- And more...
📊 API Reference
GET /api/v1/health
Returns service status and configuration.
GET /api/v1/products
Returns available scan products and pricing.
POST /api/v1/scan
Scans source code for vulnerabilities. Requires payment in testnet/mainnet mode.
Request:
{
"source_code": "eval(userInput)",
"language": "python"
}
Response (200):
{
"status": "ok",
"findings": [
{
"rule": "PY001",
"severity": "critical",
"message": "Use of eval() detected — code injection risk",
"line": 1
}
],
"summary": {
"total": 1,
"critical": 1,
"high": 0,
"medium": 0,
"low": 0
}
}
🤝 Built For
- AI Agents — scan generated code before execution
- CI/CD Pipelines — pre-deployment security gate
- IDE Extensions — real-time vulnerability detection
- Code Review — automated security audit
📄 License
MIT
🔗 Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。