patchmon-mcp-server
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 all hosts, optionally filtered by host group, optionally with inline stats |
|
| Package/repo statistics for one host |
|
| OS, agent version, host groups for one host |
|
| IP, gateway, DNS, interfaces |
|
| CPU/RAM/disk/kernel/uptime/reboot status |
|
| Installed packages, optionally updates-only |
|
| Agent check-in report history |
|
| Agent job queue + job history |
|
| Free-text notes on a host |
|
| Integration status (e.g. Docker) |
|
| Permanently delete a host (guarded by |
|
| Combined info + stats + system in one call |
|
| 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.txt3. Configure
The server reads its configuration from environment variables:
Variable | Required | Default | Description |
| yes | — | Base URL of your PatchMon instance, e.g. |
| yes | — | Token key ( |
| yes | — | Token secret |
| no |
| API version path segment |
| no |
| Set to |
| no |
| 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.pyThe 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.pyNotes 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).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/weirdchaos/patchmon-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server