MCP Remote Server
Enables management of Google Cloud Compute Engine (GCE) instances, including starting and stopping VM instances across different projects and zones.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Remote Servercheck disk usage on my remote server"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Remote Server
A Model Context Protocol (MCP) server that enables Cursor IDE to execute SSH commands on remote servers and manage Google Cloud Platform (GCE) instances. This server provides a seamless integration between Cursor and your remote infrastructure.
Features
π SSH Command Execution: Run commands on remote servers via SSH
βοΈ GCE Instance Management: Start and stop Google Cloud Compute Engine instances
π Connection Pooling: Reuses SSH connections for improved performance
π SSH Config Integration: Uses your existing
~/.ssh/configfor host configurationπ MCP Protocol: Full support for Model Context Protocol v2025-06-18
Prerequisites
Node.js 16+ installed
SSH access configured to your remote server
Google Cloud Platform credentials (for GCE features)
Cursor IDE installed
Installation
Clone or navigate to the repository:
cd mcp-remoteInstall dependencies:
npm installStart the MCP server:
node src/index.jsThe server will start on
http://localhost:3000by default.
Configuration
1. SSH Configuration
First, you need to configure your SSH connection in ~/.ssh/config. The server always uses the host alias dev regardless of what you specify in prompts.
Create or edit ~/.ssh/config:
Host dev
HostName your-server.example.com
User your-username
Port 22
IdentityFile ~/.ssh/id_rsa
# Optional: Add additional SSH options
# ServerAliveInterval 60
# ServerAliveCountMax 3
# StrictHostKeyChecking no
# UserKnownHostsFile ~/.ssh/known_hostsExample with AWS EC2:
Host dev
HostName ec2-12-34-56-78.compute-1.amazonaws.com
User ubuntu
Port 22
IdentityFile ~/.ssh/my-aws-key.pemExample with Google Cloud:
Host dev
HostName 34.123.45.67
User root
Port 22
IdentityFile ~/.ssh/gcp-key.pemImportant Notes:
The host alias must be named
dev(all lowercase)The server will always connect to
devregardless of the host you specify in promptsMake sure your SSH key has proper permissions:
chmod 600 ~/.ssh/id_rsa
2. Cursor MCP Configuration
Configure Cursor to connect to the MCP server by editing ~/.cursor/mcp.json:
{
"mcpServers": {
"local-mcp": {
"name": "Local MCP",
"url": "http://localhost:3000",
"description": "Runs SSH commands and manages GCE instances",
"apiKeyHeader": "x-api-key",
"apiKeyValue": "8BOe6KshR5Eq0otTSjSGMEf5P1edKcq"
}
}
}Configuration Fields:
name: Display name for the MCP server in Cursorurl: The URL where your MCP server is running (default:http://localhost:3000)description: Description of what the server doesapiKeyHeader: Header name for API authentication (currently optional)apiKeyValue: API key value for authentication (currently optional)
After modifying mcp.json:
Save the file
Restart Cursor IDE
The MCP server should appear in Cursor's tool list
3. Environment Variables (Optional)
You can set environment variables to customize behavior:
# SSH Configuration (optional - defaults to ~/.ssh/id_rsa)
export SSH_USERNAME=your-username
export SSH_PRIVATE_KEY_PATH=~/.ssh/custom_key
# Server Configuration
export PORT=3000
# GCP Configuration (for GCE features)
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/gcp-credentials.jsonUsage
Starting the Server
# Start the server
node src/index.js
# Or with custom port
PORT=8080 node src/index.jsThe server will output:
MCP server running on http://localhost:3000
Ready to accept MCP connections from CursorUsing in Cursor IDE
Once configured, you can use the MCP tools directly in Cursor:
Run SSH Commands:
Ask Cursor: "Check disk usage on server1.example.com"
The server will automatically connect to
devand execute the commandExample: "Run
df -hon my remote server"
Manage GCE Instances:
Ask Cursor: "Start instance my-vm in project my-project, zone us-central1-a"
Ask Cursor: "Stop instance my-vm in project my-project, zone us-central1-a"
Available Tools
run_command
Execute SSH commands on the remote server
Always connects to
devfrom~/.ssh/configParameters:
host: Ignored (always usesdev)cmdKey: The command to execute (e.g.,df -h,ls -la)
start_instance
Start a GCE instance
Parameters:
project: GCP project IDzone: GCE zone (e.g.,us-central1-a)instance: Instance name
stop_instance
Stop a GCE instance
Parameters:
project: GCP project IDzone: GCE zoneinstance: Instance name
Architecture
Connection Pooling
The server maintains a pool of SSH connections to improve performance:
Connections are reused across multiple commands
Connections are kept alive with keepalive settings
Automatic cleanup on connection errors
SSH Config Integration
The server reads connection details from ~/.ssh/config:
Hostname, port, username, and identity file
Supports all standard SSH config options
Handles
~expansion in file pathsSupports multiple IdentityFile entries (uses the first one)
Troubleshooting
Server Won't Start
Check if port is already in use:
lsof -i :3000Check Node.js version:
node --version # Should be 16+
Cursor Can't Connect
Verify server is running:
curl http://localhost:3000Check
~/.cursor/mcp.jsonsyntax:Ensure valid JSON
Verify the URL matches your server
Restart Cursor IDE after modifying
mcp.json
SSH Connection Issues
Test SSH connection manually:
ssh devVerify SSH config:
ssh -F ~/.ssh/config devCheck SSH key permissions:
ls -la ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsaVerify the host alias exists:
grep -A 5 "^Host dev" ~/.ssh/config
Commands Not Executing
Check server logs for error messages
Verify the
devhost is properly configured in~/.ssh/configCheck SSH key has access to the remote server
Development
Project Structure
mcp-remote/
βββ src/
β βββ index.js # Main MCP server
β βββ ssh.js # SSH connection handling
β βββ gcp.js # GCP instance management
βββ package.json
βββ README.md
βββ .gitignoreAdding New Tools
To add new MCP tools:
Add tool definition to the
toolsarray insrc/index.jsAdd handler in the
tools/callcaseImplement the functionality in the appropriate module
Testing
# Test SSH connection
node -e "const {runRemoteCommand} = require('./src/ssh'); runRemoteCommand({host: 'dev', command: 'echo test'}).then(r => console.log(r));"
# Test MCP server
curl -X POST http://localhost:3000 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-06-18"},"id":1}'Security Considerations
The server runs on
localhost:3000by default (not exposed to network)SSH credentials are read from
~/.ssh/config(standard SSH security)API key authentication is available but currently optional
Consider using environment variables for sensitive data
License
[Add your license here]
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions:
Check the Troubleshooting section
Review server logs for error messages
Ensure SSH configuration is correct
Note: The server always connects to the dev host alias from your SSH config, regardless of the host you specify in prompts. Make sure dev is properly configured in ~/.ssh/config.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rpavez/ssh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server