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.
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
- No arbitrary shell tool. MCP tools map to explicit operations only.
- No Docker socket in the MCP container. Docker access stays in the host agent.
- Unix-socket boundary. The MCP gateway talks to the host agent through
/run/infra-mcp/agent.sock. - Shared agent token. Requests over the local socket still require an internal bearer token for defense in depth.
- Bounded inputs. Container names are validated and log output is capped.
- Read vs. write annotations. MCP tools advertise read-only/destructive intent so ChatGPT can apply confirmation policies appropriately.
- 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
/mcpendpoint 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。