MCP服务器集合

一个包含多个基于FastMCP构建的模型上下文协议(MCP)服务器的仓库,支持FTP操作和AI驱动的网络搜索功能。

  • by JakeClark-chan
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 JakeClark-chan/my-mcp-server

使用说明

MCP服务器集合

此存储库包含多个使用FastMCP构建的模型上下文协议(MCP)服务器。

快速设置

  1. 环境已准备就绪:

    cd ~/mcp-server
    # Virtual environment is already set up at .venv/
    
  2. 配置环境变量:

    cp .env.example .env
    # Edit .env and add your API keys (especially TAVILY_API_KEY)
    
  3. 与MCP客户端一起使用:

    • 复制 mcp.json 到您的MCP客户端配置目录
    • 或者直接使用服务器: mcp dev ftp/ftp_server.py 或者 mcp dev tavily-internet/tavily_server.py

许可证

这个项目是MCP生态系统的一部分,并遵循相同的许可条款。

奖金

螳螂(或指某应用/系统内的)小补丁

在 Mantis/Decoys/FTP/fake_ftp_tarpit.py:

def handle_cwd(self, client_socket, current_path, data, client_data_connection_info, injection_manager):
    """Handle the CWD command to change directories."""
    # Old
    client_ip, client_port = client_data_connection_info
    #
    new_dir = data.split(' ')[1] if len(data.split(' ')) > 1 else '/'
    if new_dir == '/':
        new_path = '/'
    else:
        new_path = current_path.rstrip('/') + '/' + new_dir

    msg = b"250 Directory successfully changed\r\n"
    msg, _ = injection_manager((client_ip, client_port), self.source_name, self.name+'.continue', msg)
    msg += b'\r\n'
    client_socket.sendall(msg)
    
    return new_path

替换为

def handle_cwd(self, client_socket, current_path, data, client_data_connection_info, injection_manager):
    """Handle the CWD command to change directories."""
    # New
    # Check if client_data_connection_info is available
    if client_data_connection_info is not None:
        client_ip, client_port = client_data_connection_info
    else:
        client_ip, client_port = None, None
    #
    new_dir = data.split(' ')[1] if len(data.split(' ')) > 1 else '/'
    if new_dir == '/':
        new_path = '/'
    else:
        new_path = current_path.rstrip('/') + '/' + new_dir

    msg = b"250 Directory successfully changed\r\n"
    msg, _ = injection_manager((client_ip, client_port), self.source_name, self.name+'.continue', msg)
    msg += b'\r\n'
    client_socket.sendall(msg)
    
    return new_path

使用PentestAgent进行设置(VI)

首先,将这个文件夹克隆到你的电脑上,通过输入来记录当前文件夹。 pwd

设置环境:

uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

在已充分加载所有包后,如

sudo apt update && sudo apt install -y ffuf httpx hydra masscan metasploit-framework nmap nuclei sqlmap 
sudo apt install -y postgresql postgresql-contrib golang-go

加载这些环境变量(可选)

# Set up local Go environment (using project-local .go directory)
export GOPATH="$PWD/.go"
export GOBIN="$PWD/.go/bin"
export PATH="$PWD/.go/bin:$PATH"

安装以下附加包:

CGO_ENABLED=1 go install github.com/projectdiscovery/katana/cmd/katana@latest
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest

要在克隆的文件夹中打开Metasploit服务器,请输入以下命令:

scripts/start-services

检查服务并关闭服务,操作类似,位于scripts文件夹中。

进入 python main.py:

  • 不选择知识库
  • 更新以下工具:7,9,11,12,13,16(分别对应工具:httpx, katana, metasploit, nmap, nuclei, sqlmap)
  • 当看到PATH时点击yes。Metasploit服务器的密码是1,其余字段保持默认。

在程序生成mcp.json后,进入该文件并添加以下内容:(其中/root/mcp-server是克隆的文件夹地址,请根据实际情况修改)

{
  "servers": [
    {
      "name": "tavily-internet",
      "params": {
        "command": "/root/mcp-server/.venv/bin/python", 
        "args": ["/root/mcp-server/tavily-internet/tavily_server.py"],
        "description": "Tavily Internet Search MCP - AI-powered web search with content extraction and Q&A capabilities",
        "env": {
          "PYTHONPATH": "/root/mcp-server",
          "TAVILY_API_KEY": "<tavily-api-key>",
          "_comment": "Ensure to set the TAVILY_API_KEY environment variable with your actual API key"
        }
      },
      "cache_tools_list": true
    },
    {
      "name": "ftp",
      "params": {
        "command": "/root/mcp-server/.venv/bin/python",
        "args": ["/root/mcp-server/ftp/ftp_server.py"],
        "description": "FTP Server MCP - Complete FTP operations including connection, file transfer, and directory management",
        "env": {
            "PYTHONPATH": "/root/mcp-server"
        }
      },
      "cache_tools_list": true
    },
    ...
  ]
}

下次跑步的时候,只需打开 python main.py选择连接到工具,完成