Sponsored by Deepsite.site

Nagios MCP

Created By
PROSPIRE-TECHNOLOGY-SERVICES6 months ago
MCP Server for Nagios Core.
Content

nagios-mcp

PyPI - Version Python Version from PEP 621 TOML

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. Installing the PyPI package
# Using pip
pip install nagios-mcp # or pipx install nagios-mcp

# Using uv (Recommended)
uv tool install nagios-mcp
  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: uvx 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": "uvx",
      "args": [
        "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": "uvx",
        "args": [
                "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": "uvx",
            "args": [
                "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": "uvx",
            "args": [
                "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: uvx nagios-mcp --config PATH_TO_THE_NAGIOS_CONFIG_FILE

List of Tools:

Tool NameTool Description
get_host_statusRetrieves status for all hosts or a specific host.
get_service_statusRetrieves status for services using statusjson.cgi.
get_alertsRetrieves current problematic host and service states (alerts).
get_program_statusRetrieves the Nagios Core program status from statusjson.cgi
get_hosts_in_group_statusRetrieves status for all hosts within a specific host group.
get_services_in_group_statusRetrieves status for all services within a specific service group.
get_services_on_host_in_group_statusRetrieves status for all the services with a specific host group.
get_overall_health_summaryRetrieves overall health summary for all the hosts and services.
get_unhandled_problemsRetrieves all the unhandled problems for all the hosts and services.
get_object_list_configRetrieves configuration list for object types like "hosts", "services", "hostgroups", etc.
get_single_object_configRetrieves configuration for a single specific object.
get_host_dependenciesRetrieves host dependencies for the given host.
get_service_dependenciesRetrieves service dependencies for the given host.
get_contacts_for_objectRetrieves the list of contacts to inform for an object.
get_commentsRetrieves comments based on the host and service.
get_comment_by_idRetrieves comments for the given comment id.
get_downtimesRetrieves the information for the downtimes in the Nagios Host Process.
get_nagios_process_infoReturns 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.

Server Config

{
  "mcpServers": {
    "nagios-mcp-stdio": {
      "command": "uvx",
      "args": [
        "nagios-mcp",
        "--config",
        "ABSOLUTE_PATH_TO/nagios_config.yaml"
      ]
    },
    "nagios-mcp-sse": {
      "url": "http://localhost:8000/sse"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors