MCP AbuseIPDB Server

MCP AbuseIPDB Server

Provides threat intelligence lookups against the AbuseIPDB database, enabling IP reputation checks, CIDR block analysis, and log enrichment. It features intelligent caching and rate limiting to efficiently manage API usage for security analysis and automated workflows.

Category
访问服务器

README

MCP AbuseIPDB Server

An MCP (Model Context Protocol) server that provides threat intelligence lookups against the AbuseIPDB database. This server enables any MCP-capable client to perform IP reputation checks, CIDR block analysis, and access curated blacklists with intelligent caching and rate limiting.

Features

  • IP Reputation Checks: Single IP address lookups with detailed abuse data
  • CIDR Block Analysis: Check entire network ranges for malicious activity
  • Blacklist Access: Retrieve current AbuseIPDB blacklist with configurable confidence levels
  • Bulk Operations: Check multiple IP addresses efficiently
  • Log Enrichment: Extract and analyze IP addresses from log lines
  • Intelligent Caching: SQLite-based caching with TTL to minimize API usage
  • Rate Limiting: Built-in quota management for AbuseIPDB API limits
  • Security Focused: Input validation, private IP filtering, and secure defaults

Quick Start

Prerequisites

  • Python 3.11 or higher
  • AbuseIPDB API key (get one at abuseipdb.com)

Installation

  1. Clone the repository:
git clone <repository-url>
cd AbuseIPDB-MCP
  1. Install the package:
pip install -e .
  1. Set up your environment:
cp .env.example .env
# Edit .env and add your ABUSEIPDB_API_KEY
  1. Run the server:
python -m mcp_abuseipdb.server

MCP Client Configuration

Option 1: Using the Enhanced Startup Script (Recommended)

Add to your MCP client configuration (e.g., mcp.json):

{
  "mcpServers": {
    "mcp-abuseipdb": {
      "command": "python",
      "args": ["scripts/start_mcp_server.py"],
      "cwd": "/path/to/AbuseIPDB-MCP",
      "env": {
        "ABUSEIPDB_API_KEY": "your_api_key_here"
      }
    }
  }
}

Option 2: Direct Module Execution

{
  "mcpServers": {
    "mcp-abuseipdb": {
      "command": "python",
      "args": ["-m", "mcp_abuseipdb.server"],
      "cwd": "/path/to/AbuseIPDB-MCP",
      "env": {
        "ABUSEIPDB_API_KEY": "your_api_key_here"
      }
    }
  }
}

Important Notes:

  • Replace your_api_key_here with your actual AbuseIPDB API key
  • Update /path/to/AbuseIPDB-MCP to the actual path where you cloned this repository
  • The enhanced startup script (Option 1) provides better error diagnostics
  • Ensure your API key is valid and not expired on the AbuseIPDB website

Available Tools

check_ip

Check the reputation of a single IP address.

Parameters:

  • ip_address (required): IP address to check
  • max_age_days (optional): Maximum age of reports (default: 30)
  • verbose (optional): Include detailed reports (default: false)
  • threshold (optional): Confidence threshold for flagging (default: 75)

check_block

Check the reputation of a CIDR network block.

Parameters:

  • network (required): CIDR network (e.g., "192.168.1.0/24")
  • max_age_days (optional): Maximum age of reports (default: 30)

get_blacklist

Retrieve the AbuseIPDB blacklist.

Parameters:

  • confidence_minimum (optional): Minimum confidence level (default: 90)
  • limit (optional): Maximum entries to retrieve

bulk_check

Check multiple IP addresses efficiently.

Parameters:

  • ip_addresses (required): List of IP addresses
  • max_age_days (optional): Maximum age of reports (default: 30)
  • threshold (optional): Confidence threshold for flagging (default: 75)

enrich_log_line

Extract and analyze IP addresses from log entries.

Parameters:

  • log_line (required): Log line containing IP addresses
  • threshold (optional): Confidence threshold for flagging (default: 75)
  • max_age_days (optional): Maximum age of reports (default: 30)

Available Resources

cache://info

Get current cache statistics and rate limiter status.

doc://usage

Complete API usage documentation and examples.

Available Prompts

triage_ip

Generate security analyst triage notes for an IP address.

