infra-mcp

infra-mcp

Securely inspect and operate self-hosted infrastructure including Linux host health, Docker containers and logs, Dokploy deployments, and OCI resources through a narrowly scoped, auditable MCP gateway.

Category
Visit Server

README

infra-mcp

Secure MCP gateway for observing and controlling self-hosted infrastructure from ChatGPT. The project is designed to provide narrowly scoped, auditable access to Linux system diagnostics, Docker workloads, Dokploy deployments, and Oracle Cloud Infrastructure (OCI) without exposing an unrestricted shell or the Docker socket directly to the public MCP service.

Status: Initial scaffold. Start with read-only diagnostics and container logs, then add carefully scoped write operations after the deployment and authentication path is verified.

Architecture

ChatGPT Web
    |
    | MCP over HTTPS / Secure MCP Tunnel
    v
MCP Gateway (unprivileged container)
    |
    | authenticated Unix socket
    v
Host Agent (systemd service, allowlisted operations)
    |
    +-- Docker / container logs
    +-- systemd / journal
    +-- host health and diagnostics
    |
    +----------------------+
                           |
MCP Gateway ---------------+-- Dokploy API
                           +-- OCI APIs

The MCP gateway never receives arbitrary shell access and does not mount /var/run/docker.sock. Privileged host operations are isolated behind a small host agent with explicit allowlists and strict input validation.

Initial capabilities

  • System status: uptime, CPU load, memory, and root filesystem usage.
  • Docker: list containers and fetch bounded container logs.
  • Docker actions: restart a named container as an explicit write operation.
  • systemd: inspect failed services.
  • Health endpoints for the MCP gateway and host agent.

Planned integrations include Dokploy deployments, OCI instance lifecycle controls, OCI Vulnerability Scanning/Cloud Guard findings, package/security update workflows, and emergency recovery through OCI Run Command.

Repository layout

infra-mcp/
├── apps/
│   ├── mcp-server/       # ChatGPT-facing MCP gateway
│   └── host-agent/       # Privileged host-side allowlisted agent
├── deploy/
│   └── systemd/          # Host-agent service unit
├── docs/
│   ├── ARCHITECTURE.md
│   └── DEPLOYMENT.md
├── .env.example
├── docker-compose.yml
├── package.json
└── tsconfig.base.json

Security model

  1. No arbitrary shell tool. MCP tools map to explicit operations only.
  2. No Docker socket in the MCP container. Docker access stays in the host agent.
  3. Unix-socket boundary. The MCP gateway talks to the host agent through /run/infra-mcp/agent.sock.
  4. Shared agent token. Requests over the local socket still require an internal bearer token for defense in depth.
  5. Bounded inputs. Container names are validated and log output is capped.
  6. Read vs. write annotations. MCP tools advertise read-only/destructive intent so ChatGPT can apply confirmation policies appropriately.
  7. Secrets stay outside Git. Runtime secrets belong in Dokploy/environment configuration.

See docs/ARCHITECTURE.md for trust boundaries and docs/DEPLOYMENT.md for the Oracle VM + Dokploy setup and ChatGPT connection steps.

Development

Requirements:

  • Node.js 22+
  • npm 10+
  • Docker for the MCP gateway image
  • Linux + systemd for the host agent deployment
npm install
npm run build

Run the host agent locally:

cp .env.example .env
npm run dev:agent

Run the MCP server in another terminal:

npm run dev:mcp

The MCP endpoint is exposed at:

http://localhost:3000/mcp

For ChatGPT, deploy behind HTTPS or use OpenAI Secure MCP Tunnel. Do not expose a no-auth development endpoint directly to the public Internet.

ChatGPT app metadata

Suggested app name:

Infra MCP

Suggested app description:

Securely inspect and operate my self-hosted infrastructure, including Linux host health, Docker containers and logs, Dokploy deployments, and OCI resources. Use read-only diagnostics first and request confirmation before consequential operations.

Deployment direction

The intended production layout for the current Oracle VM + Dokploy setup is:

  • mcp-server: deployed as a normal Dokploy application/container.
  • host-agent: installed as a systemd service on the VM host.
  • /run/infra-mcp: bind-mounted into the MCP container.
  • ChatGPT: connected to the /mcp endpoint as a developer-mode app.
  • Authentication: add standards-compliant OAuth before exposing the MCP endpoint publicly; alternatively use a private Secure MCP Tunnel where appropriate.

Why not OCI Run Command for everything?

OCI Run Command is useful as an emergency/fallback path, but everyday diagnostics such as container logs are better served by the low-latency host agent. The long-term design keeps OCI APIs for VM lifecycle/recovery and uses the local agent for interactive host operations.

License

No license has been selected yet. Add one before encouraging third-party reuse or contributions.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured