返回市场
MCP-可用者

MCP-可用者

作者:mfakbar1274 星标更新:2025-10-13

项目介绍

MCP-Ables

将任何shell命令转换为MCP服务器

为何要为每个需求编写长篇的MCP服务器代码,当你可以使用MCP-Ables时?

什么是MCP-Ables?

MCP-Ables弥合了命令行工具与AI代理(如Claude Code)之间的差距。只需编写一个简单的YAML文件来描述你的shell命令,MCP-Ables会自动生成一个AI代理可以调用的MCP(模型上下文协议)服务器。

无需Python编程。无需复杂设置。只需YAML → MCP → 可供AI调用的工具。

快速开始

预备条件

  • Python 3.11+
  • 想要暴露的命令行工具(例如:nuclei, nmap, kubectl 等)

安装

git clone https://github.com/mfakbar127/MCP-Ables.git
cd MCP-Ables
pip install -r requirements.txt

使用方法

  1. 创建一个描述你的工具的YAML文件(参见下面的例子)
  2. 运行MCP-Ables,指定文件或目录:
    # 单个文件
    python mcpables-main.py examples/nuclei.yaml
    
    # 目录(递归扫描.yaml/.yml文件)
    python mcpables-main.py examples/
    
  3. 现在MCP服务器'mcpables'正在运行,并包含了所有的工具!

YAML示例 - 简单Echo

examples/tools/echo.yaml:

name: echo_message
description: 将消息回显到标准输出(简单测试工具)

run:
  kind: shell
  cmd: "echo {{message}}"

args:
  message:
    type: string
    description: "要回显的消息"
    required: true

运行它:

python mcpables-main.py examples/tools/echo.yaml

可用的MCP工具

工具名称描述类别位置
cloudlist跨云提供商枚举资产(ProjectDiscovery)安全tools/security/pd/cloudlist.yaml
subfinder被动子域枚举(ProjectDiscovery)安全tools/security/pd/subfinder.yaml
naabu主机快速端口扫描(ProjectDiscovery)安全tools/security/pd/naabu.yaml
asnmap查找ASN、域名、IP和组织网络范围(ProjectDiscovery)安全tools/security/pd/asnmap.yaml
mapcidrCIDR/IP处理和切片用于批量扫描(ProjectDiscovery)安全tools/security/pd/mapcidr.yaml
hacking-tools包含攻击性工具(sqlmap, hydra, gobuster, nikto)安全tools/security/hacking-tools.yaml

使用场景

🔐 安全运营氛围

从聊天中运行安全扫描器以枚举资产、发现漏洞并绘制攻击面;你可以运行如nmap、nuclei和subfinder等命令。

🎯 黑客氛围

触发SQL注入测试、暴力破解、内容发现和Web扫描等进攻性工作流程;你可以运行如sqlmap、hydra、gobuster和nikto等命令。

🚀 开发运维氛围

通过聊天控制基础设施进行部署、集群操作、配置管理和打包;你可以运行如kubectl、terraform、ansible和helm等命令。

🖥️ 系统管理员氛围

通过聊天管理服务器,包括服务、容器、日志和防火墙规则;你可以运行如systemctl、docker、journalctl和iptables等命令。

🌐 网络运维氛围

运行网络诊断,如连通性测试、路径追踪、DNS查询和域名查找;你可以运行如ping、traceroute、dig和whois等命令。

📊 数据处理氛围

从CLI处理数据,包括JSON解析、HTTP请求、文本过滤和媒体转换;你可以运行如jq、curl、grep/awk和ffmpeg等命令。

YAML模式

参见examples/

单工具格式

name: <tool_name>
description: <简短描述供AI代理理解>

run:
  kind: shell
  cmd: "命令 {{arg1}} {{arg2}}"

args:
  arg1:
    type: string|int|float|bool
    description: "此参数的作用"
    required: true|false
    default: <可选默认值>

多工具格式

在一个YAML文件中定义多个工具:

tools:
  - name: tool1
    description: 第一个工具描述
    run:
      kind: shell
      cmd: "命令1 {{arg1}}"
    args:
      arg1:
        type: string
        description: "参数描述"
        required: true

  - name: tool2
    description: 第二个工具描述
    run:
      kind: shell
      cmd: "命令2 {{arg2}}"
    args:
      arg2:
        type: int
        description: "参数描述"
        required: false
        default: 10