Parameters:

  • ip_data (required): IP check data from AbuseIPDB

Configuration

All configuration is done via environment variables. Copy .env.example to .env and customize:

Required Settings

  • ABUSEIPDB_API_KEY: Your AbuseIPDB API key

Optional Settings

  • MAX_AGE_DAYS: Default report age limit (default: 30)
  • CONFIDENCE_THRESHOLD: Default confidence threshold (default: 75)
  • DAILY_QUOTA: API request quota (default: 1000)
  • CACHE_DB_PATH: SQLite cache file location (default: ./cache.db)
  • LOG_LEVEL: Logging level (default: INFO)
  • ALLOW_PRIVATE_IPS: Allow checking private IPs (default: false)

Usage Examples

Basic IP Check

Check the reputation of 8.8.8.8

Log Analysis

Analyze this log line for threats:
192.168.1.100 - - [10/Jan/2024:10:00:00 +0000] "GET /admin/login.php HTTP/1.1" 200 1234

Bulk Analysis

Check these IPs for malicious activity:
- 203.0.113.100
- 198.51.100.50
- 192.0.2.25

Security Investigation

I'm investigating suspicious activity from 203.0.113.100. Can you:
1. Check its reputation with detailed reports
2. Analyze the surrounding network block
3. Generate triage notes for our security team

See examples/queries.md for more detailed examples.

Docker Deployment

Build and run with Docker:

# Build the image
docker build -f docker/Dockerfile -t mcp-abuseipdb .

# Run the container
docker run -e ABUSEIPDB_API_KEY=your_key_here mcp-abuseipdb

Development

Setup Development Environment

pip install -e ".[dev]"
pre-commit install

Run Tests

pytest

Security Considerations

  • API Key Protection: Never commit API keys to version control
  • Private IP Filtering: Private IPs are blocked by default
  • Rate Limiting: Built-in quota management prevents API abuse
  • Input Validation: All inputs are validated and sanitized
  • Caching: Reduces API calls and improves performance

Rate Limits

AbuseIPDB free tier provides 1,000 requests per day. This server:

  • Implements intelligent caching to minimize API usage
  • Provides rate limiting with configurable quotas
  • Gracefully handles rate limit errors with backoff

Troubleshooting

"Unauthorized API key" Error in Claude App

If you're getting unauthorized API key errors when using the MCP server with Claude:

  1. Verify API Key Configuration:

    # Test your API key with the diagnostic script
    python diagnostics/api_auth_diagnostic.py
    
  2. Check Claude App Configuration:

    • Ensure your mcp.json has the correct API key in the env section
    • Verify the cwd path points to your project directory
    • Make sure the API key value matches exactly (no extra spaces)
  3. Use Enhanced Startup Script:

    • Switch to Option 1 configuration (enhanced startup script)
    • Check the server logs in Claude app for diagnostic messages
    • Look for [MCP AbuseIPDB] prefixed messages
  4. Environment Variable Issues:

    • Ensure your .env file is in the project root directory
    • Verify the API key in .env matches your Claude app configuration
    • Check that the API key is valid on the AbuseIPDB website
  5. Debug Steps:

    # Test local server startup
    python scripts/start_mcp_server.py
    
    # Check environment loading
    python -c "from mcp_abuseipdb.settings import Settings; print('API key loaded:', bool(Settings().abuseipdb_api_key))"
    

Common Issues

  • "No .env file found": Make sure .env exists in project root or set API key in Claude app config
  • "Settings API key: EMPTY": API key not properly loaded from environment
  • "Environment var: EMPTY": API key not set in Claude app MCP configuration
  • Connection timeouts: Check your internet connection and AbuseIPDB service status

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Run the test suite and linting
  5. Submit a pull request

License

MIT License — see LICENSE for details.

Support

  • Documentation: See examples/ directory
  • Issues: Please report bugs and feature requests via GitHub issues
  • API Documentation: AbuseIPDB API Docs

Changelog

v0.1.0

  • Initial release
  • Basic IP checking functionality
  • CIDR block analysis
  • Blacklist access
  • Bulk operations
  • Log enrichment
  • Caching and rate limiting
  • Docker support

推荐服务器

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

官方
精选