mcp-服务器-ntopng
NTOPNG 模型上下文协议服务器
NTOPNG的模型上下文协议服务器实现,使 AI 代理能够使用 NTOPNG 数据库查询网络监控数据。
此 MCP 服务器假设ntopng
使用 ClickHouse 来存储历史流量和警报。请查看ntopng 的 ClickHouse
工具
fetch_ntopng_all_ifids
- 从 ntopng 中检索所有可用的接口 ID。
get_ntopng_hosts_location
- 获取主机的地理位置和附加信息。
fetch_ntopng_top_local_talkers
- 检索指定接口的前 10 个本地对话者。
fetch_ntopng_top_remote_talkers
- 检索指定接口的前 10 个远程对话者。
get_ntopng_all_alert_stats
- 检索所有警报的统计信息。
get_ntopng_flow_alert_stats
- 检索流量警报的统计数据。
get_ntopng_host_alert_stats
- 检索主机警报的统计数据。
get_ntopng_interface_alert_stats
- 检索接口警报的统计数据。
get_ntopng_mac_alert_stats
- 检索 MAC 警报的统计数据。
get_ntopng_network_alert_stats
- 检索网络警报的统计数据。
get_ntopng_snmp_device_alert_list
- 检索 SNMP 设备警报列表。
get_ntopng_snmp_device_alert_stats
- 检索 SNMP 设备警报的统计信息。
get_ntopng_system_alert_stats
- 检索系统警报的统计数据。
query_ntopng_flows_data
- 从 ntopng 流量数据库中检索详细的流量数据。
get_ntopng_top-k_flows
- 从 ntopng 流数据库中检索前 k 个流数据。
get_ntopng_user_alert_stats
- 检索用户警报的统计数据。
get_ntopng_flow_devices_stats
- 检索所有流设备的统计数据。
get_ntopng_sflow_devices_stats
- 检索所有 sFlow 设备的统计信息。
list_tables_ntopng_database
- 列出 ntopng 数据库的表结构。
query_ntopng_database
- 查询 ntopng Clickhouse 数据库。
地位
可与 Claude Desktop 应用程序和其他符合 MCP 的主机和客户端配合使用。
配置
- 创建或编辑位于以下位置的 Claude Desktop 配置文件:
- 在 macOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json
- 在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json
- 在 macOS 上:
- 添加以下内容:
- 将
/path/to/your/uv-binary
替换为uv
可执行文件的绝对路径。使用which uv
查找路径。这可确保启动服务器时使用正确版本的uv
。 - 重新启动 Claude Desktop 以应用更改。
发展
- 在
claude_desktop_config.json
文件或存储库根目录中的.env
文件中设置环境变量。
- 运行
uv sync
来安装依赖项。要安装uv
,请按照此处的说明操作。然后执行source .venv/bin/activate
。 - 使用
uv pip install -e .
从项目主目录安装mcp-ntopng
包。 - 为了方便测试,您可以运行
mcp dev mcp_ntopng/mcp_server.py
来启动 MCP 服务器。请使用合适的聊天客户端进行更改
环境变量
以下环境变量用于配置数据库连接:
NTOPNG_HOST
:ntopng
服务器的主机名NTOPNG_DBUSER
:Clickhouse DB 身份验证的用户名NTOPNG_DBPASSWORD
:Clickhouse DB 身份验证的密码NTOPNG_API_KEY
:ntopng
身份验证令牌。
选修的
NTOPNG_DBPORT
:ntopng
服务器中 Clickhouse DB 的端口号- 默认值:如果启用 HTTPS,
9000
;如果禁用,8123
- 通常不需要设置,除非使用非标准端口
- 默认值:如果启用 HTTPS,
NTOPNG_SECURE
:启用/禁用 TLS 连接- 默认值:
false
- 设置为
true
以实现安全的 TLS 连接
- 默认值:
NTOPNG_VERIFY
:启用/禁用 SSL 证书验证- 默认值:
true
- 设置为 `false 以禁用证书验证(不建议用于生产)
- 默认值:
NTOPNG_CONNECT_TIMEOUT
:连接超时(秒)- 默认值:`30
- 如果遇到连接超时,请增加此值
NTOPNG_SEND_RECEIVE_TIMEOUT
:发送/接收超时(秒)- 默认值:
300
- 对于长时间运行的查询,请增加此值
- 默认值:
有关设置与 Clickhouse 的 TLS 连接的详细信息,请查看
ntopng
文档中的TLS 设置。
发展
在本地机器上安装包:
运行 MCP 检查器
使用 Claude Desktop 中的本地库。
查找:/Users/marco/Library/Application\Support/Claude/claude_desktop_config.json
编辑 claude_desktop_config.json 更改本地路径:
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
网络监控软件 ntopng 的 MCP 服务器。
Related Resources
Related MCP Servers
- -securityAlicense-qualityAn MCP server that allows checking local time on the client machine or current UTC time from an NTP serverLast updated -14PythonMIT License
- -securityAlicense-qualityA lightweight mcp server that tells you exactly what time is it based on your IP.Last updated -8PythonMIT License
- -securityAlicense-qualityAn MCP server implementation that enables dynamic configuration of OpenTelemetry Collectors, allowing users to add, remove, and configure receivers, processors, and exporters through MCP tools.Last updated -2TypeScriptGPL 3.0
- AsecurityAlicenseAqualityA streamlined MCP server that enables AI assistants to send real-time notifications to your devices through the ntfy service, allowing you to receive alerts when tasks complete or important events occur.Last updated -15524JavaScriptGPL 3.0