$_ServerOpsMCPAI operations. Human control.
Menu
Complete product manual · linux-server-mcp v3.7.0

Every capability. Every interface. Real examples.

ServerOpsMCP is a security-aware MCP control plane and SSH Manager for authorized Linux infrastructure. This guide covers the complete 37-tool runtime, CLI, local and remote MCP transports, security modes, operations, database and backup workflows, advanced automation, and the commercial web surface.

37canonical MCP tools
6tool groups
4security modes
3npm binaries
01 · Quickstart

Go from zero to a controlled SSH target.

The npm package ships three binaries: linux-server-mcp and mcp-ssh-manager start the MCP server, while ssh-manager is the operator CLI.

Install and verify
npm install --global linux-server-mcp@3.7.0
linux-server-mcp --help
ssh-manager --version
ssh-manager --help
Create and test a target
ssh-manager server add
ssh-manager server list
ssh-manager server test prod1

# then start local stdio MCP
linux-server-mcp
Recommended first target

Use a dedicated Unix account with the minimum OS permissions you need. Start with readonly for inspection or restricted with explicit allow rules for automation.

02 · Server configuration

Targets can be defined interactively, with environment variables or TOML.

Environment target names follow SSH_SERVER_<NAME>_<PROPERTY>. Key authentication is preferred; password authentication is also supported. The server name becomes the target used by MCP tools.

Restricted production target
SSH_SERVER_PROD_HOST=prod.example.com
SSH_SERVER_PROD_PORT=22
SSH_SERVER_PROD_USER=deploy
SSH_SERVER_PROD_KEYPATH=/var/lib/linux-server-mcp/ssh/prod_ed25519
SSH_SERVER_PROD_MODE=restricted
SSH_SERVER_PROD_ALLOW_PATTERNS=whoami;uptime;df(?: -h)?;systemctl status [A-Za-z0-9_.@-]+
SSH_SERVER_PROD_DENY_PATTERNS=\bsudo\b;\bsu\b;\bbash\b;\bsh\b
SSH_SERVER_PROD_AUDIT_LOG=/var/log/linux-server-mcp/audit-prod.jsonl
Equivalent TOML idea
[ssh_servers.prod]
host = "prod.example.com"
user = "deploy"
key_path = "/var/lib/linux-server-mcp/ssh/prod_ed25519"
mode = "restricted"
allow_patterns = ["uptime", "df(?: -h)?", "systemctl status [A-Za-z0-9_.@-]+"]

Host-key trust

Host verification is a separate boundary from login authentication. Use ssh_key_manage to check/verify known fingerprints, and only use the accept/remove actions when the operator explicitly intends to change trust.

tool: ssh_key_manage
{ "action": "verify", "server": "prod" }

# explicit trust mutation when reviewed
{ "action": "accept", "server": "prod", "autoAccept": false }
03 · Security modes

The security mode is enforced server-side, per target.

Client approvals cannot override a backend denial. Use the narrowest mode that still allows the workflow.

readonlyInspection allowlist

Blocks arbitrary commands and side-effecting server operations. Allows structured health/service/monitor/log/backup-list/db-list/read-only-query and selected read actions.

restrictedControlled automation

Rejects shell-composition first, applies deny rules before allow rules, and fails closed when no allow pattern matches.

unrestricted_except_ssh_keyBroad remote power + key boundary

Allows broad remote administration but protects every configured SSH private-key path from MCP-host file-transfer operations.

unrestrictedCompatibility / maximum privilege

Broadest surface with no command filter and no private-key path guard. Treat it like the configured SSH account plus the local transfer surface.

Readonly behavior that matters

  • Denied: ssh_execute, sudo, group execution, persistent sessions, upload/download/sync/deploy, backup create/restore/schedule, db dump/import and tunnel creation.
  • Allowed inspection includes health, service status, monitor, tail, backup list, database list/query, connection status and history.
  • ssh_process_manager allows list/info but not kill; ssh_alert_setup allows get/check but not set; ssh_key_manage allows verify/check/list but not accept/remove.

Restricted evaluation order

  1. Reject shell-composition/control operators.
  2. Evaluate deny patterns; deny wins.
  3. Require an allow-pattern match.
  4. Without allow patterns, execution fails closed.
Important boundary

unrestricted_except_ssh_key specifically protects configured SSH private-key paths on the MCP host. It is not a kernel sandbox and it does not automatically hide every other local secret.

