Enables secure file transfer operations to Linux systems via SCP/SFTP, including uploading, downloading, and managing files and directories remotely
MCP SCP Server
MCP SCP Server is a local Model Context Protocol (MCP) server that exposes secure file transfer capabilities for Linux and Windows systems, enabling LLMs and other MCP clients to upload, download, and manage files via SCP/SFTP protocols.
Table of Contents
Features
- MCP-compliant server exposing SCP/SFTP file transfer capabilities
- Upload and download files to/from remote Linux and Windows systems
- Secure authentication via password or SSH key
- Built with TypeScript and the official MCP SDK
- Progress tracking for large file transfers
- Path validation and security features to prevent directory traversal
- File size limits and transfer timeout protection
- Comprehensive error handling with detailed feedback
- Cross-platform compatibility (Linux/Windows targets)
- CLI mode for direct usage and MCP server mode for AI assistants
Tools
scp_upload
: Upload a local file to remote serverscp_download
: Download a file from remote server to local systemscp_list
: List files and directories on remote serverscp_mkdir
: Create directories on remote serverscp_remove
: Remove files/directories on remote server
Installation
Prerequisites
- Node.js 18+ and npm
- SSH server access (Linux or Windows)
- Valid SSH credentials (password or SSH key)
- MCP-compatible AI client (Claude Desktop, Roo Code, etc.)
Install from npm
Build from Source
Configuration
Environment Variables Setup
Set up your SSH connection details as environment variables:
For SSH key authentication (recommended):
MCP Client Configuration
Claude Desktop
Add to your Claude Desktop configuration file:
macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Usage
CLI Mode
Test your configuration and perform file operations directly:
MCP Server Mode
When configured with an MCP client, the server exposes file transfer tools that AI assistants can use to:
- Upload configuration files, scripts, or data to remote servers
- Download logs, reports, or files for analysis
- Manage remote file systems (create directories, remove files)
- Transfer files as part of automated workflows
Tools
scp_upload
Upload a local file to a remote server.
Parameters:
localPath
(required): Path to the local file to uploadremotePath
(required): Destination path on the remote servercreateDirs
(optional): Create parent directories if they don't exist
scp_download
Download a file from a remote server to the local system.
Parameters:
remotePath
(required): Path to the file on the remote serverlocalPath
(required): Local destination path for the downloaded file
scp_list
List files and directories on the remote server.
Parameters:
remotePath
(required): Remote directory path to listdetailed
(optional): Show detailed file information (size, permissions, etc.)
scp_mkdir
Create directories on the remote server.
Parameters:
remotePath
(required): Path of the directory to createrecursive
(optional): Create parent directories if they don't exist
scp_remove
Remove files or directories on the remote server.
Parameters:
remotePath
(required): Path to the file or directory to removerecursive
(optional): Remove directories and their contents recursively
Security
Authentication
- SSH key authentication (recommended): Uses private key files for secure authentication
- Password authentication: Supports password-based authentication (less secure)
- Connection validation: Verifies SSH connection before file operations
Built-in Security Features
The SCP MCP server includes several security features:
Path Validation:
- Prevents directory traversal attacks (
../
patterns) - Validates file paths before operations
- Restricts access to authorized directories only
File Size Protection:
- Configurable file size limits for uploads/downloads
- Progress tracking with timeout protection
- Automatic cleanup of failed transfers
Transfer Security:
- Secure file permissions preservation
- Encrypted data transfer via SSH
- Automatic cleanup of temporary files
Development
Building
Testing
Linting
Troubleshooting
Common Issues
- Connection refused: Verify SSH server is running and accessible
- Authentication failed: Check SSH credentials and key permissions
- Permission denied: Ensure SSH user has appropriate file system permissions
- Transfer timeout: Increase timeout for large files or slow connections
Debug Mode
Enable detailed logging by setting the environment variable:
Contributing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
Support
If you find MCP SCP Server helpful, consider starring the repository or contributing! Pull requests and feedback are welcome.
Attribution
This project builds upon the architecture and patterns established by the mcp-ssh project, focusing specifically on secure file transfer capabilities.
Disclaimer
MCP SCP Server is provided under the MIT License. Use at your own risk. This project is not affiliated with or endorsed by any SSH or MCP provider.
License
MIT License - see the LICENSE file for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables secure file transfer operations with remote Linux and Windows systems via SCP/SFTP protocols. Supports uploading, downloading, listing, and managing files on remote servers through SSH authentication.