FOFA

v1.0.0Search & Data Extractionstable

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

clinecludefofamcp-clientmcp-server
Share:
8
Stars
0
Downloads
0
Weekly
0/5

What is FOFA?

FOFA is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 基于 mcp (model control protocol)的 fofa api 查询服务器,提供简单易用的 fofa 数据查询接口。

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

This server falls under the Search & Data Extraction category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • 基于 MCP (Model Control Protocol)的 FOFA API 查询服务器,提供简单易用的 FOFA

Use Cases

Query FOFA API for asset and vulnerability discovery.
Perform reconnaissance and security research.
intbjw

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 2, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx fofa

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use FOFA

The FOFA MCP Server exposes the FOFA cybersecurity search engine API through the Model Context Protocol, allowing AI assistants to query internet-exposed assets, discover services, and perform reconnaissance directly from a conversation. It supports querying by IP, domain, protocol, and dozens of other FOFA search syntax fields.

Prerequisites

  • Python 3.11 or later
  • A valid FOFA account with an API key (obtainable from fofa.info)
  • pip or Poetry for installing Python dependencies
  • An MCP-compatible client such as Claude Desktop or Cursor with Cline extension
1

Clone the repository

Download the FOFA MCP server source code from GitHub.

git clone https://github.com/intbjw/fofa-mcp-server.git
cd fofa-mcp-server
2

Install dependencies

Install required Python packages using pip or Poetry.

# Using pip
pip install -r requirements.txt

# Using Poetry
poetry install
3

Obtain your FOFA API key

Log in to your account at fofa.info, navigate to your profile settings, and copy your API key. This key is required to authenticate all search requests.

4

Configure the MCP client

Add the FOFA server to your MCP client configuration, passing your API key as the FOFA_KEY environment variable.

5

Verify the connection

Ask your AI assistant to call the fofa_userinfo_tool to confirm authentication is working before running searches.

FOFA Examples

Client configuration

Add this block to your claude_desktop_config.json or Cline MCP settings, replacing YOUR_API_KEY with your actual FOFA key.

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

Prompts to try

Example prompts to use with Claude once the FOFA server is connected.

- "Search FOFA for Apache servers exposed on port 8080 in Germany"
- "Find all IPs running Elasticsearch without authentication using FOFA"
- "Query FOFA for domain:example.com and return all fields including certificates"
- "Show my FOFA account information and remaining API quota"

Troubleshooting FOFA

Authentication error: invalid API key

Double-check the FOFA_KEY value in your MCP config. Keys are case-sensitive and should not include extra whitespace. You can verify your key works by calling the fofa_userinfo_tool first.

Search returns no results or quota exceeded error

FOFA API access is quota-limited based on your subscription tier. Monitor your usage on the FOFA dashboard. Reduce the size parameter (default 50) in searches to conserve quota.

Python version incompatibility

The server requires Python 3.11 or later. Run 'python3 --version' to check. If you are on an older version, install Python 3.11+ via pyenv or your system package manager before re-installing dependencies.

Frequently Asked Questions about FOFA

What is FOFA?

FOFA is a Model Context Protocol (MCP) server that 基于 mcp (model control protocol)的 fofa api 查询服务器,提供简单易用的 fofa 数据查询接口。 It connects AI assistants to external tools and data sources through a standardized interface.

How do I install FOFA?

Follow the installation instructions on the FOFA GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with FOFA?

FOFA works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is FOFA free to use?

Yes, FOFA is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Search & Data Extraction MCP Servers

Explore all search & data extraction servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "fofa": { "command": "npx", "args": ["-y", "fofa"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use FOFA?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides