Skip to main content

Add your description here

Project description

nagios-mcp

MCP Server for Nagios Core.

This server is built by us for the Nagios Core web-client. The code for the server can be found here. The server utilizes the CGI binaries located at the cgi-bin or sbin folder in your Nagios folder. More specifically the statusjson.cgi and objectjson.cgi files for the purpose of the status and configuration tooling.

How to install:

Setting up

  1. Installing uv
    • Linux or MacOS or WSL:
      curl -LsSf https://astral.sh/uv/install.sh | sh
      
    • Windows:
      powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
      

Or installing using pip:

pip install uv
  1. Cloning the repository
git clone https://github.com/PROSPIRE-TECHNOLOGY-SERVICES/nagios-mcp.git
  1. Creating a config file Create a nagios_config.yaml or nagios_config.json file with the configuration parameters given below.
nagios_url: "http://localhost/nagios"
nagios_user: "your_nagios_core_username"
nagios_pass: "your_nagios_core_password"

Starting the SSE server

  • The mcp server by default runs on STDIO transport. If you do not require SSE transport, you can skip this section.
  • Command: uv run -m nagios_mcp --config NAGIOS_CONFIG_FILE --transport sse --host localhost --port 8000

For Claude Desktop

  • Official setup guide
  • For setting up in Claude Desktop, go to Settings -> Developer -> Edit Config. Or directly modify the config file,
    • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Add the following block to the config file,
{
  "mcpServers": {
    "nagios": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE_PATH_TO/nagios-mcp",
        "run",
        "-m",
        "nagios_mcp",
        "--config",
        "PATH_TO_THE_NAGIOS_CONFIG_FILE",
      ],
    },
  },
}
  • For SSE transport:
{
    "mcpServers": {
        "nagios": {
            "url": "http://localhost:8000/sse" # change this if you are using different port
        }
    }
}

For Cursor

  • Official setup guide
  • To setup the server in Cursor, go to Setting -> MCP -> Add new global MCP server, and add the following: For STDIO transport:
{
  "mcpServers": {
    "nagios": {
        "command": "uv",
        "args": [
                "--directory",
                "/ABSOLUTE_PATH_TO/nagios-mcp", # Make sure this directory is correct
                "run",
                "-m",
                "nagios_mcp",
                "--config", "PATH_TO_THE_NAGIOS_CONFIG_FILE"
            ],
        }
    }
}
  • For SSE Transport:
{
    "mcpServers": {
        "nagios": {
            "url": "http://localhost:8000/sse" # change this if you are using different port
        }
    }
}

For Windsurf

{
    "mcpServers": {
        "nagios": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE_PATH_TO/nagios-mcp", # Make sure this directory is correct
                "run",
                "-m",
                "nagios_mcp",
                "--config", "PATH_TO_THE_NAGIOS_CONFIG_FILE"
            ],
        }
    }
}
  • For SSE Transport:
{
    "mcpServers": {
        "nagios": {
            "serverUrl": "http://localhost:8000/sse" # change this if you are using different port
        }
    }
}

For Cline

  • Official setup guide
  • For setting up the server in Cline, go to MCP Servers -> Installed -> Configure MCP Servers, this will open the cline_mcp_settings.json file. Add the following code block to the file.
{
    "mcpServers": {
        "nagios": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE_PATH_TO/nagios-mcp", # Make sure this directory is correct
                "run",
                "-m",
                "nagios_mcp",
                "--config", "PATH_TO_THE_NAGIOS_CONFIG_FILE"
            ],
        }
    }
}
  • For SSE Transport:
{
    "mcpServers": {
        "nagios": {
            "url": "http://localhost:8000/sse" # change this if you are using different port
        }
    }
}

For 5ire

5ire is another MCP client. For setting up in 5ire, go to Tools -> New and add the following configuration.

  1. Tool Key: Nagios
  2. Name: NagiosMCP
  3. Command: uv --directory /ABSOLUTE_PATH_TO/nagios-mcp run -m nagios_mcp --config PATH_TO_THE_NAGIOS_CONFIG_FILE

List of Tools:

Tool Name Tool Description
get_host_status Retrieves status for all hosts or a specific host.
get_service_status Retrieves status for services using statusjson.cgi.
get_alerts Retrieves current problematic host and service states (alerts).
get_program_status Retrieves the Nagios Core program status from statusjson.cgi
get_hosts_in_group_status Retrieves status for all hosts within a specific host group.
get_services_in_group_status Retrieves status for all services within a specific service group.
get_services_on_host_in_group_status Retrieves status for all the services with a specific host group.
get_overall_health_summary Retrieves overall health summary for all the hosts and services.
get_unhandled_problems Retrieves all the unhandled problems for all the hosts and services.
get_object_list_config Retrieves configuration list for object types like "hosts", "services", "hostgroups", etc.
get_single_object_config Retrieves configuration for a single specific object.
get_host_dependencies Retrieves host dependencies for the given host.
get_service_dependencies Retrieves service dependencies for the given host.
get_contacts_for_object Retrieves the list of contacts to inform for an object.
get_comments Retrieves comments based on the host and service.
get_comment_by_id Retrieves comments for the given comment id.
get_downtimes Retrieves the information for the downtimes in the Nagios Host Process.
get_nagios_process_info Returns the information for the Nagios process. (Alias for get_program_status function)
  • Currently all the tools use GET requests. Other useful tools and tools requiring POST requests will be added soon.

How the MCP server works?

  • Nagios Core web-client is typically hosted on http://YOUR_HOST/nagios/
  • The MCP server reads the details about the processes and services using the CGI binaries, they can be found in the cgi-bin or sbin sub-directory in your Nagios main directory.
  • The Status Tools and Config Tools use the cgi-bin/statusjson.cgi and cgi-bin/objectjson.cgi files respectively for retrieving the information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nagios_mcp-0.1.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nagios_mcp-0.1.2-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file nagios_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: nagios_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nagios_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 090964f00ff5ea850e15adeeabc7f94e925cd582c73d41c411a99464e4c2bff2
MD5 7c759898c08044ce7ca463f585ad866a
BLAKE2b-256 e76401c642f20651f7edc72afb9152a162211a05468e3a64aa5ec7574a4e5edb

See more details on using hashes here.

File details

Details for the file nagios_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nagios_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nagios_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d626c7e7bfa6eb158964d3c87f24eb0735e62f0db86dd21fb32f3219a39b1dcf
MD5 01bc3795bf829fccea3f4a067b5f8ad2
BLAKE2b-256 c511e66dab1d70eddd8b1e6057ab090b8a10379d378d11418ed04bdb2b829981

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page