参数字段

  • type: 数据类型(string, int, float, bool
  • description: 人类可读的解释,供AI代理理解使用
  • required: 参数是否必须提供(truefalse
  • default: 如果未提供,默认值(仅适用于可选参数)

示例

Nuclei扫描器

examples/tools/nuclei.yaml:

name: nuclei_scan
description: 对目标URL或IP地址运行Nuclei漏洞扫描器

run:
  kind: shell
  cmd: "nuclei -c {{concurrency}} -t {{target}} -t {{template_path}}"

args:
  target:
    type: string
    description: "要扫描的目标URL或IP地址(例如:https://example.com)"
    required: true

  template_path:
    type: string
    description: "Nuclei模板目录路径(例如:~/nuclei-templates/)"
    required: true

  concurrency:
    type: int
    description: "并发请求数量(1-100)"
    required: false
    default: 10

多工具示例

examples/security-tools.yaml:

tools:
  - name: nmap_scan
    description: 对目标运行Nmap网络扫描器
    run:
      kind: shell
      cmd: "nmap {{scan_type}} {{target}}"
    args:
      target:
        type: string
        description: "目标IP或主机名"
        required: true
      scan_type:
        type: string
        description: "扫描类型标志(例如:-sV)"
        required: false
        default: "-sV"

  - name: whois_lookup
    description: 对域名执行WHOIS查询
    run:
      kind: shell
      cmd: "whois {{domain}}"
    args:
      domain:
        type: string
        description: "要查询的域名"
        required: true

  - name: dig_dns
    description: 使用dig命令进行DNS查询
    run:
      kind: shell
      cmd: "dig {{record_type}} {{domain}}"
    args:
      domain:
        type: string
        description: "要查询的域名"
        required: true
      record_type:
        type: string
        description: "DNS记录类型(A, MX, TXT等)"
        required: false
        default: "A"

运行它:

python mcpables-main.py examples/security-tools.yaml
# 加载3个工具:nmap_scan, whois_lookup, dig_dns

目录示例

将工具组织在单独的文件中:

examples/tools/
├── ping.yaml     (ping_host工具)
├── curl.yaml     (http_request工具)
└── ...

从目录运行所有工具:

python mcpables-main.py examples/tools/
# 递归加载所有.yaml/.yml文件

Claude Desktop集成

将MCP-Ables连接到Claude Desktop,使AI可以直接从聊天中使用你的工具。

配置

  1. 定位Claude Desktop配置文件

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 添加MCP-Ables服务器

{
  "mcpServers": {
    "mcpables": {
      "command": "python",
      "args": [
        "/绝对路径/to/mcpables-main.py",
        "/绝对路径/to/examples/"
      ]
    }
  }
}
  1. 重启Claude Desktop - 工具将自动出现

配置示例

单个文件(特定氛围)

{
  "mcpServers": {
    "secops": {
      "command": "python",
      "args": ["/路径/to/mcpables-main.py", "/路径/to/examples/secops-tools.yaml"]
    }
  }
}

目录(所有工具)

{
  "mcpServers": {
    "mcpables-all": {
      "command": "python",
      "args": ["/路径/to/mcpables-main.py", "/路径/to/examples/"]
    }
  }
}

多个配置(不同氛围)

{
  "mcpServers": {
    "secops": {
      "command": "python",
      "args": ["/路径/to/mcpables-main.py", "/路径/to/examples/secops-tools.yaml"]
    },
    "devops": {
      "command": "python",
      "args": ["/路径/to/mcpables-main.py", "/路径/to/examples/devops-tools.yaml"]
    },
    "netops": {
      "command": "python",
      "args": ["/路径/to/mcpables-main.py", "/路径/to/examples/netops-tools.yaml"]
    }
  }
}

验证连接

重启Claude Desktop后,可以通过以下方式验证工具是否可用:

  • 输入消息询问Claude关于可用的工具
  • 工具将以如nuclei_scan, nmap_scan等名字出现
  • Claude现在可以直接执行命令!

作者

Muh. Fani "Rama" Akbar创建 linkedin.com/in/mf-akbar/