Infra MCP

Created By
esp4ce3 hours ago
Read-only MCP server for on-prem Linux VMs and PostgreSQL over SSH — service health, logs, DB state, and schema exploration without terminal access.
Overview

infra-mcp

PyPI Python License: MIT

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-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-place

Override the config path with --config or INFRA_MCP_CONFIG.

Run

infra-mcp run

Register as a stdio MCP server in your client (Claude Code, Cursor, …) with command infra-mcp run.

Tools

VM & services

ToolPurpose
list_vmsAll VMs with reachability and watched services
get_infra_overviewService states + DB health for one VM in a single call
get_service_statussystemd state, uptime, last 5 log lines
get_service_logsBounded journald logs, filtered by severity
get_log_fileLast N lines of an allowed log file, optional grep

Databases

ToolPurpose
get_db_statusConnection counts, waiting locks, long-running query count
query_dbBounded caller-supplied SELECT
list_tablesTables in a database (schema + name), capped at 200
describe_tableColumns, types, primary key, foreign keys for one table

Meta

ToolPurpose
get_audit_logRecent 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 ONLY transaction.
  • Log file paths are resolved against a per-VM directory allowlist (.. traversal blocked).
  • Every remote operation is appended to a local JSONL audit log.

Server Config

{
  "mcpServers": {
    "infra-mcp": {
      "command": "infra-mcp",
      "args": [
        "run"
      ]
    }
  }
}
Project Info
Created At
3 hours ago
Updated At
3 hours ago
Author Name
esp4ce
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Bruno Mcp
@Ostico

A Model Context Protocol (MCP) server for creating, managing, and executing Bruno API testing collections. Supports both .bru and .yml (opencollection) formats with built-in security hardening. Why This MCP Server? Use this when you want an AI agent (Claude, Copilot, etc.) to create, inspect, or execute Bruno API test collections programmatically — without opening the Bruno GUI or installing the Bruno CLI. Typical use cases: AI-assisted test generation, CI pipeline integration, automated API exploration. Requires Node.js >= 18.0.0. Features: - Collection Management: Create and organize Bruno collections - Environment Configuration: Manage multiple environments (dev, staging, prod) - Request Generation: Generate request files for all HTTP methods - Authentication Support: Bearer, Basic, OAuth 2.0, API key, Digest - Test Scripts: Add pre/post request scripts and assertions - CRUD Operations: Generate complete CRUD request sets - Collection Statistics: Analyze existing collections - Dual Format Support: .bru (legacy) and .yml (opencollection YAML) with auto-detection - Collection Discovery: Discover Bruno collections from workspace with zero config - Request Modification: Partial-merge updates to existing request files - Variable Chaining: bru.setVar()/bru.getVar() for cross-request variable flow - Dependency Ordering: Topological sort for test suite execution order - Request Execution: Execute requests and run tests with structured results - Security Hardening: SSRF protection, path traversal prevention, VM sandbox for test scripts

a day ago
Lsa Decrypt

7 hours ago