04 · Complete MCP tool catalog

37 canonical tools in six functional groups.

The current hardened server factory validates exact name parity against this 37-tool registry for both stdio and Streamable HTTP transports.

05 tools

Core SSH operations

The essential surface for target discovery, remote execution and moving files between the MCP host and Linux servers.

ssh_list_servers

List configured SSH targets and aliases; optionally probe remote capabilities.

ssh_execute

Run one bounded command on an authorized server and return stdout, stderr, exit code and timing.

ssh_upload

Upload one local file to a remote path over SFTP.

ssh_download

Download one remote file to a local path on the MCP host.Denied in readonly because it writes a caller-selected local path.

ssh_sync

Rsync files or directories in either direction, with exclude, dry-run, checksum and optional delete behavior.

04 tools

Persistent SSH sessions

Keep a stateful shell alive when a workflow needs persistent cwd, environment variables or command history.

ssh_session_start

Open a persistent interactive shell and return a session id.

ssh_session_send

Run another command in the existing session while preserving state.

ssh_session_list

List live sessions, server, cwd, age, idle time and command count.

ssh_session_close

Close one persistent session or all sessions.

06 tools

Monitoring & diagnostics

Read system health, services, processes, metrics and logs, plus configure or evaluate resource alerts.

ssh_health_check

Read CPU, memory, disk, uptime and optional detailed load/network information.

ssh_service_status

Check one or more services and return running/stopped counts plus aggregate health.

ssh_process_manager

List or inspect processes; kill is also available outside readonly mode.

ssh_monitor

Snapshot overview, CPU, memory, disk, network or process metrics.

ssh_tail

Read recent log lines and optionally filter by a grep pattern.

ssh_alert_setup

Set, read or check CPU/memory/disk alert thresholds.

04 tools

Backup & restore

Create, inventory, restore and schedule compressed backups for databases and files.

ssh_backup_create

Create MySQL, PostgreSQL, MongoDB or file backups with metadata, exclusions and retention pruning.

ssh_backup_list

List backup metadata including type, size, retention and creation time.

ssh_backup_restore

Restore a recorded backup to a database or filesystem target.Destructive: database restores can clean/drop existing objects.

ssh_backup_schedule

Write a backup script and install a cron schedule with retention cleanup.

04 tools

Database operations

Work with MySQL, PostgreSQL and MongoDB through explicit database-aware operations.

ssh_db_dump

Dump a database, optionally selected tables/collections, with compression support.

ssh_db_import

Import a dump into a target database.Destructive to matching/existing data; PostgreSQL uses clean restore and MongoDB can drop.

ssh_db_list

List databases or tables/collections without modifying data.

ssh_db_query

Run read-only database queries; SQL engines only accept SELECT and MongoDB uses find().

14 tools

Advanced operations

Deployments, sudo, aliases, hooks, profiles, tunnels, groups, connection lifecycle, host-key trust and execution history.

ssh_deploy

Deploy one or more local files through a temporary path, optional backup, owner/mode update and service restart.

ssh_execute_sudo

Run a command through sudo using the configured account and optional masked sudo password.

ssh_alias

Create, remove or list local server-name aliases.

ssh_command_alias

Manage reusable shorthand command aliases and suggestions.

ssh_hooks

List, enable, disable or inspect automation hooks that run around operations such as deploy/backup.

ssh_profile

List or switch operational profiles such as default, Docker, Frappe and Node.js.

ssh_connection_status

Inspect, reconnect, disconnect or clean up pooled SSH connections.

ssh_tunnel_create

Create local forwarding, remote forwarding or dynamic SOCKS5 tunnels.

ssh_tunnel_list

List active tunnels, endpoints, connection counts, bytes and errors.

ssh_tunnel_close

Close one tunnel or every tunnel attached to a server.

ssh_key_manage

Verify/check/list host fingerprints or explicitly accept/remove known-host keys.

ssh_execute_group

Run a command across a named group using parallel, sequential or rolling strategy.

ssh_group_manage

Create/update/delete groups and add/remove servers; persist default execution strategy.

ssh_history

Read recent MCP SSH command history metadata without exposing command output.

05 · SSH Manager CLI

Use interactive menus or direct command mode.

Run ssh-manager or ssh-manager -i for the guided menu. Direct mode exposes the following command families.

server

add · list · test · remove · edit · show

sync

push · pull

