scanpay-mcp

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.

Category
Visit Server

README

ScanPay โ€” Code Security Scanner with x402 v2 Micropayments

npm version npm downloads GitHub License: MIT

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 (ast module) 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)

  1. Client requests scan โ†’ receives 402 Payment Required
  2. Client pays 0.0007 SOL (~$0.10) to merchant wallet via Solana
  3. Client retries with X-PAYMENT header containing payment proof
  4. 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 injection
  • subprocess with shell=True โ€” command injection
  • pickle.loads() โ€” deserialization attacks
  • os.system() โ€” command injection
  • SQL injection patterns
  • Path traversal (../)
  • Hardcoded credentials
  • And more...

JavaScript/TypeScript

  • eval() โ€” code injection
  • innerHTML โ€” XSS
  • document.write() โ€” XSS
  • new 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured