dciangot/remote_claude_mcp
If you are the rightful owner of remote_claude_mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Remote Claude MCP Server is a Go-based server that enables Claude Desktop to utilize Claude Code on a remote server via SSH.
Remote Claude MCP Server
A Model Context Protocol (MCP) server written in Go that allows Claude Desktop to use Claude Code on a remote server via SSH.
Features
- SSH Connection: Securely connect to remote servers using SSH key authentication
- Claude Code Proxy: Proxies Claude Code tools (bash, read, write, edit, glob, grep, webfetch) to remote server
- Sandbox Support: Supports sandboxed command execution for security
- Configuration: Supports both JSON config files and command line arguments
- Tool Compatibility: Provides the same tools as local Claude Code but executed remotely
Installation
-
Ensure you have Go 1.23 or later installed
-
Clone this repository:
git clone <repository-url> cd remote-claude-mcp
-
Install dependencies:
go mod tidy
-
Build the server:
go build -o remote-claude-mcp
Configuration
Option 1: Config File (Recommended)
Create a configuration file based on config.example.json
:
{
"ssh": {
"host": "your-remote-server.com",
"user": "your-username",
"key_path": "/path/to/your/private/ssh/key",
"port": 22
},
"remote": {
"working_dir": "/home/your-username/claude-workspace",
"claude_code_path": "claude"
},
"server": {
"name": "remote-claude-mcp",
"version": "0.1.0"
}
}
Option 2: Command Line Arguments
./remote-claude-mcp <ssh-host> <ssh-user> <ssh-key-path> <remote-working-dir> [ssh-port]
Usage
Running the MCP Server
With config file:
./remote-claude-mcp config.json
With command line arguments:
./remote-claude-mcp remote-server.com username ~/.ssh/id_rsa /home/username/workspace 22
Integrating with Claude Desktop
Add the following to your Claude Desktop MCP settings:
{
"mcpServers": {
"remote-claude": {
"command": "/path/to/remote-claude-mcp",
"args": ["/path/to/your/config.json"]
}
}
}
Available Tools
The server provides the following tools that mirror Claude Code functionality:
- bash: Execute bash commands on the remote server
- Supports
sandbox
mode for secure execution - Supports
timeout
parameter
- Supports
- read: Read files from the remote server
- Supports
offset
andlimit
for large files
- Supports
- write: Write files to the remote server
- edit: Edit files using string replacement
- Supports
replace_all
option
- Supports
- glob: Find files matching patterns
- grep: Search for text in files
- Supports case insensitive search (
-i
) - Supports line numbers (
-n
)
- Supports case insensitive search (
- webfetch: Fetch web content via the remote server
Security Considerations
- SSH Keys: Use SSH key authentication instead of passwords
- Working Directory: The server operates within the specified working directory
- Sandbox Mode: Use sandbox mode for bash commands when possible
- File Permissions: Ensure proper file permissions on the remote server
- Network Security: Consider using VPN or SSH tunneling for additional security
Prerequisites
Remote Server Setup
- SSH Access: Ensure SSH key-based authentication is configured
- Working Directory: Create and set permissions for the working directory
- Claude Code (Optional): Install Claude Code on the remote server for enhanced functionality
- Basic Tools: Ensure
bash
,cat
,grep
,find
,curl
are available
Claude Desktop Setup
- Install Claude Desktop
- Configure MCP servers in Claude Desktop settings
- Add this server to your MCP configuration
Troubleshooting
Connection Issues
- Verify SSH key permissions (
chmod 600 ~/.ssh/id_rsa
) - Test SSH connection manually:
ssh -i ~/.ssh/id_rsa user@host
- Check firewall and network connectivity
Tool Execution Issues
- Verify working directory exists and is writable
- Check that required tools (
bash
,cat
, etc.) are in PATH on remote server - Review server logs for error messages
Claude Desktop Integration
- Verify MCP configuration syntax in Claude Desktop settings
- Check Claude Desktop logs for connection errors
- Ensure the server binary path is correct and executable
Development
Building from Source
go mod tidy
go build -o remote-claude-mcp
Running Tests
go test ./...
License
This project is licensed under the MIT License.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues and questions:
- Check the troubleshooting section
- Review existing GitHub issues
- Create a new issue with detailed information