FOFA MCP Server logo

FOFA MCP Server

Community
intbjw

基于 MCP (Model Control Protocol)的 FOFA API 查询服务器,提供简单易用的 FOFA 数据查询接口。

Publisherintbjw
Repositoryfofa-mcp-server
LanguagePython
Forks
5
Stars
8
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    FOFA MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    8 stars and 5 forks from the linked repository.

MseeP.ai Security Assessment Badge

README

FOFA MCP Server

基于 MCP (Model Control Protocol)的 FOFA API 查询服务器,提供简单易用的 FOFA 数据查询接口。

功能特点

  • 支持 FOFA API 的基础查询功能
  • 提供完整的字段信息查询选项
  • 支持查询账户信息
  • 基于异步 HTTP 客户端,性能优异
  • 使用 MCP 协议,便于与其他系统集成

环境要求

  • Python >= 3.11
  • FOFA API 密钥
  • cline

安装

  1. 克隆项目到本地:
bash
git clone https://github.com/intbjw/fofa-mcp-server.git
cd fofa-mcp-server
  1. 安装依赖:
bash
pip install -r requirements.txt

或者使用 Poetry:

bash
poetry install

配置

  1. 下载插件

使用 cline 进行配置,在 vscode 中下载插件

  1. 进行模型配置

我这里选择的阿里云的qwen-coder,也可以使用本地大模型。

  1. 配置fofa-mcp-server

编写配置文件

json
{
  "mcpServers": {
    "fofa-mcp-server": {
      "command": "python3",
      "args": [
        "/path/to/fofa-mcp-server/main.py"
      ],
      "env": {
        "FOFA_KEY": "API KEY"
      }
    }
  }
}

提示fofa-mcp-server MCP server connected 配置成功

使用演示

2025-03-14 17-49-49.mp4

API 说明

1. FOFA 查询

python
fofa_search_tool(query: str, fields: str = "", size: int = 50) -> dict

参数说明:

  • query: FOFA 查询语句
  • fields: 查询字段,可选值:
    • ""(默认):返回基础字段信息
    • "all":返回所有可用字段信息
  • size: 返回结果数量,默认 50 条

返回数据格式:

python
{
    "summary": str,  # 查询统计信息
    "data": List[Dict]  # 查询结果列表
}

2. 查询账户信息

python
fofa_userinfo_tool() -> dict

返回 FOFA 账户的详细信息。

字段说明

基础字段(默认)

  • IP
  • 端口
  • 协议
  • 主机名
  • 域名
  • ICP 备案号
  • 网站标题
  • 产品名
  • 版本号
  • 最后更新时间

完整字段(fields="all")

包含基础字段,以及:

  • 国家代码
  • 国家名
  • 地区
  • 城市
  • 经度
  • 纬度
  • ASN 编号
  • ASN 组织
  • 操作系统
  • 服务器
  • JARM 指纹
  • Header
  • Banner
  • 基础协议
  • URL 链接
  • 证书相关信息
  • JA3S 指纹
  • TLS 版本
  • 产品分类
  • 域名 CNAME

注意事项

  1. 请确保 FOFA API 密钥有效且具有足够的查询权限
  2. 注意遵守 FOFA 的 API 使用限制和规范
  3. 建议合理设置查询结果数量,避免消耗过多积分

TODO

  • 查询账号信息
  • 执行用户输入语句
  • 支持大模型生成查询语句
  • 模糊语句查询

许可证

贡献

欢迎提交 Issue 和 Pull Request!

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "intbjw-fofa-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Use FOFA MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once FOFA MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add FOFA MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the FOFA MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "intbjw-fofa-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "fofa-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the FOFA MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the FOFA MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use FOFA MCP Server to help me with this task?
FOFA MCP Server
Sure. I read it.
Here is what I found using FOFA MCP Server.

Frequently asked questions

What is the FOFA MCP Server MCP server used for?

FOFA MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use FOFA MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use FOFA MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use FOFA MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With FOFA MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect FOFA MCP Server MCP to TypingMind?

FOFA MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does FOFA MCP Server MCP provide in TypingMind?

FOFA MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use FOFA MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If FOFA MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