OpsPilot

OpsPilot

Local AI ops broker that keeps SSH secrets on your machine, exposes intent-level MCP tools to agents, and requires approval via a loopback Web UI for dangerous writes.

Category
访问服务器

README

OpsPilot

English · 简体中文

Local AI ops broker: SSH secrets stay on your machine, agents call intent-level MCP tools (no keys in chat), and dangerous writes wait for approval in a loopback Web UI.

What it is

Day-to-day Linux ops via AI assistants often either:

  1. Puts SSH private keys/passwords into model context or tool arguments, or
  2. Exposes raw remote shell with weak “approve in chat” gates

OpsPilot is a single-user, loopback control plane on your machine:

  • Secrets stay in the local broker process / ~/.opspilot/ — never in MCP args or model-visible output
  • MCP exposes structured intent tools (host_alias + typed params), not arbitrary ssh/bash
  • Read-only work can run automatically; writes/restarts wait for the local Web UI approval queue
  • A project Agent Skill teaches assistants the same boundaries and hard-stops if the MCP broker is missing (no fallback to raw SSH)

Listens on 127.0.0.1 only (default port 4317).

Features

Area Notes
Host catalog Alias, SSH address, services, log roots, credentials
Read-only ops Inspect, list log dirs, truncated logs, allowlisted files, Docker read-only
Approval-gated writes Service restart, file write/upload
Per-host auto-approve reads Optional; writes still require approval
Approvals + audit UI queue + local audit.jsonl
EN / 中文 UI Top-bar language toggle

Out of v1 scope: arbitrary remote shell/PTY, Docker writes, local Docker socket, Kubernetes, cloud APIs, bastion multi-hop, multi-host orchestration.

Requirements

  • Node.js ≥ 20
  • Network reachability to target Linux hosts
  • Cursor (or another MCP + Skills client) optional for agents

Install

git clone <your-repo-url> OpsPilot
cd OpsPilot
npm install

Start the local UI / broker

npm start

Open http://127.0.0.1:4317

  1. Create a host under Hosts (alias, address, user, port)
  2. Paste an SSH password or private key and save (the field clears after save on purpose; status shows attached)
  3. Prefer registering log directories (e.g. /opt/prod-log/); agents list files first, then fetch a concrete file
  4. For test hosts, optionally enable Auto-approve read-only ops
  5. Use Test connection
  6. Approve/reject gated ops under Approvals

Data directory default: ~/.opspilot/ (catalog.json, secrets.json, audit.jsonl).

Env var Default Meaning
OPSPILOT_PORT 4317 Web UI / HTTP MCP bridge port
OPSPILOT_DATA_DIR ~/.opspilot Data directory
OPSPILOT_APPROVAL_TIMEOUT_MS 600000 (10m) Approval timeout

Recommended: start npm start first, then connect Cursor MCP. If the MCP child finds the port in use, it proxies tool calls to the primary broker so the Approvals UI stays in sync.

Configure Cursor MCP

Add OpsPilot to user or project mcp.json (use your absolute path):

Project .cursor/mcp.json:

{
  "mcpServers": {
    "opspilot": {
      "command": "npx",
      "args": ["tsx", "/ABSOLUTE/PATH/TO/OpsPilot/src/index.ts"],
      "env": {
        "OPSPILOT_PORT": "4317"
      }
    }
  }
}

Or via npm:

{
  "mcpServers": {
    "opspilot": {
      "command": "npm",
      "args": ["start", "--prefix", "/ABSOLUTE/PATH/TO/OpsPilot"],
      "env": {
        "OPSPILOT_PORT": "4317"
      }
    }
  }
}

Then:

  1. Restart MCP / Reload Window in Cursor
  2. Confirm tools such as opspilot_list_hosts and opspilot_fetch_logs appear
  3. Keep one primary npm start UI; let MCP proxy rather than running conflicting brokers

Example prompt: “Use OpsPilot to show the latest log on user-test.”

Configure the Agent Skill

Shipped in two places (same content):

.cursor/skills/opspilot/   # Cursor project skill (used when this repo is the workspace)
skills/opspilot/           # Standalone copy for reuse / distribution
  SKILL.md
  BOUNDARIES.md

Open this repo as the Cursor workspace so the opspilot skill under .cursor/skills/ can be selected. To install elsewhere, copy skills/opspilot/ (or .cursor/skills/opspilot/) into that project’s .cursor/skills/opspilot/.

Rules of thumb:

  • Require a connected OpsPilot MCP; if absent, stop — do not fall back to generic SSH MCP or handwritten ssh
  • Logs: opspilot_list_log_files first, then opspilot_fetch_logs on a file path
  • Chat “approve” is not approval — use the local Approvals UI and request_id

MCP tools (illustrative)

Tool Purpose
opspilot_list_hosts / opspilot_describe_host Catalog discovery
opspilot_inspect_host Read-only inspect
opspilot_list_log_files List a catalog log directory
opspilot_fetch_logs Fetch a concrete log file (truncated)
opspilot_restart_service Restart (needs approval)
opspilot_read_file / write_file / upload_file Allowlisted paths
opspilot_docker_ps / opspilot_docker_logs Remote Docker read-only
opspilot_get_request Request / approval status

Always trust the live tools/list schemas; never invent tool names.

Dev commands

npm test
npm run typecheck
npm start

Security notes

  • Loopback only — do not expose port 4317 publicly
  • Never paste private keys/passwords into chat; save them only in the local UI
  • Approval timeout defaults to 10 minutes with no auto-retry

License

Private / unlicensed unless you add a license file.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选