tunnel

create · list · close

monitor

cpu · memory · disk · network

session

start · list · close

exec

run · group

config

edit · show · init

tools

list · configure · enable · disable · reset · export

Common CLI examples
ssh-manager server list
ssh-manager server test prod1
ssh-manager sync push prod1 ./app /var/www/app
ssh-manager tunnel create prod1 local 3307:localhost:3306
ssh-manager monitor prod1 cpu
ssh-manager tools list
ssh-manager tools configure
06 · MCP clients

Use the same tool surface through local stdio or remote Streamable HTTP.

Local stdio

linux-server-mcp
# or
npm run start:stdio

Claude Code example

claude mcp add linux-server-mcp node "$(pwd)/src/index.js"

# Then ask the client to use tools such as:
# ssh_list_servers → ssh_health_check → ssh_service_status

Generic MCP workflow

1. list tools
2. choose server target
3. call ssh_health_check before mutations
4. call the smallest operation required
5. verify outcome with health/service/log tools

Tool schemas and security policy remain the authority. A capable client can orchestrate many calls, but it cannot grant itself more server privileges than the selected target mode permits.

07 · Remote MCP & OAuth

Expose Streamable HTTP behind HTTPS, not a raw public Node port.

Endpoints
POST https://mcp.example.com/mcp
GET  https://mcp.example.com/healthz

# default Node bind
127.0.0.1:8787
bearer

Static Bearer credential only. Default for backward compatibility.

oauth

OAuth 2.1 Authorization Code + mandatory PKCE S256 access tokens only.

mixed

Accept static Bearer or OAuth access tokens. Useful during migration.

none

Development-only, loopback-only and refused in production.

Static Bearer production example
NODE_ENV=production
MCP_AUTH_MODE=bearer
MCP_AUTH_TOKEN_FILE=/run/credentials/linux-server-mcp.service/mcp_auth_token
# optional rotation grace credential
MCP_AUTH_TOKEN_PREVIOUS_FILE=/run/credentials/linux-server-mcp.service/mcp_auth_token_previous

OAuth endpoints and behavior

GET  /.well-known/oauth-protected-resource
GET  /.well-known/oauth-protected-resource/mcp
GET  /.well-known/oauth-authorization-server
GET  /oauth/authorize
POST /oauth/authorize
POST /oauth/token

OAuth uses Authorization Code + PKCE S256, explicit MCP resource binding, short-lived access tokens and rotating persistent refresh tokens. Refresh tokens are stored as SHA-256 digests, rotated after successful refresh and bound to client id, resource, scopes and expiry.

Reverse-proxy and request hardening

MCP_ALLOWED_ORIGINS=https://app.example.com,https://admin.example.com
MCP_ALLOWED_HOSTS=mcp.example.com
MCP_TRUST_PROXY=true     # only when the proxy is explicitly trusted
MCP_HTTP_BODY_LIMIT_BYTES=2097152
MCP_HTTP_MAX_HEADER_SIZE=32768
MCP_HTTP_REQUEST_TIMEOUT_MS=30000
  • /mcp is POST-only and JSON-only.
  • Production HTTP startup fails closed when required credentials/config are missing.
  • Authorization headers/tokens are not logged; production stack traces are not returned.
  • Machine-to-machine clients may omit Origin. If Origin is present it must be allowlisted.
08 · ChatGPT integration

Recommended topology: ChatGPT → HTTPS + OAuth → Linux Server MCP → SSH targets.

Topology
ChatGPT custom MCP app
        │ HTTPS + OAuth
        ▼
https://mcp.example.com/mcp
        │
   Caddy / nginx
        │ loopback
        ▼
127.0.0.1:8787 → ServerOpsMCP → authorized SSH targets
Recommended server-side base
NODE_ENV=production
MCP_HTTP_HOST=127.0.0.1
MCP_HTTP_PORT=8787
MCP_AUTH_MODE=mixed
MCP_PUBLIC_BASE_URL=https://mcp.example.com
MCP_OAUTH_ISSUER=https://mcp.example.com
MCP_OAUTH_RESOURCE=https://mcp.example.com/mcp
MCP_OAUTH_CLIENT_ID=chatgpt-linux-server-mcp

For ChatGPT, use the OAuth integration path and the exact callback URL shown by the ChatGPT custom MCP/app configuration UI. Remote authentication and target SSH security are independent: OAuth success never changes SSH_SERVER_<NAME>_MODE.

