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:
- list_tables_ntopng_database: List selected tables structure of the ntopng database.
- query_ntopng_database: Query the ntopng Clickhouse database.
No support for MCP resources or prompts yet.
Configuration
-
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",
}
}
}
}
-
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
- 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"
}
}
}
}
Metadata
Release files for mcp-ntopng 0.1.1
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 | |
|---|---|---|---|---|
| mcp_ntopng-0.1.1.tar.gz | 27.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_ntopng-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.6 kB
Release files / mcp_ntopng-0.1.1.tar.gz
| Download URL | mcp_ntopng-0.1.1.tar.gz |
|---|---|
| Size | 27.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c258fbf9d945760a226f41bc7947a6644294c370d480b178bc0cacbcd52ca62d
|
|
BLAKE2b-256 checksum How to use checksums |
df2c3472df70bc9aafb2d1020a4cb065a732f84aaec010da824ef2c09908e4a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / mcp_ntopng-0.1.1-py3-none-any.whl
| Download URL | mcp_ntopng-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39fa1ceb3ec92f53c56fae3f10c405fbb506fa36ccc5d2a724cd94ede6ae5fed
|
|
BLAKE2b-256 checksum How to use checksums |
00b8fe437de38d09287ddd308e1a25335860bd492d091b38600c63e5365870bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for mcp-ntopng 0.1.1
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.