Content
# Project Name: FLYsecAgent
This is a network security intelligent assistant project based on large language models and MCP (Model-Controller-Plugin) and Rag architecture. It aims to help users perform penetration testing tasks, query security information, analyze traffic packets, etc. through natural language interaction.
## Features
- **Natural Language Interaction**: Users can ask questions and issue instructions to the AI assistant through natural language.
- **MCP Server Integration**: Through the `mcp.json` configuration file, multiple MCP servers can be flexibly integrated and managed to expand the assistant's capabilities.
- **Tool Calling**: The AI assistant can call the tools provided by the configured MCP server according to user requests (e.g., nmap, gobuster, fofa, tavily-search, etc.).
- **Conversation History Memory**: Supports multi-turn conversations and can remember previous interactions.
- **Streaming Output**: The AI's answers can be streamed to provide a better user experience.
- **Knowledge Base Enhancement (Optional)**: Supports enhancing the AI's answer quality through local knowledge base Rag (the `knowledge_base_docs` directory).
- **Configurable Model**: Supports configuring different language model parameters.
**Startup Effect**
<img src="https://github.com/hnking-star/FlySecAgent/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-05-11%20154031.png">
**sqlmap Calling Effect**:
<img src="https://github.com/hnking-star/FlySecAgent/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-05-11%20162500.png">
<img src="https://github.com/hnking-star/FlySecAgent/blob/main/images/360%E6%88%AA%E5%9B%BE20250511162615.png">
In addition, tools such as dirsearch and nmap can also be called
## Installation Guide
1. **Clone the Repository**:
```bash
git clone https://github.com/hnking-star/FlySecAgent.git
cd agent
```
2. **Create and Activate a Virtual Environment** (Recommended):
```bash
python -m venv .venv
```
- Windows:
```bash
.venv\Scripts\acti<img src="https://github.com/user-attachments/assets/3991c18f-9e01-41f0-8de2-963ff1d14a87">
vate
```
- macOS/Linux:
```bash
source .venv/bin/activate
```
3. **Install Dependencies**:
```bash
pip install -r requirements.txt
```
4. **Install `uv` (Important)**:
This project uses `uv` as a Python package runner and installer in some scenarios.
- The `start.bat` script will automatically attempt to install `uv` for you.
- If you want to install it manually or use it in other environments, you can run:
```bash
pip install uv
```
Or refer to the official documentation of `uv` for installation.
Make sure `uv` is successfully installed and can be called from the command line.
## Usage
1. **Configure MCP Server**:
Modify the `mcp.json` file to configure the MCP server according to your environment and needs. Make sure the startup commands and parameters of each server are correct. For example, you may need to update `TAVILY_API_KEY` or other server-specific paths/parameters.
2. **Prepare Knowledge Base (Optional)**:
If you want to use the knowledge base enhancement function, please put the relevant text files (such as `.txt`) into the `knowledge_base_docs` folder.
3. **Run the Main Program**:
```bash
python main.py
```
After the program starts, you can enter your questions or instructions according to the prompts.
## File Structure
```
agent/
├── .venv/ # Python virtual environment (ignored by .gitignore)
├── knowledge_base_docs/ # Directory for storing knowledge base documents
│ └── ...
├── .gitignore # Git ignore file configuration
├── main.py # Main program entry
├── mcp.json # MCP server configuration file
├── rag_embedding.py # RAG embedding related (if used)
├── rag_split.py # RAG text segmentation related (if used)
├── README.md # Project description file
├── requirements.txt # Python dependency list
├── LICENSE # Project license
└── ... (other scripts or configuration files)
```
## Configuration File (`.env`)
```json
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
```
The above corresponds to the api and key of the model used, and the following corresponds to the key and url of embedding (using Alibaba Cloud)
## Configuration File (`mcp.json`)
This file is used to define the MCP servers that the AI assistant can connect to and use. Each server entry should include:
- `name`: The unique name of the server.
- `params`: The parameters required to start the server, usually including `command` and `args`.
- `cache_tools_list`: Whether to cache the tool list.
**Example MCP Server Configuration**:
**stdio**
```json
{
"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
}
```
Make sure to replace the paths and API keys in the example with your own configuration.
**sse**
```json
{"name":"mcpname",
"url":"http://127.0.0.1:8009/sse"
},
```
## Knowledge Base Configuration
Add the corresponding files in knowledge_base_docs
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...