
python mcp remote ssh
一个通过SSH访问远程文件系统的MCP服务器实现,支持文件读写、目录操作和命令执行。
Repository Info
About This Server
一个通过SSH访问远程文件系统的MCP服务器实现,支持文件读写、目录操作和命令执行。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Remote SSH MCP Server
An implementation of an MCP (Message Control Protocol) server that accesses a remote file system through SSH. This project provides functionality to connect to remote servers via SSH and manage their file systems.
Features
- Remote file system access via SSH
- Remote file reading/writing
- Remote directory listing
- File searching
- Remote command execution
- MCP protocol support
Requirements
- Python 3.7+
- paramiko library
- mcp package
Installation
Install the required libraries:
pip install paramiko mcp
Usage
Running from the Command Line
python main.py --hostname example.com --port 22 --username user --password pass --base-path /home/user
Using a Configuration File
- Create an SSH configuration file (e.g.,
ssh_config.json):
{
"hostname": "example.com",
"port": 22,
"username": "your_username",
"password": "your_password",
"base_path": "/home/your_username"
}
- Run using the configuration file:
python main.py --config ssh_config.json
MCP Configuration File
To integrate the MCP server with other MCP clients, you can use a configuration file in the following format:
{
"mcpServers": {
"remote-ssh-file-server": {
"command": "python",
"args": ["main.py", "--config", "ssh_config.json"],
"cwd": "/path/to/py-mcp-ssh"
}
}
}
Command Line Options
| Option | Description |
|---|---|
--config | Path to SSH configuration JSON file |
--hostname | SSH server hostname |
--port | SSH server port (default: 22) |
--username | SSH username |
--password | SSH password |
--key-file | Path to SSH key file |
--base-path | Base working directory (default: /) |
MCP API List
| API Name | Description |
|---|---|
remote_read_file | Read a remote file |
remote_write_file | Write to a remote file |
remote_list_directory | List the contents of a remote directory |
remote_search_files | Search for files on the remote server |
remote_execute_command | Execute a command on the remote server |
Security Considerations
- Using key file authentication instead of password is better for security.
- Avoid storing passwords as plaintext in configuration files.
- Restrict
base_pathto a specific user directory instead of root (/) to enhance security.
Quick Start
Clone the repository
git clone https://github.com/11im/python-mcp-remote-sshInstall dependencies
cd python-mcp-remote-ssh
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.