09 · Stateful sessions

Keep shell context only when the workflow truly needs it.

tool: ssh_session_start
{ "server": "prod", "name": "release-check" }
# returns session id: abc...

tool: ssh_session_send
{ "session": "abc...", "command": "cd /srv/app && export RELEASE=v42" }

tool: ssh_session_send
{ "session": "abc...", "command": "pwd && echo $RELEASE" }

tool: ssh_session_close
{ "session": "abc..." }

Unlike one-shot ssh_execute, sessions preserve current directory and exported environment. They consume a remote shell until closed and are denied in readonly mode.

10 · Monitoring & incident diagnostics

Inspect first, mutate second.

Read-only incident triage
ssh_health_check  → detailed=true
ssh_service_status → ["nginx", "docker"]
ssh_process_manager → action=list, sortBy=memory
ssh_monitor → type=disk
ssh_tail → /var/log/nginx/error.log, follow=false, lines=100
Threshold workflow
tool: ssh_alert_setup
{ "server": "prod", "action": "set", "cpuThreshold": 85, "memoryThreshold": 90, "diskThreshold": 85 }

tool: ssh_alert_setup
{ "server": "prod", "action": "check" }

Readonly targets can inspect processes and alerts but cannot kill processes or write alert configuration.

11 · Backups & disaster recovery

Backup flows cover MySQL, PostgreSQL, MongoDB and files.

Create database backup
tool: ssh_backup_create
{
  "server": "prod",
  "type": "postgresql",
  "name": "orders-nightly",
  "database": "orders",
  "retention": 14,
  "compress": true
}
Files + schedule
ssh_backup_create: { server: "prod", type: "files", name: "app-data", paths: ["/srv/app/uploads", "/etc/nginx"], exclude: ["*.tmp"], retention: 7 }

ssh_backup_schedule: { server: "prod", schedule: "0 2 * * *", type: "postgresql", name: "orders", database: "orders", retention: 14 }
Restore is destructive

PostgreSQL restore uses clean/if-exists behavior, MongoDB can drop existing collections, and MySQL imports objects from the dump. Verify the backup id and target before restoring.

12 · Database operations

Use database-aware tools instead of generic shell when possible.

Read-only SQL
tool: ssh_db_query
{
  "server": "prod",
  "type": "postgresql",
  "database": "orders",
  "query": "SELECT id, status FROM jobs ORDER BY id DESC LIMIT 20"
}
Inventory and dump
ssh_db_list: { server: "prod", type: "mysql" }
ssh_db_list: { server: "prod", type: "mysql", database: "shop" }
ssh_db_dump: { server: "prod", type: "mysql", database: "shop", outputFile: "/var/backups/shop.sql", compress: true, tables: ["orders", "customers"] }

For MySQL/PostgreSQL, ssh_db_query only accepts SELECT and rejects common mutation/DDL keywords before execution. MongoDB querying uses find() with an explicit collection.

13 · Advanced operations

Deployments, tunnels, groups, aliases, hooks, profiles and connection control.

Safe file deployment

tool: ssh_deploy
{
  "server": "prod",
  "files": [{ "local": "./nginx.conf", "remote": "/etc/nginx/nginx.conf" }],
  "options": { "backup": true, "owner": "root:root", "permissions": "644", "restart": "nginx" }
}

Tunnels

ssh_tunnel_create: { server: "prod", type: "local", localPort: 5433, remoteHost: "127.0.0.1", remotePort: 5432 }
ssh_tunnel_create: { server: "prod", type: "dynamic", localPort: 1080 }
ssh_tunnel_list: {}
ssh_tunnel_close: { tunnelId: "..." }

Groups and rolling execution

ssh_group_manage: { action: "create", name: "web", servers: ["web1", "web2", "web3"], strategy: "rolling", delay: 3000, stopOnError: true }
ssh_execute_group: { group: "web", command: "systemctl status nginx", strategy: "rolling", delay: 3000, stopOnError: true }

Profiles, aliases and hooks

Profiles bundle reusable command aliases and hook behavior for common stacks. The repository includes default, Docker, Frappe and Node.js profiles. Switching a profile changes the local configuration used by later operations.

