infra-mcp
Provides read-only access to PostgreSQL databases over SSH, allowing agents to query tables, describe schemas, list tables, and check database health metrics such as connection counts and locks.
infra-mcp
Read-only MCP access to on-prem Linux VMs and PostgreSQL databases over SSH.
agent ──stdio──▶ infra-mcp ──SSH──▶ VMs (journald · log files)
└──▶ DBs (read-only PostgreSQL)An agent can check service health, retrieve bounded logs, inspect DB state, and explore table schemas — without terminal access. Every remote operation is allowlist-gated and written to an append-only audit log.
Install
uv tool install infra-mcp
# or
pip install infra-mcpRelated MCP server: tusk-mcp
Configure
Copy infra-mcp.yaml.example to ~/.infra-mcp/infra-mcp.yaml and edit it.
# Generate a starter config from ~/.ssh/config
infra-mcp generate-config -o ~/.infra-mcp/infra-mcp.yaml
# Create the read-only PostgreSQL role(s)
infra-mcp setup
# Check VM reachability
infra-mcp test
# Refresh discovered services, log dirs, and databases (updates config in place)
infra-mcp discover --in-placeOverride the config path with --config or INFRA_MCP_CONFIG.
Run
infra-mcp runRegister as a stdio MCP server in your client (Claude Code, Cursor, …) with command infra-mcp run.
Tools
VM & services
Tool | Purpose |
| All VMs with reachability and watched services |
| Service states + DB health for one VM in a single call |
| systemd state, uptime, last 5 log lines |
| Bounded journald logs, filtered by severity |
| Last N lines of an allowed log file, optional grep |
Databases
Tool | Purpose |
| Connection counts, waiting locks, long-running query count |
| Bounded caller-supplied |
| Tables in a database (schema + name), capped at 200 |
| Columns, types, primary key, foreign keys for one table |
Meta
Tool | Purpose |
| Recent entries from the local audit log |
All output is bounded server-side (200 log lines, 100 DB rows, 200 tables/columns max). Truncation is always flagged with a -- TRUNCATED: marker. list_tables and describe_table cache results in memory (TTL: schema_cache_ttl_hours, default 24 h); pass refresh: true to force a live re-read.
Security model
SSH commands and systemd services are checked against a per-VM allowlist before any network call.
All DB queries run as a read-only role inside a
READ ONLYtransaction.Log file paths are resolved against a per-VM directory allowlist (
..traversal blocked).Every remote operation is appended to a local JSONL audit log.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/esp4ce/infra-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server