Back to MCP directory
publicPublicdnsLocal runtime

abuseipdb_mcp

AbuseIPDB的MCP服务器,提供API封装服务

article

README

🚀 用于AbuseIPDB API的MCP(管理控制平面)服务器

本项目是一个用于AbuseIPDB API的MCP(管理控制平面)服务器。它提供了一个简单的API接口包装器,方便与abuseipdb.com进行交互。不过,使用时需要你自行获取并使用自己的API令牌。此外,该工具可与smolagents配合使用,你可以参考example.py示例脚本。

🚀 快速开始

本服务器提供了简单的API接口包装器,可与abuseipdb.com进行交互。使用前,你需要自行获取并使用自己的API令牌。

此工具可以和smolagents配合使用,具体使用方法可参考example.py示例脚本。

💻 使用示例

基础用法

# 假设这是example.py中的基础使用代码
# 这里保持原始代码和注释不变,由于未给出具体代码,此处为示意
# 例如从文件中读取API令牌
with open('api_token.txt', 'r') as f:
    api_token = f.read().strip()

# 进行与AbuseIPDB API的交互操作
# 这里需要根据实际代码来写,以下为示例
import requests
url = 'https://api.abuseipdb.com/api/v2/check'
headers = {
    'Key': api_token,
    'Accept': 'application/json'
}
params = {
    'ipAddress': '8.8.8.8',
    'maxAgeInDays': 90
}
response = requests.get(url, headers=headers, params=params)
print(response.json())

高级用法

# 高级场景说明:当需要与smolagents配合使用时
# 这里假设存在一些与smolagents交互的代码逻辑
import smolagents
from abuseipdb_wrapper import AbuseIPDBWrapper

# 获取API令牌
with open('api_token.txt', 'r') as f:
    api_token = f.read().strip()

# 初始化AbuseIPDB包装器
abuseipdb = AbuseIPDBWrapper(api_token)

# 初始化smolagents
smol_agent = smolagents.SmolAgent()

# 结合两者进行操作
ip = '8.8.8.8'
abuse_info = abuseipdb.check_ip(ip)
smol_agent.process_abuse_info(abuse_info)

⚠️ 重要提示

使用此工具需要自行获取并使用自己的AbuseIPDB API令牌。

💡 使用建议

可参考example.py示例脚本来快速上手该工具与AbuseIPDB API以及smolagents的交互。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client