Ubuntu SSH MCP Server

Ubuntu SSH MCP Server

Connects to Ubuntu servers over SSH to manage, maintain, and secure them through natural language conversation.

Category
访问服务器

README

Ubuntu SSH MCP Server

An MCP server that lets Claude Code connect to Ubuntu servers over SSH to manage, maintain, and secure them — all from a natural language conversation.


Features

Category Tools
Connection Connect/disconnect servers, list active sessions
Commands Run shell commands, sudo commands
System Info OS/CPU/RAM/disk overview, process list, disk usage
Packages apt update, upgrade, install, remove
Services Start/stop/restart/enable systemd services
Logs journalctl, tail log files
Files Read, write, list remote files
Security Audit Open ports, SUID files, sudo rights, failed logins
Firewall (UFW) Status, add/delete rules, enable/disable
SSH Hardening Disable root login, password auth, MaxAuthTries
Users List, create, delete users; add SSH public keys
Fail2ban Jail status, unban IPs
Cron List cron jobs
Network Interface info, routing, ping

Requirements

  • Node.js 18+
  • Claude Code (npm install -g @anthropic-ai/claude-code)

Installation

# 1. Clone / copy this folder somewhere permanent
cd ~/ubuntu-ssh-mcp
npm install

# 2. Register with Claude Code (global scope — available in all projects)
claude mcp add ubuntu-ssh-mcp -- node /ABSOLUTE/PATH/TO/ubuntu-ssh-mcp/index.js

# Verify it's registered
claude mcp list

Alternative: Project-level config

Create or edit .mcp.json in your project root:

{
  "mcpServers": {
    "ubuntu-ssh-mcp": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/ubuntu-ssh-mcp/index.js"]
    }
  }
}

Usage Examples

Once Claude Code is running with the MCP server connected, just talk to it:

> Connect to my server at 192.168.1.10 as ubuntu using my key at ~/.ssh/id_rsa, call it "prod"

> Show me the system info for prod

> Check what security updates are available on prod

> Run a full security audit on prod

> Harden the SSH config on prod — make sure I have key auth working first

> Enable UFW on prod and allow only ports 22, 80, and 443

> Show the last 100 lines of the nginx error log on prod

> List all users on prod and check if any have unexpected sudo access

> Install fail2ban on prod and check the sshd jail status

Security Notes

  • Use SSH key auth — avoid passing passwords where possible.
  • sudo_password is passed as a parameter; Claude Code stores no secrets. Use NOPASSWD sudoers for a CI/automation account if you prefer not to pass passwords.
  • harden_ssh will restart sshd — ensure key-based auth is working before calling it or you may lock yourself out.
  • Connections persist for the life of the Claude Code session and are cleaned up on exit.
  • The server runs locally via stdio — no network ports are opened by the MCP server itself.

Tool Reference

Connection

Tool Description
ssh_connect Connect to a server
ssh_disconnect Disconnect from a server
ssh_list_connections List active connections

Execution

Tool Description
ssh_exec Run a shell command
ssh_sudo Run a command with sudo

System

Tool Description
system_info OS, CPU, RAM, disk, uptime
list_processes Top processes by CPU/mem
check_disk_usage Disk usage breakdown
network_info Interfaces, routing, connections
ping_from_server Ping a host from the server

Packages

Tool Description
apt_update Update package index
apt_upgrade Upgrade all packages
apt_install Install packages
apt_remove Remove packages

Services

Tool Description
service_status Check service status
service_control Start/stop/restart/enable/disable
list_services List all/running/failed services

Logs

Tool Description
view_logs journalctl for service or system
tail_log_file Last N lines of any log file

Files

Tool Description
read_file Read a remote file
write_file Write a remote file
list_directory List directory contents

Security

Tool Description
security_audit Full security audit
check_updates_security Security-only apt updates
harden_ssh Apply SSH hardening
ufw_status UFW firewall status
ufw_rule Add/delete UFW rules
ufw_enable_disable Enable/disable UFW
fail2ban_status Fail2ban jail status
fail2ban_unban Unban an IP

Users

Tool Description
user_list List system users
user_create Create a user
user_delete Delete a user
add_authorized_key Add SSH public key
cron_list List cron jobs

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选