asi-mcp

asi-mcp

AI-powered Attack Surface Intelligence server that exposes industry-standard penetration testing tools via MCP, enabling AI agents to perform comprehensive security assessments.

Category
访问服务器

README

Attack Surface Intelligence (ASI-MCP)

AI-Powered Attack Surface Intelligence via Model Context Protocol

⚠️ DISCLAIMER: This is a proof of concept intended for testing and educational purposes only. Do not use in production environments. Use only against systems you have explicit authorization to test.

Overview

ASI-MCP is an intelligent security assessment platform that provides AI-driven orchestration of industry-standard penetration testing and vulnerability assessment tools through the Model Context Protocol (MCP). By exposing security tools as MCP-compatible services, ASI-MCP enables AI agents to conduct comprehensive security assessments with human-like reasoning and automation.

Key Features

Comprehensive Tool Coverage

  • Network reconnaissance and port scanning (nmap, masscan, rustscan)
  • Web application vulnerability scanning (nuclei, nikto, sqlmap)
  • Directory and file enumeration (gobuster, feroxbuster, ffuf, dirsearch)
  • Web application firewall detection (wafw00f)
  • Content discovery and crawling (gospider, katana, httpx)
  • Authentication testing and credential brute-forcing (hydra)
  • Domain reconnaissance (subfinder, theHarvester)
  • Binary analysis (strings, radare2, binwalk)

AI-Native Architecture

  • Model Context Protocol (MCP) integration for seamless AI agent interaction
  • Asynchronous job execution for long-running scans
  • Real-time status monitoring and progress tracking
  • Structured JSON output optimized for AI analysis

Enterprise Security

  • Target validation and safety controls
  • Comprehensive audit logging
  • Rate limiting and resource management
  • Non-root container execution
  • Health monitoring and metrics

Production-Ready

  • Docker containerization with Kali Linux base
  • FastAPI-based REST API
  • Persistent job storage
  • Built-in validation for all security tools

Architecture

ASI-MCP is built on a multi-layered architecture:

┌─────────────────────────────────────┐
│   AI Agent (Claude, n8n, etc.)     │
└─────────────┬───────────────────────┘
              │ MCP Protocol
┌─────────────▼───────────────────────┐
│      ASI-MCP Server (FastAPI)       │
│  ┌───────────────────────────────┐  │
│  │   Job Management & Queueing   │  │
│  └───────────────────────────────┘  │
│  ┌───────────────────────────────┐  │
│  │  Security Tool Orchestration  │  │
│  └───────────────────────────────┘  │
│  ┌───────────────────────────────┐  │
│  │  Validation & Safety Layer    │  │
│  └───────────────────────────────┘  │
└─────────────┬───────────────────────┘
              │
┌─────────────▼───────────────────────┐
│    Security Tools (Kali Linux)      │
│  nmap | nuclei | gobuster | nikto   │
│  sqlmap | hydra | gospider | ...    │
└─────────────────────────────────────┘

Quick Start

Prerequisites

  • Docker
  • Docker Compose
  • 4GB RAM minimum
  • 20GB disk space

Installation

  1. Clone the repository:
git clone https://github.com/deruke/asi-mcp.git
cd asi-mcp
  1. Build and start the container:
docker-compose up -d --build
  1. Verify the server is running:
curl http://localhost:3000/health

Expected response:

{"status":"healthy","service":"mcp-security-server","version":"1.0.0"}

Usage

Direct API Access

ASI-MCP exposes a JSON-RPC 2.0 API over HTTP for MCP tool invocation:

Example: Port Scan

curl -X POST http://localhost:3000/messages \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "nmap_scan",
      "arguments": {
        "target": "scanme.nmap.org",
        "ports": "80,443",
        "scan_type": "fast"
      }
    }
  }'

Example: Web Vulnerability Scan

curl -X POST http://localhost:3000/messages \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "nuclei_scan",
      "arguments": {
        "target": "https://example.com",
        "profile": "pentest"
      }
    }
  }'

Asynchronous Scanning

For long-running scans, use the asynchronous job API:

1. Start a scan job:

