patchmon-mcp-server
MCP server that connects to PatchMon via its Integration API to query host inventory, patch status, and system details, and optionally delete hosts.
README
PatchMon MCP Server
An MCP (Model Context Protocol) server that connects to a PatchMon instance via its Integration API, so an LLM client (Claude Desktop, Claude Code, etc.) can query host inventory, patch status, and system details, and optionally delete hosts.
Built against PatchMon's documented Integration API: https://docs.patchmon.net/books/patchmon-application-documentation/page/integration-api-documentation
Uses the standalone fastmcp library
(v2.x) to implement the MCP server. This is a separate project from, but
protocol-compatible with, Anthropic's official mcp Python SDK — any MCP
client (Claude Desktop, Claude Code, MCP Inspector) works with it
identically.
Tools exposed
| Tool | Scope needed | Description |
|---|---|---|
list_hosts |
host:get |
List all hosts, optionally filtered by host group, optionally with inline stats |
get_host_stats |
host:get |
Package/repo statistics for one host |
get_host_info |
host:get |
OS, agent version, host groups for one host |
get_host_network |
host:get |
IP, gateway, DNS, interfaces |
get_host_system |
host:get |
CPU/RAM/disk/kernel/uptime/reboot status |
get_host_packages |
host:get |
Installed packages, optionally updates-only |
get_host_package_reports |
host:get |
Agent check-in report history |
get_host_agent_queue |
host:get |
Agent job queue + job history |
get_host_notes |
host:get |
Free-text notes on a host |
get_host_integrations |
host:get |
Integration status (e.g. Docker) |
delete_host |
host:delete |
Permanently delete a host (guarded by confirm=true) |
get_host_overview |
host:get |
Combined info + stats + system in one call |
find_hosts_needing_security_updates |
host:get |
Hosts with pending security updates |
1. Create a PatchMon API credential
- Log in to your PatchMon instance as an administrator.
- Go to Settings → Integrations → Auto-Enrollment & API.
- Click New Token, choose usage type API.
- Grant scope
host: get(adddeletetoo if you want thedelete_hosttool to work). - Copy the Token Key (
patchmon_ae_...) and Token Secret — the secret is shown only once.
2. Install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
3. Configure
The server reads its configuration from environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
PATCHMON_URL |
yes | — | Base URL of your PatchMon instance, e.g. https://patchmon.example.com |
PATCHMON_API_KEY |
yes | — | Token key (patchmon_ae_...) |
PATCHMON_API_SECRET |
yes | — | Token secret |
PATCHMON_API_VERSION |
no | v1 |
API version path segment |
PATCHMON_VERIFY_SSL |
no | true |
Set to false to skip TLS verification (dev/self-signed only) |
PATCHMON_TIMEOUT |
no | 30 |
Request timeout in seconds |
4. Run standalone (for testing)
export PATCHMON_URL="https://patchmon.example.com"
export PATCHMON_API_KEY="patchmon_ae_abc123"
export PATCHMON_API_SECRET="your_secret_here"
python server.py
The server speaks MCP over stdio, so it's normally launched by an MCP client rather than run interactively.
Note:
list_tools.py(a small helper for querying the server's tool list from the command line) uses the officialmcppackage's client classes (ClientSession,stdio_client). That's independent of which SDK the server is built on — any MCP client can talk to any MCP server. If you don't already havemcpinstalled for the client side, add it withpip install mcp.
5. Connect it to Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"patchmon": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/server.py"],
"env": {
"PATCHMON_URL": "https://patchmon.example.com",
"PATCHMON_API_KEY": "patchmon_ae_abc123",
"PATCHMON_API_SECRET": "your_secret_here"
}
}
}
}
Restart Claude Desktop and the patchmon tools will be available.
6. Connect it to Claude Code
claude mcp add patchmon \
--env PATCHMON_URL=https://patchmon.example.com \
--env PATCHMON_API_KEY=patchmon_ae_abc123 \
--env PATCHMON_API_SECRET=your_secret_here \
-- /absolute/path/to/.venv/bin/python /absolute/path/to/server.py
Notes on safety
delete_hostis destructive and irreversible. It requires an explicitconfirm=trueargument in addition to thehost:deletescope, as a guard against accidental invocation.- Credentials are read from environment variables only — never hard-code them into the server or commit them to version control.
- Consider restricting the PatchMon API credential to specific IPs and setting an expiration date (see PatchMon's Security Best Practices).
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。