Claude MCP Linux Server Connection: SSH Setup

Even when you hand Linux server work to Claude, your SSH key file never leaves your PC. Claude MCP Linux server connection links Claude to your Linux server's terminal and files over SSH. This guide covers what travels and what doesn't, then walks through the setup steps.
Claude MCP(Model Context Protocol) is the standard Claude uses to connect to external tools and data, and an MCP serveris a program that provides features according to that standard. The concept and Claude Desktop connector setup are covered in the Claude MCP basics article.
Ⅰ. What Is a Claude MCP Linux Server?
When you attach MCP to Claude Desktop, Claude reads files on your PC and runs tasks. A Claude MCP Linux server connection moves that target to a remote Linux server over SSH: commands run on the server, and only the results come back to Claude.
Nothing new needs to be opened on the server. You use the same SSH and key as always; the only change is that Claude, not a person, types the commands. What Claude can run and see is set by the permissions of the login account.
Ⅱ. Claude MCP Linux Setup
Setup takes four steps, from an SSH connection test to checking connection errors. You need ⓐ the Claude Desktop app, ⓑ server access details (host address, account, port) and a key file (.pem), and ⓒ Node.js to run the MCP server package on your PC.
You can view steps 1️⃣–4️⃣ all at once in the simulator or check them in the table of contents.
"ssh-mcp-server": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@fangjunjie/ssh-mcp-server",
"--host",
"your-server-IP",
"--port",
"22",
"--username",
"root",
"--privateKey",
"C:\\path-to-key\\mykey.pem"
]
}
1️⃣ SSH Connection Test
To register the server in Claude, test the SSH connection from your PC and prepare what you need.
~]# 2️⃣ Register the SSH MCP Server
SSH MCP Server can only be registered in the app, not on the web. Launch the Claude app and go to [Settings › Developer].

Click [Edit Config].

The folder containing claude_desktop_config.json opens.

Open the file in a text editor such as Notepad or EditPlus and check its contents.

On line 47 in the image, type a comma after [}] (,) and paste the entry.
The entry to paste is below. Replace [--host] with the server address, [--port] with the SSH port (default 22), [--username] with the login account, and [--privateKey] with the full path of the key file (.pem).
"ssh-mcp-server": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@fangjunjie/ssh-mcp-server",
"--host",
"your-server-IP",
"--port",
"22",
"--username",
"root",
"--privateKey",
"C:\\path-to-key\\mykey.pem"
]
}On Windows, set commandto cmd instead of npx and put /c as the first item in args. On macOS or Linux, put npx directly in command and leave out /c.
If the file has no mcpServers entry, there is nowhere to paste. In that case, make the whole file look like this.
{
"mcpServers": {
"ssh-mcp-server": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@fangjunjie/ssh-mcp-server",
"--host",
"your-server-IP",
"--port",
"22",
"--username",
"root",
"--privateKey",
"C:\\path-to-key\\mykey.pem"
]
}
}
}
When you're done, press Ctrl + S to save.
3️⃣ Tool Permissions and First Run
Restart the Claude app.If nothing changes on screen, force-quit it in Task Manager and launch it again; if an error appears, see step 4️⃣.

I asked Claude to run the hostname command as a simple test.


4️⃣ Connection Error: Node.js Not Installed

Checking with [View logs] showed the error occurred because the Node.js folder (C:\Program Files\nodejs) was not installed.
To install Node.js, open https://nodejs.org/ko/downloadin your browser.

Download the Windows .msi file and install it.




Leave it unchecked and click Next. It asks whether to install C/C++ compile tools as well; the SSH MCP package doesn't need them, and checking it also installs Chocolatey and Visual Studio build tools.
Quit Claude completely, including the background process, and launch it again.

Checking the log again, the message had changed to "not connected".

Enter troubleshooting commands in a CMD window to find the cause.
From this point on, Claude itself can help you solve it, so I recommend checking the error directly and fixing it with Claude's help.
Ⅲ. FAQ





ℹ️ Affiliate Disclosure
This site's content contains affiliate links. When a visitor buys a product or service through one of them, the site receives a commission from the seller. The amount the buyer pays(it goes down during event discounts ↓)does not go up. Posted prices, discounts, and stock reflect the time of writing and may differ, so confirm with the seller before buying. Products are chosen and reviewed by our own standards, and commissions do not affect the order or content of reviews.
