servidor-mcp
This MCP server lets an AI work on your remote Linux servers over SSH (via already-open sessions), with six tools:
List servers (
listar_servidores): show registered servers and whether their SSH session is open.Run commands (
ejecutar_comando): execute any non-interactive shell command on a server and get exit code, stdout and stderr (with optional timeout). Not for interactive prompts, passwords or editors.Check system health (
estado_sistema): uptime/load, memory, disk, top processes, failed systemd services and Docker containers.View logs (
ver_logs): last N lines from a systemd service, a Docker container, a log file, or the whole journal, with optional time range (desde) and grep-style filter.Read files (
leer_archivo): first or last N lines of a text file on the server.Write files (
escribir_archivo): create or replace a text file, with an automatic.bak.<date>backup if it exists (no sudo; only paths the SSH user can write).
All calls are shown to you and recorded in the audit log, and access ends immediately when you close the session (srv-mcp off).
Provides Docker visibility on remote servers through system status and container log inspection, allowing AI agents to check Docker containers and logs alongside other server state.
Enables AI agents to work on remote Linux servers over SSH, providing tools for system status, service and system logs, file reading/writing, and shell command execution.
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., "@servidor-mcp revisa el estado del servidor dev y dime si hay servicios caídos"
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-mcp
English | Español
Renamed from
servidor-mcp. If you installed the old plugin, remove it and install the new one:claude plugin uninstall servidor-mcp@servidor-mcp,claude plugin marketplace remove servidor-mcp, then follow Install. Your servers, sessions and~/.srv-mcp/config.tomlkeep working as they are.
MCP server that lets AIs (Claude Code, Claude Desktop, Cursor, VS Code…) work on your Linux servers over SSH, without giving them your password and without installing anything on the server.
You: srv-mcp on dev → type your password → SSH session open (8h)
AI: run_command(...) → uses that open session, no password
You: srv-mcp off dev → the AI loses access immediatelyTools the AI gets
Tool | What it does |
| Registered servers and whether their session is open |
| Load, memory, disk, top processes, failed services, Docker |
| journalctl for a service, |
| First or last N lines of a file |
| Creates/replaces a file, with an automatic |
| Any (non-interactive) shell command |
Every call shows up in your AI client with the exact command, and is recorded in the
audit log ~/.srv-mcp/logs/<server>.log (srv-mcp log <server>).
Related MCP server: ssh-pro-mcp
Before you start (done by the server admin)
Create a separate SSH user for each person on each server (don't share users: that way the audit log and permissions belong to each person, and one can be revoked without affecting the others).
Optional, so they can read service logs (
journalctl), on each server:sudo usermod -aG systemd-journal <user>
Step-by-step guide (each person, on their Mac or Linux)
Requirements: Python 3.11+, OpenSSH and git. The commands work from any folder.
1. Install
Option A: Claude Code plugin (recommended). Inside Claude Code:
/plugin install server-mcp --marketplace Daniel-Riv/server-mcpOn versions before 2.1.275, in two steps:
/plugin marketplace add Daniel-Riv/server-mcp and then
/plugin install server-mcp@server-mcp.
Or from the terminal (also works if you use the desktop app):
claude plugin marketplace add Daniel-Riv/server-mcpclaude plugin install server-mcp@server-mcpOpen a new session: on start, the plugin sets up Python by itself (a few seconds the
first time). To have the srv-mcp command in your terminal, create the shortcut once:
mkdir -p ~/bin && ln -sf ~/.claude/plugins/data/server-mcp-server-mcp/srv-mcp ~/bin/srv-mcp(if ~/bin is not in your PATH: echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc).
The command in Claude is /server-mcp:access-server. Update it with
/plugin update server-mcp.
Option B: clone the repo (no plugins, or to use the MCP with other AIs):
git clone https://github.com/Daniel-Riv/server-mcp.git ~/server-mcp && ~/server-mcp/install.shThe installer creates .venv with the dependencies, puts the srv-mcp command in ~/bin
(and adds it to PATH) and installs the skill as /access-server.
Don't use both options at once (you'd get the skill twice). Open a new terminal
when it finishes. Check with srv-mcp: it should print the help.
2. Register each server
srv-mcp setupIt asks these questions (type the answer and press Enter):
Question | What to answer |
Short name | An alias without spaces, e.g. |
IP or domain | The server's address |
SSH user | Your user on that server |
SSH port | Enter if it is 22 |
Do you reach it through another server? | Enter if you connect directly from your machine. If you first have to log into another server, type that server's alias (it must be registered first) |
Read-only? |
|
Example with a main server and two internal machines (dev and prod) reached through it:
Your Mac ──▶ main (public IP) ──▶ dev (internal IP)
└──▶ prod (internal IP)Server | IP | Through another? | Read-only? |
| public IP | Enter (direct) |
|
| internal IP |
|
|
| internal IP |
|
|
Register the main one first, then the others. Check with srv-mcp list.
3. Open the session
srv-mcp on devThe first time it asks
Are you sure you want to continue connecting (yes/no)?→yes.It asks for your password. Nothing shows while you type it, that's normal; Enter at the end.
If the server goes through another one, it first asks for that one's password (if it wasn't open).
The session lasts 8 hours.
srv-mcp statusshows which ones are open (●).
Check that it works without asking for a password:
srv-mcp run dev "hostname && uptime"4. Use it with Claude Code
In a new Claude session:
/server-mcp:access-server check the status of dev(With option B the command is /access-server.) Claude only touches servers when you
type that command. It shows you each command before running it and asks before any
change. When you are done:
srv-mcp log dev # what the AI ran
srv-mcp off dev # cut accessUpdate
Plugin: /plugin update server-mcp. Option B:
cd ~/server-mcp && git pull && ./install.shWhere can you connect from?
srv-mcp reaches any server your machine can reach over SSH: if ssh user@ip works
from your computer, srv-mcp works too. Nothing is installed on the server.
Server situation | What you need | What to enter in |
Public IP (VPS, cloud, server with its own IP) | Nothing else | The public IP; "through another": Enter |
Private IP, but there is a server with a public IP on that network | Register that entry server first | The private IP; "through another": the entry server's alias |
Private IP, no entry server | A VPN into that network (company VPN, WireGuard, Tailscale) | With the VPN connected, the private or VPN IP; "through another": Enter |
Same network (office, same Wi-Fi) | Nothing else | The private IP; "through another": Enter |
If it doesn't connect, check: the firewall or cloud "security group" allows the SSH port from your IP; the port (if not 22); and that your user exists and can log in.
Servers on Tailscale: install Tailscale on your computer, join the same tailnet (or
have the owner share the server with you), and find the server's address with
tailscale status (100.x.y.z or its MagicDNS name). Use that address in srv-mcp setup
with "through another": Enter. Tailscale must be connected while you use it. If the
server uses Tailscale SSH, srv-mcp on won't ask for a password.
sudo
sudo with a password doesn't work through the AI (it's not interactive, and the AI never
sees your password). Two options:
You run it yourself (safest). The AI gives you the command and you run it in your terminal with
ssh -t, which reuses the open session; onlysudoasks for your password:ssh -t dev "sudo systemctl restart nginx"NOPASSWDfor specific commands, configured by the admin on the server (sudo visudo -f /etc/sudoers.d/<user>):<user> ALL=(root) NOPASSWD: /usr/bin/systemctl restart nginx, /usr/bin/docker psDon't add editors or pagers (
vim,less), interpreters (bash,python), commands that copy or write files (cp,tee) or broad wildcards (systemctl *): they allow getting a root shell or overwriting any file.
Common problems
Symptom | Cause and fix |
| The terminal was opened before installing. Open a new one (or use |
| The session isn't open or expired: |
| That alias doesn't exist; check |
| It is waiting for your answer: type it in the terminal and press Enter. |
| Your user is not in the |
The AI says "is in 'read-only' mode" | That server is read-only; change it in |
The command doesn't show up in Claude | Open a new session. Plugin: check it is enabled in |
| Plugin: open a new session so it sets itself up (needs Python 3.11+). Option B: run |
| See sudo. |
Other AIs (Claude Desktop, Cursor…): MCP server
The skill uses srv-mcp run/health/logs/read/write, with the same rules and audit log as
the MCP server. If you'd rather Claude Code use it without /, install with
./install.sh --mcp.
For other clients, the server command is the absolute path to .venv/bin/server-mcp.
In the client's MCP config file:
{
"mcpServers": {
"server-mcp": { "command": "/path/to/server-mcp/.venv/bin/server-mcp" }
}
}Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.jsonCursor:
~/.cursor/mcp.json
Command reference
srv-mcp setup # register a server
srv-mcp list # registered servers
srv-mcp on <server> # open session (asks for password)
srv-mcp status # which sessions are open
srv-mcp log <server> # what the AIs ran
srv-mcp off <server> # close session
srv-mcp run <server> "command" # run by hand with the same rulesTo remove a server, delete its block (# srv-mcp: <alias> … # srv-mcp: end <alias>)
from ~/.ssh/config and its section in ~/.srv-mcp/config.toml, if any.
Permissions (~/.srv-mcp/config.toml)
Everything is allowed by default. Each user changes it in their own file (see config.example.toml):
mode = "read-only" # "full" (default) or "read-only"
blocked = ['\breboot\b', 'rm -rf'] # regexes that are always rejected
timeout = 120 # seconds per command
[servers."prod"] # per-server settings (setup creates it if you choose read-only)
mode = "read-only"
blocked = ['virsh destroy']Changes apply on the next call; nothing needs restarting. Config files from versions
≤ 0.2 (in Spanish: modo = "lectura", [servidores."prod"], bloqueados) still work.
"read-only" mode rejects commands that look like they modify the server (rm, mv,
systemctl restart, apt install, docker stop/rm/down, > redirects…). It is a
safety net against AI mistakes, not a security boundary. The real boundary is the SSH
user: for truly restricted access, create a user without sudo on the server and register
it with srv-mcp setup.
Security
Only you type the password, in your terminal; a local socket stays in
~/.ssh/cm/that only your user on the Mac can use.Only servers registered with
srv-mcp setupare accepted.While the session is open, the AI can do anything your SSH user can do. Close it with
srv-mcp offwhen you're done.sudowith a password doesn't work (not interactive). See sudo.
Development
.venv/bin/pip install -e ".[dev]" && .venv/bin/pytestThe tests use a fake ssh (tests/fake_ssh) that runs commands locally.
Available Tools
6 toolsejecutar_comandoADestructive
Ejecuta un comando de shell en el servidor y devuelve código de salida, stdout y stderr.
No es interactivo: comandos que piden datos (contraseñas, confirmaciones, editores) fallan o se cancelan al agotar el tiempo. Usa flags como -y o --no-pager.
Inputs: comando (required), servidor (required), timeout_segundos. Returns: result
escribir_archivoADestructive
Crea o reemplaza un archivo de texto en el servidor.
Si el archivo existe y respaldo=True, primero lo copia a .bak.. No usa sudo: solo funciona en rutas donde el usuario SSH puede escribir.
Inputs: ruta (required), servidor (required), contenido (required), respaldo. Returns: result
estado_sistemaBRead-only
Resumen de salud: uptime/carga, memoria, disco, procesos que más consumen, servicios systemd caídos y contenedores Docker.
Inputs: servidor (required). Returns: result
leer_archivoBRead-only
Lee un archivo de texto del servidor (las primeras o últimas N líneas).
Inputs: ruta (required), servidor (required), lineas, desde_el_final. Returns: result
listar_servidoresARead-only
Lista los servidores registrados y si su sesión SSH está abierta.
Inputs: no named parameters. Returns: result
ver_logsBRead-only
Últimas líneas de logs.
tipo: "servicio" (unidad systemd, ej. nginx), "docker" (nombre del contenedor), "archivo" (ruta, ej. /var/log/nginx/error.log) o "sistema" (journal completo). filtro: texto o regex para grep -iE. desde: solo para servicio/sistema/docker, ej. "1 hour ago" o "2026-10-28 08:00" (docker usa formato como "1h").
Inputs: tipo (required), servidor (required), desde, filtro, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct operation (listing servers, running commands, health summary, logs, file read, file write) and the boundaries are explained in the descriptions. There is some functional overlap, since ejecutar_comando could technically do log tailing or file reads, but the specialized tools exist as safer/easier conveniences and are clearly named.
Names follow a Spanish verb_noun pattern consistently (listar_servidores, ejecutar_comando, ver_logs, leer_archivo, escribir_archivo), with snake_case throughout. The one deviation is estado_sistema, which is a noun phrase rather than verb_noun, but it remains readable and predictable.
Six tools is a well-scoped set for remote server administration: connectivity, command execution, health overview, logs, and file read/write. No tool feels redundant or gratuitous.
The core lifecycle for operating a remote server is covered: discover servers, run commands, inspect health and logs, read and write files. The main gap is the lack of a directory-listing or file-transfer operation, so agents must guess paths or fall back to ejecutar_comando with ls/cat, which is a workable but indirect path.
Maintenance
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isolation to prevent unauthorized operations.1014 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage remote servers via SSH, including command execution, multi-host batch operations, SFTP file transfer, background job handling, DevOps diagnostics, port tunneling, and safety guardrails like high-risk command blocking and read-only mode.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to securely connect to and manage remote servers via SSH, with tools for running commands, file operations, log inspection, service management, and system monitoring under configurable access controls and audit logging.1219 npm1MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI-controlled administration of remote Linux hosts and containers, including bounded shell execution, persistent PTY sessions, durable jobs/tasks, hardened filesystem access, process/service control, and resumable transfers.-