Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

FlySecAgent

MCP.Pizza Chef: hnking-star

FlySecAgent is a sophisticated MCP server designed for network security professionals and enthusiasts. It leverages large language models and a flexible MCP architecture to enable natural language interaction for penetration testing, vulnerability querying, traffic analysis, and contextual knowledge-enhanced responses. It seamlessly integrates external security tools like Nmap, Gobuster, and Metasploit, expanding its capabilities to handle diverse security challenges including active defense, incident response, and security research.

Use This MCP server To

Execute penetration testing tasks via natural language commands Query latest security vulnerabilities and threat intelligence Analyze complex network traffic data packets Integrate and orchestrate external security tools like Nmap and Metasploit Support multi-turn conversations with memory of past interactions Enhance responses using local knowledge base documents Stream AI-generated security analysis and reports in real time Configure and switch between different language model parameters

README

项目名称: 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

    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)

BASE_URL=https://api.302.ai
API_KEY=your_r_api_key
MODEL_NAME=gpt-4o


EMBEDDING_API_KEY=your_embedding_api_key
OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1

上面对应的是所用模型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

{"name":"mcpname",
      "url":"http://127.0.0.1:8009/sse"
},

知识库配置

在knowledge_base_docs添加相应的文件即可

FlySecAgent FAQ

How does FlySecAgent integrate external security tools?
FlySecAgent uses MCP server architecture to call and manage tools like Nmap, Gobuster, and Metasploit seamlessly within AI workflows.
Can FlySecAgent handle multi-turn conversations?
Yes, it supports dialogue history memory to maintain context across multiple interactions.
Is it possible to customize the language models used by FlySecAgent?
Yes, FlySecAgent allows configuration of different language model parameters to suit various security tasks.
How does FlySecAgent enhance its responses with additional knowledge?
It can optionally use a local knowledge base (Rag architecture) to provide context-aware, accurate answers.
Does FlySecAgent support real-time output streaming?
Yes, it streams AI-generated answers to improve user experience during interactions.
What types of security tasks can FlySecAgent perform?
It can perform penetration testing, vulnerability queries, traffic analysis, active defense, and incident response.
Is FlySecAgent suitable for both security professionals and enthusiasts?
Yes, it is designed to assist a wide range of users from beginners to experts in network security.
How does FlySecAgent ensure accuracy in its security information?
By combining large language models with integrated knowledge bases and real-time tool data, it ensures depth and accuracy.