curl -X POST http://localhost:3000/scan/start \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "nmap_scan",
    "target": "scanme.nmap.org",
    "scan_type": "comprehensive"
  }'

Response:

{
  "job_id": "abc123",
  "status": "running",
  "tool": "nmap_scan",
  "target": "scanme.nmap.org"
}

2. Check job status:

curl http://localhost:3000/scan/status/abc123

3. Get results:

curl http://localhost:3000/scan/results/abc123

AI Agent Integration

ASI-MCP is designed for use with AI agents via MCP:

Example with n8n:

// Add MCP tool node
{
  "name": "ASI-MCP",
  "type": "mcp",
  "server": "http://localhost:3000",
  "tool": "nmap_scan",
  "arguments": {
    "target": "{{ $json.target }}",
    "ports": "1-1000"
  }
}

Example with Claude Desktop (config.json):

{
  "mcpServers": {
    "asi-mcp": {
      "url": "http://localhost:3000"
    }
  }
}

Available Tools

Network Reconnaissance

  • nmap_scan - Network port scanning and service detection
  • masscan_scan - High-speed port scanning
  • rustscan_scan - Fast port scanner with automatic nmap integration

Web Application Security

  • nuclei_scan - Vulnerability scanning with 8000+ templates (pentest profile default)
  • nikto_scan - Web server vulnerability scanner
  • sqlmap_scan - SQL injection detection and exploitation
  • gobuster_scan - Directory and file brute-forcing (raft wordlists)
  • feroxbuster_scan - Fast content discovery
  • ffuf_scan - Web fuzzing tool
  • dirsearch_scan - Web path scanner
  • httpx_scan - HTTP toolkit for probing
  • wafw00f_scan - Web application firewall detection
  • gospider_scan - Web crawler for URL and resource discovery
  • katana_scan - Next-generation web crawler
  • wpscan_scan - WordPress security scanner
  • http_request - HTTP client for content fetching and endpoint testing

Authentication & Credentials

  • hydra_bruteforce - Network authentication brute-forcing

Domain Intelligence

  • subfinder_scan - Subdomain discovery
  • theharvester_scan - OSINT and information gathering

Binary Analysis

  • strings_analyze - Extract readable strings from binaries
  • radare2_analyze - Binary analysis and reverse engineering
  • binwalk_analyze - Firmware analysis and extraction

Configuration

Environment Variables

Create a .env file in the project root:

# Server Configuration
HOST=0.0.0.0
PORT=3000
LOG_LEVEL=INFO

# Security Settings
ALLOWED_TARGETS=*  # Comma-separated list or * for all
RATE_LIMIT_PER_MINUTE=60

# Job Management
MAX_CONCURRENT_JOBS=5
JOB_TIMEOUT_SECONDS=3600

Docker Configuration

Modify docker-compose.yml to customize:

services:
  mcp-security-server:
    build: .
    ports:
      - "3000:3000"
    environment:
      - LOG_LEVEL=INFO
    volumes:
      - ./logs:/app/logs
      - ./scans:/tmp/scans
    restart: unless-stopped

Tool-Specific Configuration

Nuclei

  • Default Profile: pentest (excludes DoS, fuzzing, and OSINT templates)
  • Templates Location: /home/mcpuser/nuclei-templates
  • Auto-update: Templates update on container build

Gobuster

  • Default Wordlist: raft-medium-directories.txt (30,000 entries)
  • Available Wordlists:
    • raft-small: 20,115 entries
    • raft-medium: 29,999 entries
    • raft-large: 62,281 entries
  • Location: /usr/share/seclists/Discovery/Web-Content/

Nikto

  • Timeout: 1800 seconds (30 minutes)
  • Max Scan Time: 1500 seconds (25 minutes with -maxtime)
  • Output Format: JSON with stdout fallback

Development

Local Development Setup

  1. Install Python dependencies:
pip install -r requirements.txt
  1. Run the server locally:
python -m uvicorn src.server:app --host 0.0.0.0 --port 3000 --reload
  1. Run tests:
pytest tests/

Project Structure

