fofa
基于 MCP (Model Control Protocol)的 FOFA API 查询服务器,提供简单易用的 FOFA 数据查询接口。
claude mcp add --transport stdio intbjw-fofa-mcp-server python3 /path/to/fofa-mcp-server/main.py \ --env FOFA_KEY="API KEY"
How to use
This FOFA MCP Server exposes a simple interface to query FOFA data via MCP, including basic FOFA searches, optional field expansion, and account information. It uses an asynchronous HTTP client to fetch results from FOFA and returns a structured response containing a summary and a list of result items. The main tools you’ll interact with are: fofa_search_tool(query, fields, size) which runs a FOFA query and returns a dictionary with summary and data, and fofa_userinfo_tool() which retrieves details about the configured FOFA account. To use the server, configure the FOFA API key in the environment (FOFA_KEY) and start the MCP server. Then send queries through the MCP framework and receive the structured results, including either the default basic fields or all available fields when fields is set to "all". The server is designed to be integrated with other MCP-enabled systems, enabling chained or automated workflows that leverage FOFA data.
How to install
Prerequisites:
- Python 3.11 or newer
- Access to FOFA API with a valid key
- network access to FOFA API endpoints
Install steps:
-
Clone the repository: git clone https://github.com/intbjw/fofa-mcp-server.git cd fofa-mcp-server
-
Install dependencies: pip install -r requirements.txt
or, if you prefer Poetry:
poetry install
-
Prepare configuration: Create a configuration file (as shown in the README) and place it where your MCP loader expects it. For example, /path/to/fofa-mcp-server/main.py should be accessible and executable by the server.
-
Run the server via MCP configuration (as described in the mcp_config section) and verify that the MCP server reports it is connected.
Additional notes
Notes and tips:
- Ensure FOFA_KEY is valid and has permissions for the required queries.
- Respect FOFA API usage limits and quotas to avoid throttling or blocking.
- When using fields="all", be aware that the response payload may be larger; adjust size accordingly.
- If you deploy behind proxies or in restricted networks, ensure outbound access to FOFA APIs is permitted.
- If you encounter authentication or rate-limit errors, double-check the API key and consult FOFA API documentation for quota details.
- The server is designed to be easily injectable into larger MCP-based workflows, enabling automated queries and data pipelines.
Related MCP Servers
ReActMCP
ReActMCP is a reactive MCP client that empowers AI assistants to instantly respond with real-time, Markdown-formatted web search insights powered by the Exa API.
mcp-python-interpreter
MCP Python Interpreter: run python code. Python-mcp-server, mcp-python-server, Code Executor
mcp-lite-dev
共学《MCP极简开发》项目代码
MCPSecBench
MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols
enhanced -memory
An enhanced MCP (Model Context Protocol) server for intelligent memory and task management, designed for AI assistants and development workflows. Features semantic search, automatic task extraction, knowledge graphs, and comprehensive project management.
mlb
MCP server for advanced baseball analytics (statcast, fangraphs, baseball reference, mlb stats API) with client demo