An MCP Server for ntopng integration
Project description
mcp-server-NTOPNG
NTOPNG Model Context Protocol Server
A Model Context Protocol server implementation for NTOPNG that enables AI agents to query networks monitoring data using the NTOPNG database.
This MCP Server assumes that ntopng is using ClickHouse to store historical flows and alert. Check ntopng Clickhouse
Status
Works with Claude desktop app. Implements the following MCP tools:
No support for MCP resources or prompts yet.
Configuration (NOT YET: only when the server is registered with PyPI)
-
Create or edit the Claude Desktop configuration file located at:
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - On Windows:
%APPDATA%/Claude/claude_desktop_config.json
- On macOS:
-
Add the following:
{
"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": "your-ntopng-token"
}
}
}
}
-
Replace
/path/to/your/uv-binarywith the absolute path to theuvexecutable. Find the path withwhich uv. This ensures that the correct version ofuvis used when starting the server. -
Restart Claude Desktop to apply the changes.
Development (ONLY OPTION until the module is registered with PyPI)
- Set the environmental variables either in the
claude_desktop_config.jsonfile or in a.envfile in the root of the repository.
NTOPNG_HOST=localhost
NTOPNG_PORT=9000
NTOPNG_USER=default
NTOPNG_PASSWORD=
-
Run
uv syncto install the dependencies. To installuvfollow the instructions here. Then dosource .venv/bin/activate. -
Install the
mcp-ntopngpackage withuv pip install -e .from the project main directory. -
For easy testing, you can run
mcp dev mcp_ntopng/mcp_server.pyto start the MCP server. CHANGE WITH A PROPER CHAT CLIENT
Environment Variables
The following environment variables are used to configure the database connection:
NTOPNG_HOST: The hostname of thentopngserverNTOPNG_DBUSER: The username for Clickhouse DB authenticationNTOPNG_DBPASSWORD: The password for Clickhouse DB authentication
Optional
NTOPNG_DBPORT: The port number of the Clickhouse DB in thentopngserver- Default:
9000if HTTPS is enabled,8123if disabled - Usually doesn't need to be set unless using a non-standard port
- Default:
NTOPNG_SECURE: Enable/disable a TLS connection- Default:
false - Set to
truefor a secure TLS connections
- Default:
NTOPNG_VERIFY: Enable/disable SSL certificate verification- Default:
true - Set to `false to disable certificate verification (not recommended for production)
- Default:
NTOPNG_CONNECT_TIMEOUT: Connection timeout in seconds- Default: `30
- Increase this value if you experience connection timeouts
NTOPNG_SEND_RECEIVE_TIMEOUT: Send/receive timeout in seconds- Default:
300 - Increase this value for long-running queries
- Default:
Check TLS Setup in the
ntopngdocumentation for details about setting up a TLS connection to Clickhouse.
Development
Install the package on the local machine:
$ uv sync
$ uv pip install -e .
Run the MCP Inspector
$ 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
Use the local library in Claude Desktop.
Find: /Users/marco/Library/Application\ Support/Claude/claude_desktop_config.json
Edit the claude_desktop_config.json changing the local paths:
{
"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": "API_KEY"
}
}
}
}
Making a package step 1: local install
uv sync
uv build
uv pip install dist/mcp_ntopng-0.1.0-py3-none-any.whl
claude_desktop_config.json
{
"mcpServers": {
"mcp-ntopng": {
"command": "/Users/marco/Development/claude/mcp-server-ntopng/.venv/bin/mcp-ntopng",
"args": [],
"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": "API_KEY"
}
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_ntopng-0.1.0.tar.gz.
File metadata
- Download URL: mcp_ntopng-0.1.0.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71604e83b82763a622afb5ed4fd942b552e758111c18a6bf038a2783df33da3b
|
|
| MD5 |
b1d61d473804c5a4580dd57aa968741d
|
|
| BLAKE2b-256 |
d581b71ada1e597ceb09871fba2dec738c941f847e63114a2989dbf58882460a
|
File details
Details for the file mcp_ntopng-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_ntopng-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dbe4614f10143526dbf833ea2ed7bbb28dfc0d5b9f169e92b51520f787d986d
|
|
| MD5 |
87efb97f16b8e538a442cfa9769033fa
|
|
| BLAKE2b-256 |
3f8a684820cbee2eec3c6f9a478756e3503dc455b3fe5c93aca898c456db476e
|