nagios-mcp
MCP server for Nagios Core that enables querying host and service status, alerts, configuration, and other monitoring data through CGI binaries.
README
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
- Installing the PyPI package
# Using pip
pip install nagios-mcp # or pipx install nagios-mcp
# Using uv (Recommended)
uv tool install nagios-mcp
- Creating a config file
Create a
nagios_config.yamlornagios_config.jsonfile with the configuration parameters given below.
nagios_url: "http://localhost/nagios"
nagios_user: "your_nagios_core_username"
nagios_pass: "your_nagios_core_password"
ca_cert_path: "path_to_your_ssl_cert" # if the url is https, otherwise leave it empty ("")
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
- MacOS:
- 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
- Official setup guide
- For setting up the server in Windsurf, add the following lines to the
~/.codeium/windsurf/mcp_config.jsonfile.
{
"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 thecline_mcp_settings.jsonfile. 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.
- Tool Key:
Nagios - Name:
NagiosMCP - Command:
uvx 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-binorsbinsub-directory in your Nagios main directory. - The Status Tools and Config Tools use the
cgi-bin/statusjson.cgiandcgi-bin/objectjson.cgifiles respectively for retrieving the information.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。