README
FOFA MCP Server
基于 MCP (Model Control Protocol)的 FOFA API 查询服务器,提供简单易用的 FOFA 数据查询接口。
功能特点
- 支持 FOFA API 的基础查询功能
- 提供完整的字段信息查询选项
- 支持查询账户信息
- 基于异步 HTTP 客户端,性能优异
- 使用 MCP 协议,便于与其他系统集成
环境要求
- Python >= 3.11
- FOFA API 密钥
- cline
安装
- 克隆项目到本地:
git clone https://github.com/intbjw/fofa-mcp-server.git
cd fofa-mcp-server
- 安装依赖:
pip install -r requirements.txt
或者使用 Poetry:
poetry install
配置
- 下载插件
使用 cline 进行配置,在 vscode 中下载插件
- 进行模型配置
我这里选择的阿里云的qwen-coder,也可以使用本地大模型。
- 配置fofa-mcp-server
编写配置文件
{
"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 配置成功
使用演示
API 说明
1. FOFA 查询
fofa_search_tool(query: str, fields: str = "", size: int = 50) -> dict
参数说明:
query: FOFA 查询语句fields: 查询字段,可选值:- ""(默认):返回基础字段信息
- "all":返回所有可用字段信息
size: 返回结果数量,默认 50 条
返回数据格式:
{
"summary": str, # 查询统计信息
"data": List[Dict] # 查询结果列表
}
2. 查询账户信息
fofa_userinfo_tool() -> dict
返回 FOFA 账户的详细信息。
字段说明
基础字段(默认)
- IP
- 端口
- 协议
- 主机名
- 域名
- ICP 备案号
- 网站标题
- 产品名
- 版本号
- 最后更新时间
完整字段(fields="all")
包含基础字段,以及:
- 国家代码
- 国家名
- 地区
- 城市
- 经度
- 纬度
- ASN 编号
- ASN 组织
- 操作系统
- 服务器
- JARM 指纹
- Header
- Banner
- 基础协议
- URL 链接
- 证书相关信息
- JA3S 指纹
- TLS 版本
- 产品分类
- 域名 CNAME
注意事项
- 请确保 FOFA API 密钥有效且具有足够的查询权限
- 注意遵守 FOFA 的 API 使用限制和规范
- 建议合理设置查询结果数量,避免消耗过多积分
TODO
- 查询账号信息
- 执行用户输入语句
- 支持大模型生成查询语句
- 模糊语句查询
许可证
贡献
欢迎提交 Issue 和 Pull Request!
Metadata
Release files for iflow-mcp-intbjw-fofa-mcp-server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iflow_mcp_intbjw_fofa_mcp_server-0.1.0.tar.gz | 4.9 kB | Without provenance | Details for iflow_mcp_intbjw_fofa_mcp_server-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iflow_mcp_intbjw_fofa_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for iflow_mcp_intbjw_fofa_mcp_server-0.1.0-py3-none-any.whl |
Total release size: 10.5 kB
Release files / iflow_mcp_intbjw_fofa_mcp_server-0.1.0.tar.gz
| Download URL | iflow_mcp_intbjw_fofa_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
551fcbb525369929dd2e0e5d3002c81d26d9b7501a67e6bfff6a06e21613407e
|
|
BLAKE2b-256 checksum How to use checksums |
31911ce85532edccf1b6e0c5bf9c7e8054de0f9c8ca29efbc7e4f44b453c4fff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / iflow_mcp_intbjw_fofa_mcp_server-0.1.0-py3-none-any.whl
| Download URL | iflow_mcp_intbjw_fofa_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa7bfa33bd2180dbcba4141e41f2755176a4f23a65666dde70c5b0a1284eaafc
|
|
BLAKE2b-256 checksum How to use checksums |
9065898bad483f05c6f09185abb6ee3b0694d17a7baa8c75d497e258b29faa6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for iflow-mcp-intbjw-fofa-mcp-server 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.