asi-mcp/
├── src/
│   ├── server.py           # FastAPI application and MCP server
│   ├── logging_config.py   # Logging configuration
│   ├── safety.py           # Target validation and safety controls
│   └── tools/
│       ├── network.py      # Network scanning tools
│       ├── web.py          # Web application security tools
│       └── binary.py       # Binary analysis tools
├── config/
│   └── logging.yaml        # Logging configuration
├── docs/
│   ├── fixes-2026-01-14.md
│   └── build-verification.md
├── tests/
│   └── test_*.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md

Adding New Tools

  1. Create tool function in appropriate module (src/tools/)
  2. Add MCP tool definition to list_tools()
  3. Register handler in get_tools()
  4. Add target parameter mapping in src/server.py
  5. Update documentation

Example:

# src/tools/web.py
async def new_tool_scan(target: str) -> Dict[str, Any]:
    """New security tool implementation."""
    validator = get_validator()
    validator.validate_target(target)

    cmd = ["tool-command", target]
    result = await execute_command(cmd, timeout=300, tool_name="new_tool")

    return {
        "tool": "new_tool",
        "target": target,
        "success": result["success"],
        "output": result["stdout"]
    }

Security Considerations

Warning: ASI-MCP contains powerful security testing tools. Use responsibly and only against systems you have explicit authorization to test.

Best Practices

  1. Authorization: Always obtain written permission before scanning
  2. Scope: Define and respect engagement boundaries
  3. Rate Limiting: Configure appropriate limits to avoid service disruption
  4. Logging: Enable comprehensive audit logs for compliance
  5. Network Isolation: Run in isolated networks when possible
  6. Target Validation: Use allowlists for authorized targets

Legal Notice

Unauthorized security testing may be illegal in your jurisdiction. Users are solely responsible for ensuring compliance with applicable laws and regulations. The authors and contributors of ASI-MCP assume no liability for misuse of this software.

Performance

Resource Requirements

Minimum:

  • 2 CPU cores
  • 4GB RAM
  • 20GB disk space

Recommended:

  • 4+ CPU cores
  • 8GB+ RAM
  • 50GB+ disk space (for scan results)

Benchmarks

Typical scan times on recommended hardware:

  • nmap comprehensive scan (1000 ports): 5-15 minutes
  • nuclei pentest profile: 5-10 minutes
  • gobuster raft-medium: 2-5 minutes
  • nikto scan: 15-25 minutes
  • gospider crawl (depth 2): 1-3 minutes

Troubleshooting

Common Issues

Container won't start

# Check logs
docker logs mcp-security-server

# Rebuild without cache
docker-compose down
docker-compose up -d --build --no-cache

Tools not found

# Verify tool installation
docker exec mcp-security-server which nmap
docker exec mcp-security-server nuclei -version

Job timeout

# Increase timeout in .env
JOB_TIMEOUT_SECONDS=7200

# Restart container
docker-compose restart

Permission denied errors

# Check container user
docker exec mcp-security-server whoami

# Verify file permissions
docker exec mcp-security-server ls -la /tmp/scans

Roadmap

  • Integration with vulnerability management platforms
  • Scheduled scanning capabilities
  • Enhanced reporting and visualization
  • Support for distributed scanning
  • Integration with CI/CD pipelines
  • Additional OSINT and reconnaissance tools
  • Cloud security assessment capabilities

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-tool)
  3. Commit your changes (git commit -m 'Add new security tool')
  4. Push to the branch (git push origin feature/new-tool)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add tests for new functionality
  • Update documentation
  • Ensure all tests pass before submitting PR

License

MIT License

Copyright (c) 2026 ASI-MCP Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Support

  • GitHub Issues: https://github.com/yourusername/asi-mcp/issues
  • Documentation: https://github.com/yourusername/asi-mcp/wiki
  • Security Issues: security@yourdomain.com (responsible disclosure)

Acknowledgments

Built with:

  • Model Context Protocol (MCP) by Anthropic
  • Kali Linux security tools
  • FastAPI web framework
  • Docker containerization

Special thanks to the security research community and open-source tool maintainers.


ASI-MCP - AI-Powered Attack Surface Intelligence

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选