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.
README
OpsPilot
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:
- Puts SSH private keys/passwords into model context or tool arguments, or
- 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 arbitraryssh/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
- Create a host under Hosts (alias, address, user, port)
- Paste an SSH password or private key and save (the field clears after save on purpose; status shows attached)
- Prefer registering log directories (e.g.
/opt/prod-log/); agents list files first, then fetch a concrete file - For test hosts, optionally enable Auto-approve read-only ops
- Use Test connection
- 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:
- Restart MCP / Reload Window in Cursor
- Confirm tools such as
opspilot_list_hostsandopspilot_fetch_logsappear - Keep one primary
npm startUI; 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_filesfirst, thenopspilot_fetch_logson 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
4317publicly - 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.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.