modelscope·@aitesthaj/AWESOME_LINUX_MCP
暂无描述。
A comprehensive Model Context Protocol (MCP) server that provides AI models with secure control over remote Linux servers and browser automation capabilities.
Clone or create the project directory:
mkdir awesome-linux-mcp
cd awesome-linux-mcp
Install dependencies:
pip install -r requirements.txt
Configure environment variables:
cp config.example.env .env
# Edit .env with your SSH and configuration settings
Set up SSH access:
ssh user@host| Variable | Description | Default | Required |
|---|---|---|---|
SSH_HOST | Remote Linux server hostname/IP | localhost | Yes |
SSH_PORT | SSH port | 22 | No |
SSH_USER | SSH username | - | Yes |
SSH_KEY_PATH | Path to SSH private key | - | No* |
SSH_PASSWORD | SSH password | - | No* |
BROWSER_HEADLESS | Run browser in headless mode | true | No |
LOG_LEVEL | Logging level (DEBUG, INFO, WARNING, ERROR) | INFO | No |
*Either SSH_KEY_PATH or SSH_PASSWORD must be provided for authentication.
Generate SSH key pair (if you don't have one):
ssh-keygen -t ed25519 -C "your-email@example.com"
Copy public key to remote server:
ssh-copy-id user@remote-server
Set SSH_KEY_PATH to the path of your private key (e.g., ~/.ssh/id_ed25519)
python linux_mcp_server.py
You can test the MCP protocol directly:
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | python linux_mcp_server.py
Add the server to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"linux-server": {
"command": "python",
"args": ["/path/to/linux_mcp_server.py"],
"env": {
"SSH_HOST": "your-server.com",
"SSH_USER": "your-username",
"SSH_KEY_PATH": "/path/to/your/key",
"BROWSER_HEADLESS": "true"
}
}
}
}
execute_commandExecute a single terminal command on the remote Linux server.
await execute_command("ls -la /home")
execute_scriptExecute a bash script with optional arguments.
await execute_script("/path/to/script.sh", "--verbose")
create_bash_scriptCreate and deploy a new bash script to the remote server.
await create_bash_script("hello.sh", "echo 'Hello World'")
list_directoryList directory contents with detailed information.
await list_directory("/var/log")
get_system_infoGet comprehensive system information (CPU, memory, disk usage).
await get_system_info()
puppeteer_navigateNavigate browser to a URL.
await puppeteer_navigate("https://example.com")
puppeteer_screenshotCapture screenshot of page or element.
await puppeteer_screenshot("homepage", "", "1200", "800")
puppeteer_clickClick on a web page element.
await puppeteer_click("#submit-button")
puppeteer_hoverHover over a web page element.
await puppeteer_hover(".menu-item")
puppeteer_fillFill a form input field.
await puppeteer_fill("#username", "myusername")
puppeteer_selectSelect an option from a dropdown.
await puppeteer_select("#country", "US")
puppeteer_evaluateExecute JavaScript in browser context.
await puppeteer_evaluate("document.title")
puppeteer_get_console_logsGet browser console logs.
await puppeteer_get_console_logs()
puppeteer_get_screenshotGet current browser screenshot.
await puppeteer_get_screenshot()
puppeteer_get_network_detailsGet network request details.
await puppeteer_get_network_details()
console://logsAccess browser console output.
# Access via MCP resource API
screenshot://currentGet current browser screenshot as base64.
# Access via MCP resource API
network://detailsGet network request/response data as JSON.
# Access via MCP resource API