mcp-ntopng

by marcoeg
Verified

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.

Integrations

  • Enables querying the ntopng Clickhouse database to access historical network flows and alerts for network monitoring data analysis.

mcp-server-ntopng

NTOPNG モデルコンテキストプロトコルサーバー

AI エージェントが NTOPNG データベースを使用してネットワーク監視データを照会できるようにする、 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 デスクトップ アプリおよびその他の MCP 準拠のホストおよびクライアントで動作します。

MCPリソースまたはプロンプトはまだサポートされていません。

構成

  1. 次の場所にある Claude Desktop 構成ファイルを作成または編集します。
    • macOSの場合: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows の場合: %APPDATA%/Claude/claude_desktop_config.json
  2. 以下を追加します。
{ "mcpServers": { "mcp-ntopng": { "command": "/path/to/your/uv-binary", "args": ["run", "--with", "mcp-ntopng", "--python", "3.13", "mcp-ntopng"] "env": { "NTOPNG_HOST": "<ntopng-host>", "NTOPNG_DBPORT": "<ntopng-dbport>", "NTOPNG_DBUSER": "<ntopng-dbuser>", "NTOPNG_DBPASSWORD": "<ntopng-dbpassword>", "NTOPNG_SECURE": "true", "NTOPNG_VERIFY": "true", "NTOPNG_CONNECT_TIMEOUT": "30", "NTOPNG_SEND_RECEIVE_TIMEOUT": "300", "NTOPNG_API_KEY": "NTOPNG_TOKEN" } } } }
  1. /path/to/your/uv-binaryuv実行ファイルへの絶対パスに置き換えます。 which uvパスを確認してください。これにより、サーバーの起動時に正しいバージョンのuvが使用されるようになります。
  2. 変更を適用するには、Claude Desktop を再起動します。

発達

  1. 環境変数は、 claude_desktop_config.jsonファイルまたはリポジトリのルートにある.envファイルのいずれかで設定します。
NTOPNG_HOST=localhost NTOPNG_PORT=9000 NTOPNG_USER=default NTOPNG_PASSWORD=
  1. uv syncを実行して依存関係をインストールします。uvをインストールするにはuvこちらの手順に従ってください。その後、 source .venv/bin/activate実行してください。
  2. プロジェクトのメイン ディレクトリからuv pip install -e .を使用してmcp-ntopngパッケージをインストールします。
  3. 簡単なテストとして、 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
    • 非標準ポートを使用しない限り、通常は設定する必要はありません
  • NTOPNG_SECURE : TLS接続を有効/無効にする
    • デフォルト: false
    • 安全なTLS接続の場合はtrueに設定
  • NTOPNG_VERIFY : SSL証明書の検証を有効/無効にする
    • デフォルト: true
    • 証明書の検証を無効にするには `false に設定します(本番環境では推奨されません)
  • NTOPNG_CONNECT_TIMEOUT : 接続タイムアウト(秒)
    • デフォルト: `30
    • 接続タイムアウトが発生する場合はこの値を増やしてください
  • NTOPNG_SEND_RECEIVE_TIMEOUT : 送受信タイムアウト(秒)
    • デフォルト: 300
    • 長時間実行されるクエリの場合はこの値を増やします

Clickhouse への TLS 接続の設定の詳細については、 ntopngドキュメントのTLS 設定を確認してください。

発達

ローカルマシンにパッケージをインストールします。

$ uv sync $ uv pip install -e .

MCPインスペクターを実行する

$ cd mcp_ntopng $ source .env $ CLIENT_PORT=8077 SERVER_PORT=8078 mcp dev run_mcp_ntopng.py --with clickhouse-driver --with python-dotenv --with uvicorn --with pip-system-certs

Claude Desktop のローカル ライブラリを使用します。

検索: /Users/marco/Library/Application\ Support/Claude/claude_desktop_config.json

claude_desktop_config.json を編集してローカル パスを変更します。

{ "mcpServers": { "mcp-ntopng": { "command": "/Users/marco/Development/claude/mcp-server-ntopng/.venv/bin/python", "args": [ "/Users/marco/Development/claude/mcp-server-ntopng/run_mcp_ntopng.py" ], "env": { "NTOPNG_HOST": "marcoeg-nod004.ntoplink.com", "NTOPNG_DBPORT": "9000", "NTOPNG_DBUSER": "default", "NTOPNG_DBPASSWORD": "", "NTOPNG_SECURE": "false", "NTOPNG_VERIFY": "false", "NTOPNG_CONNECT_TIMEOUT": "30", "NTOPNG_SEND_RECEIVE_TIMEOUT": "300", "SELECT_QUERY_TIMEOUT_SECS": "30", "NTOPNG_API_KEY": "NTOPNG_TOKEN" } } } }
-
security - not tested
A
license - permissive license
-
quality - not tested

ネットワーク監視ソフトウェア ntopng 用の MCP サーバー。

  1. Tools
    1. Status
      1. Configuration
        1. Development
          1. Environment Variables
          2. Development
        ID: bahb2ut908