MCP ExplorerExplorer

Flysecagent

@hnking-staron 9 months ago
39 MIT
FreeCommunity
AI Systems
FlySecAgent is an advanced network security intelligent assistant built on a powerful large language model and a flexible MCP (Model-Controller-Plugin) architecture. It aims to provide comprehensive support for cybersecurity professionals and enthusiasts through natural language interaction. FlySecAgent is capable of performing penetration testing tasks, querying the latest security vulnerability information, analyzing complex traffic data packets, and utilizing an integrated knowledge base for context-aware enhanced responses, ensuring the accuracy and depth of information. Through the MCP server, FlySecAgent can seamlessly invoke various external security tools (such as Nmap, Gobuster, Metasploit, etc.), thereby expanding its capability boundaries to address diverse security challenges. Whether for proactive defense, incident response, or security research, FlySecAgent can be your reliable assistant.

Overview

What is Flysecagent

FlySecAgent is an advanced network security intelligent assistant built on a powerful large language model and a flexible MCP (Model-Controller-Plugin) architecture. It aims to provide comprehensive support for cybersecurity professionals and enthusiasts through natural language interaction.

Use cases

Use cases for FlySecAgent include conducting penetration tests, querying the latest security vulnerabilities, analyzing complex traffic data packets, and providing context-aware responses using an integrated knowledge base.

How to use

To use FlySecAgent, configure the MCP server in the ‘mcp.json’ file, optionally prepare a knowledge base by placing relevant text files in the ‘knowledge_base_docs’ directory, and run the main program using ‘python main.py’. You can then input your questions or commands as prompted.

Key features

Key features of FlySecAgent include natural language interaction, MCP server integration, tool invocation (e.g., Nmap, Gobuster), multi-turn conversation memory, streaming output, optional knowledge base enhancement, and configurable model parameters.

Where to use

FlySecAgent can be used in various fields such as cybersecurity, penetration testing, incident response, and security research, making it a versatile tool for professionals in these areas.

Content

项目名称: FLYsecAgent

这是一个基于大语言模型和MCP(Model-Controller-Plugin)和Rag架构的网络安全智能助手项目。它旨在通过自然语言交互,帮助用户执行渗透测试任务、查询安全信息、分析流量包等。

功能特性

  • 自然语言交互: 用户可以通过自然语言向AI助手提问和下达指令。

  • MCP服务器集成: 通过 mcp.json 配置文件,可以灵活集成和管理多个MCP服务器,扩展助手的能力。

  • 工具调用: AI助手能够根据用户请求,调用配置的MCP服务器提供的工具(例如:nmap, gobuster, fofa, tavily-search等)。

  • 对话历史记忆: 支持多轮对话,能够记住之前的交互内容。

  • 流式输出: AI的回答可以流式输出,提供更好的用户体验。

  • 知识库增强 (可选): 支持通过本地知识库Rag(knowledge_base_docs目录)来增强AI的回答质量。

  • 可配置模型: 支持配置不同的语言模型参数。

  • 启动效果
    ![屏幕截图 2025-05-11 154031](https://raw.githubusercontent.com/hnking-star/FlySecAgent/master/ https://github.com/hnking-star/FlySecAgent/blob/main/images/屏幕截图 2025-05-11 154031.png)

    sqlmap调用效果:

    屏幕截图 2025-05-11 154031

    屏幕截图 2025-05-11 154031
    此外还可以调用dirsearch,nmap等工具

安装指南

  1. 克隆仓库:

    git clone https://github.com/hnking-star/FlySecAgent.git
    cd agent
    
  2. 创建并激活虚拟环境 (推荐):

    python -m venv .venv
    
    • Windows:
      .venv\Scripts\acti![屏幕截图 2025-05-11 154031](https://github.com/user-attachments/assets/3991c18f-9e01-41f0-8de2-963ff1d14a87)
      

vate
- macOS/Linux: bash
source .venv/bin/activate
```

  1. 安装依赖:

    pip install -r requirements.txt
    
  2. 安装 uv (重要):
    本项目使用 uv 作为 Python 包的运行器和部分场景下的安装器。

    • start.bat 脚本会自动尝试为您安装 uv
    • 如果您希望手动安装或在其他环境中使用,可以运行:
      pip install uv
      
      或者参考 uv 的官方文档进行安装。
      确保 uv 已成功安装并可以从命令行调用。

使用方法

  1. 配置MCP服务器:
    修改 mcp.json 文件,根据您的环境和需求配置MCP服务器。确保每个服务器的启动命令和参数正确无误。例如,您可能需要更新 TAVILY_API_KEY 或其他服务器特定的路径/参数。

  2. 准备知识库 (可选):
    如果您希望使用知识库增强功能,请将相关的文本文件(例如 .txt)放入 knowledge_base_docs 文件夹中。

  3. 运行主程序:

    python main.py
    

    程序启动后,您可以根据提示输入您的问题或指令。

文件结构

agent/
├── .venv/                  # Python虚拟环境 (被.gitignore忽略)
├── knowledge_base_docs/    # 知识库文档存放目录
│   └── ...
├── .gitignore              # Git忽略文件配置
├── main.py                 # 主程序入口
├── mcp.json                # MCP服务器配置文件
├── rag_embedding.py        # RAG嵌入相关 (如果使用)
├── rag_split.py            # RAG文本分割相关 (如果使用)
├── README.md               # 项目说明文件
├── requirements.txt        # Python依赖列表
├── LICENSE                 # 项目许可证
└── ... (其他脚本或配置文件)

配置文件 (.env)

上面对应的是所用模型api和key,下面对应的是embedding的key和url(使用阿里云的)

配置文件 (mcp.json)

此文件用于定义AI助手可以连接和使用的MCP服务器。每个服务器条目应包含:

  • name: 服务器的唯一名称。
  • params: 启动服务器所需的参数,通常包括 commandargs
  • cache_tools_list: 是否缓存工具列表。

MCP示例服务器配置:

stdio

{
  "name": "tavily-search",
  "params": {
    "command": "uv",
    "args": [
      "--directory",
      "F:\\ai\\mcp\\mcp_tool\\mcp-server-tavily",
      "run",
      "tavily-search"
    ],
    "env": {
      "TAVILY_API_KEY": "your_tavily_api_key_here",
      "PYTHONIOENCODING": "utf-8"
    }
  },
  "cache_tools_list": true
}

请确保将示例中的路径和API密钥替换为您自己的配置。

sse

知识库配置

在knowledge_base_docs添加相应的文件即可

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers