# esp4ce/infra-mcp [Health: Active]

**Category:** 📊 Monitoring  
**Repository:** https://github.com/esp4ce/infra-mcp  
**GitHub Stars:** 1  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/esp4ce-infra-mcp

## Description
Read-only MCP server for on-prem Linux VMs and PostgreSQL over SSH. Check service health (systemd/journald), retrieve bounded logs, inspect DB state, and explore table schemas — without terminal access. Allowlist-gated, append-only audit log. pip install infra-mcp.

## Tools
Capabilities this server exposes over MCP:

- **list_vms** — All VMs with reachability and watched services
- **get_infra_overview** — Service states + DB health for one VM in a single call
- **get_service_status** — systemd state, uptime, last 5 log lines
- **get_service_logs** — Bounded journald logs, filtered by severity
- **get_log_file** — Last N lines of an allowed log file, optional grep
- **get_db_status** — Connection counts, waiting locks, long-running query count
- **query_db** — Bounded caller-supplied `SELECT
- **list_tables** — Tables in a database (schema + name), capped at 200
- **describe_table** — Columns, types, primary key, foreign keys for one table
- **get_audit_log** — Recent entries from the local audit log

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "infra-mcp": {
    "command": "uvx",
    "args": ["infra-mcp"]
  }
}
```

## Documentation

## What esp4ce/infra-mcp MCP server does

The esp4ce/infra-mcp MCP server connects an MCP client to on-prem Linux virtual machines and PostgreSQL databases through SSH. It is designed for inspection rather than administration: agents can check service state, review bounded log output, examine database health, run constrained read queries, and inspect table structure without receiving terminal access.

VM-oriented tools report reachability, watched services, systemd state, uptime, recent service output, journald entries, and selected log-file lines. Database tools report connection counts, waiting locks, long-running query counts, table names, column definitions, keys, and foreign keys. The server also exposes recent entries from its local audit log.

## How it works

An MCP client communicates with the process over stdio. The process then uses SSH to reach configured VMs and query the permitted services, log paths, and PostgreSQL databases. The `get_infra_overview` tool combines service states and database health for a selected VM, while the other tools provide narrower inspections.

The esp4ce/infra-mcp MCP server applies limits on returned data: logs are capped at 200 lines, database query results at 100 rows, and table or column listings at 200 entries. Responses identify truncation with a `-- TRUNCATED:` marker. Schema results from `list_tables` and `describe_table` are cached in memory for the configured cache lifetime, which defaults to 24 hours; callers can request a refresh.

Every remote operation is checked against a per-VM allowlist before a network call. Log paths are constrained to configured directories, with parent-directory traversal blocked. PostgreSQL queries run under a read-only role inside a `READ ONLY` transaction. Operations are appended to a local JSONL audit log.

## Setup and configuration

Install the package with either `pip install infra-mcp` or `uv tool install infra-mcp`. Configuration is read from `~/.infra-mcp/infra-mcp.yaml` by default. A starter file can be generated from the local SSH configuration:

```bash
infra-mcp generate-config -o ~/.infra-mcp/infra-mcp.yaml
```

The configuration path can be changed with `--config` or `INFRA_MCP_CONFIG`. The setup workflow includes commands for creating read-only PostgreSQL roles, testing VM reachability, and discovering services, log directories, and databases. Discovery can update the configuration in place:

```bash
infra-mcp setup
infra-mcp test
infra-mcp discover --in-place
```

Start the process with `infra-mcp run`, then register it as a stdio MCP server in a compatible client. Cursor is explicitly shown as a supported registration target in the project documentation. The package also provides `infra-mcp --version`. Update checks can be disabled with `INFRA_MCP_NO_UPDATE_CHECK=1`.

## Tools and capabilities

The esp4ce/infra-mcp MCP server exposes these read-only capabilities:

- List VM reachability and watched services.
- Combine service and database health for one VM.
- Read systemd status, uptime, and the last five log lines.
- Retrieve severity-filtered journald output.
- Read the last requested lines from an allowed log file with optional grep filtering.
- Inspect PostgreSQL connections, waiting locks, and long-running queries.
- Run bounded caller-provided `SELECT` statements.
- List database tables and describe columns, types, primary keys, and foreign keys.
- Retrieve recent local audit-log entries.

## Limitations and notes

The server is read-only for the documented infrastructure and database operations. It does not provide general terminal access, unrestricted file access, or database mutation tools. Results are deliberately bounded, and cached schema data may not reflect changes until the cache expires or a refresh is requested. Access also depends on the configured VM, service, log, database, and SSH allowlists.

_Full upstream README: https://allmcps.com/mcp/esp4ce-infra-mcp/readme_