ssh_profile: { action: "list" }
ssh_profile: { action: "switch", profile: "docker" }
ssh_command_alias: { action: "add", alias: "web-logs", command: "docker compose logs --tail=200 web" }
ssh_command_alias: { action: "suggest", command: "logs" }
ssh_hooks: { action: "list" }
ssh_hooks: { action: "enable", hook: "pre-deploy" }

Connection lifecycle and history

ssh_connection_status: { action: "status" }
ssh_connection_status: { action: "reconnect", server: "prod" }
ssh_history: { limit: 20, server: "prod", success: true }
14 · Tool management

Tool groups and server security modes solve different problems.

The inherited tool configuration supports all, minimal and custom, with groups core, sessions, monitoring, backup, database and advanced.

ssh-manager tools list
ssh-manager tools configure
ssh-manager tools enable monitoring
ssh-manager tools disable backup
ssh-manager tools reset
ssh-manager tools export
Current AgentForge hardened parity rule

The private hardened transport facade currently validates an exact 37-tool backend parity. A tool configuration that causes the backend to register fewer than all 37 canonical tools can make startup fail parity validation. Treat the CLI tool-filter configuration as inherited compatibility functionality until the hardened facade supports reduced registries.

Even with all tools registered, each target security mode still gates whether a particular action is allowed. Registration is not authorization.

15 · Commercial web application

The repository also ships the ServerOpsMCP commercial website and SaaS account surface.

Public sandbox

/demo demonstrates policy decisions without exposing browser-side SSH credentials.

Accounts

Signup, login, logout and session endpoints back the /account experience.

API keys

Account-scoped key creation/revocation is exposed through the account key API and stored as protected key records.

Billing

Subscription state, renewals and portal information are associated with accounts and entitlement state.

Checkout

Pricing/cart/checkout flows support Dodo Payments and Lemon Squeezy when the selected provider is fully provisioned.

SaaS admin

/saas-admin manages payment-provider credentials, product mappings and webhook readiness; stored provider credentials are encrypted at rest.

Fail-closed commerce behavior

Checkout availability is not considered ready until required provider credentials, product/variant mappings and webhook verification are provisioned. The web application includes separate verified webhook routes for Dodo and Lemon Squeezy.

GET/POST /api/account/*
POST     /api/checkout
POST     /api/webhooks/dodo
POST     /api/webhooks/lemon
GET      /api/health

Admin UI: /saas-admin
16 · Production workflow recipes

Compose small tools into auditable operational loops.

Incident response
  1. health check
  2. service status
  3. tail logs
  4. inspect processes
  5. smallest permitted remediation
  6. verify health again
Deployment
  1. backup/config snapshot
  2. deploy or sync
  3. restart service
  4. service status
  5. HTTP/log verification
  6. review history/audit
Fleet change
  1. create group
  2. run read-only preflight
  3. rolling group execution
  4. stop on first error
  5. verify every member
Disaster recovery
  1. list backups
  2. validate target and backup id
  3. restore in maintenance window
  4. restart dependencies
  5. health + DB read checks
Example: verify before and after restart
1. ssh_service_status(server=prod, services=["nginx"])
2. ssh_tail(server=prod, file=/var/log/nginx/error.log, follow=false, lines=50)
3. ssh_execute(server=prod, command="systemctl restart nginx")  # only if policy allows
4. ssh_service_status(server=prod, services=["nginx"])
5. ssh_health_check(server=prod)
17 · Troubleshooting

Diagnose transport, target auth, policy and tool parity separately.

Server missing

Run ssh-manager server list, inspect the config file and verify the target naming convention.

SSH fails

Run ssh-manager server test NAME, check host-key trust, key permissions, user and port.

Policy denied

Check target mode. In restricted mode inspect allow/deny patterns; deny wins and shell-composition is rejected before regex matching.

Remote 401

Check MCP_AUTH_MODE, static token file or OAuth access token, and the OAuth discovery challenge.

Remote 403

For OAuth, confirm the token has the required mcp:tools scope and correct resource binding.

Tool parity startup failure

Reset tool configuration to the full registry while the hardened facade requires exact 37-tool parity.

ssh-manager server list
ssh-manager server test prod
ssh-manager tools list
curl -fsS https://mcp.example.com/healthz
curl -i https://mcp.example.com/.well-known/oauth-protected-resource
18 · Repository reference

Deep-dive documents.

This page is an operational overview of implemented repository capabilities. The source code and repository-specific security documents remain authoritative for exact schemas, destructive-operation boundaries and deployment-specific configuration.