Server Maintenance MCP Server
Allows checking the status, inspecting logs, starting, stopping, or restarting Docker containers on remote servers.
Provides SSH-based tools to connect to, inspect, and maintain remote Linux/Unix servers, including executing commands, checking system information, reading and writing files, listing directories, and managing services.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Server Maintenance MCP Server Check the system health and disk space on prod-web"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Server Maintenance MCP Server
A Model Context Protocol (MCP) server designed for Google Antigravity to securely connect, inspect, and maintain remote Linux/Unix servers over SSH.
Features
š„ļø Configurable Server Registry: Manage multiple servers with custom IDs, hostnames/IPs, custom ports, usernames, and tags.
š Flexible Authentication:
OpenSSH private keys (
~/.ssh/id_rsa,~/.ssh/id_ed25519, etc.)Passphrase-protected private keys
Password authentication
Environment variable interpolation (e.g.
"${PROD_PASSWORD}"or"${SSH_KEY_SECRET}")
š”ļø Credential Protection:
Passwords, passphrases, and private key contents are automatically scrubbed from tool outputs and agent responses.
config/servers.jsonis gitignored by default to prevent accidental credential commits.
ā” Native SSH & SFTP Engine: Powered by
ssh2without relying on hostssh.exeor terminal emulation quirks on Windows.š§° Agent Toolset:
ssh_list_servers: View all configured servers and their metadata.ssh_test_connection: Test connectivity and measure SSH ping/round-trip latency.ssh_execute_command: Run any shell command with working directory, custom timeout, and sudo support.ssh_system_info: Inspect real-time CPU model, cores, load averages, memory usage, disk mounts, and uptime.ssh_read_file: Read remote files with line offsets and line counts over SFTP.ssh_write_file: Upload/edit remote files over SFTP with automatic timestamped backup copies (.bak-...).ssh_list_directory: Explore remote directories over SFTP with file types, sizes, permissions, and timestamps.ssh_service_status: Convenience tool to check, inspect logs, start, stop, or restart systemd services or Docker containers.
Related MCP server: SSH MCP Server
Directory Structure
ServerMaintenanceMCP/
āāā config/
ā āāā servers.example.json # Documented configuration template
ā āāā servers.json # Your actual server connections (gitignored)
āāā src/
ā āāā config.ts # Configuration loader & env var expander
ā āāā index.ts # MCP Stdio Server entrypoint
ā āāā ssh-manager.ts # SSH & SFTP connection pool and handlers
ā āāā types.ts # Zod schemas & TypeScript types
ā āāā tools/
ā āāā index.ts # Tool schemas and dispatcher
āāā test/
ā āāā config-and-tools.test.ts # Vitest unit test suite
āāā dist/ # Compiled executable output
āāā mcp_config.json # Antigravity MCP registration template
āāā package.json
āāā tsconfig.jsonQuick Start
1. Configure Your Servers
Copy config/servers.example.json to config/servers.json:
cp config/servers.example.json config/servers.jsonEdit config/servers.json with your actual server details:
{
"defaultKeyPath": "~/.ssh/id_rsa",
"servers": [
{
"id": "prod-web",
"name": "Production Web & API Server",
"host": "192.168.1.50",
"port": 22,
"username": "ubuntu",
"privateKeyPath": "~/.ssh/id_rsa",
"tags": ["production", "web", "docker"],
"description": "Nginx reverse proxy and API services",
"defaultCwd": "/var/www"
},
{
"id": "staging-db",
"name": "Staging Database Server",
"host": "staging-db.internal",
"port": 2222,
"username": "deploy",
"password": "${STAGING_DB_PASSWORD}",
"tags": ["staging", "database"],
"description": "PostgreSQL staging instance"
}
]
}2. Build the Server
npm run buildTo run the automated test suite:
npm testAntigravity Integration
The server has already been registered in your global Antigravity MCP configuration:
~/.gemini/config/mcp_config.json
{
"mcpServers": {
"server-maintenance": {
"command": "node",
"args": [
"c:/Users/keesj/Documents/repos/ServerMaintenanceMCP/dist/index.js"
],
"env": {
"SERVERS_CONFIG_PATH": "c:/Users/keesj/Documents/repos/ServerMaintenanceMCP/config/servers.json"
}
}
}
}Once registered, restart Antigravity or refresh MCP tools. You can verify available tools under Additional Options (...) > MCP Servers.
Example Antigravity Prompts
Once configured, you can prompt Antigravity directly:
"List my configured servers and test connection to each one."
"Check the system health and disk space on
prod-web.""Inspect the last 50 lines of the Nginx error log on
prod-web.""Check the status of the docker service on
staging-db.""Edit
/etc/nginx/sites-available/defaultonprod-webto update the proxy pass URL and test the configuration withnginx -t."
Available Tools
8 toolsssh_execute_commandB
Execute a bash or shell command on a remote server over SSH. Supports working directory, timeouts, and sudo.
Inputs: command (required), serverId (required), cwd, sudo, +1 more.
ssh_list_directoryA
List remote directory contents via SFTP, returning filename, file type, file size, permissions, and modification timestamp.
Inputs: serverId (required), path.
ssh_list_serversA
List all configured remote servers available for SSH connections with their metadata, tags, and connection details (excluding sensitive credentials).
Inputs: tag.
ssh_read_fileA
Read the contents of a remote file over SFTP. Supports offset lines and line limits for inspecting log files and large config files.
Inputs: path (required), serverId (required), maxLines, offsetLines.
ssh_service_statusA
Check status, view logs, start, stop, or restart a systemd service or Docker container on the remote server.
Inputs: serverId (required), serviceName (required), lines, action.
ssh_system_infoA
Gather comprehensive diagnostic overview of a remote server: OS version, kernel, uptime, CPU cores/model, load averages, RAM usage, and disk mounts.
Inputs: serverId (required).
ssh_test_connectionA
Test SSH connectivity and measure round-trip latency to a specified server or all configured servers.
Inputs: serverId.
ssh_write_fileA
Create or update a remote file over SFTP. By default automatically creates a timestamped backup copy (.bak-...) of any existing file before overwriting.
Inputs: path (required), content (required), serverId (required), mode, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: listing servers, testing connectivity, executing commands, gathering system info, reading/writing files, listing directories, and managing services. No overlap in functionality, making agent selection straightforward.
All tools share the 'ssh_' prefix and mostly follow a verb_noun pattern (e.g., ssh_list_servers, ssh_execute_command, ssh_read_file). However, ssh_system_info and ssh_service_status are noun_noun rather than verb_noun, creating a minor inconsistency.
With 8 tools, the set is well-scoped for a server maintenance domain. Each tool covers a core operation without redundancy or bloat, appropriate for the server's purpose.
The toolset covers the main lifecycle for remote server management: listing, testing, executing, inspecting, file transfer, and service control. Minor gaps exist such as file deletion or rename, but agents can work around these with execute_command, so no dead ends.
Maintenance
Related MCP Connectors
Manage servers through SSH.
Manage remote servers, SSH terminals, files, databases and proxies with scoped access and approvals.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Securely control computers you explicitly pair through files, terminals, processes, screenshots, desktop UI/input, clipboard, browser automation, diagnostics, and document tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables remote server management through SSH and SFTP, supporting command execution, file transfers, and interactive shell sessions. It allows for multiple concurrent connections using either password or SSH key authentication.1131 npm5MIT
- AlicenseAqualityCmaintenanceEnables remote server administration via SSH, supporting command execution, SFTP file transfers, and multi-profile management. It features security safeguards like destructive command detection and audit logging to ensure safe interaction with remote Linux/Unix environments.175 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables managing Linux servers via SSH with tools for command execution, file operations, service management, and log analysis.-
- FlicenseNot gradedqualityDmaintenanceEnables remote shell control of Linux and network devices via SSH/Telnet, with session management and file transfer capabilities.-