Connecting an On-Prem MCP Server to Claude Desktop
Connecting an On-Prem MCP Server to Claude Desktop — What Works When the Obvious Options Don't
I built an MCP server that exposes product data and lets users interact with it the same way they would through the UI — just through natural conversation with an AI agent instead.
The idea is simple. The setup, less so.
The server runs on-premises — not exposed to the internet. And getting Claude Desktop to talk to it for end users who aren't developers turned out to be more interesting than I expected.
Here's what I tried, what didn't work, and what finally did.
The Goal
Once connected, a user can open Claude Desktop and interact with the product naturally — asking questions, retrieving data, performing actions — without navigating the UI. The AI agent handles the interaction through the MCP server.
Getting there required working around a constraint most MCP guides don't address — what happens when your server isn't on the internet?
What Didn't Work
Copilot Studio
The first option I explored was creating an agent through Copilot Studio and connecting it to the MCP server. Straightforward in theory.
The problem — Copilot Studio doesn't support MCP servers that aren't exposed to the internet. On-prem server, no public URL, no connection. Dead end.
Claude Desktop Connectors
Claude Desktop has a Connectors option under Customize. You can enter your own MCP server link there. Clean, user-friendly, exactly what I needed.
Same problem. It requires the MCP server to be accessible via internet. On-prem server doesn't qualify. Another dead end.
What Works — claude_desktop_config.json
The solution is in Claude Desktop's developer settings — less visible than the Connectors UI, but fully functional for on-prem setups.
Before You Start — Prerequisites
Two things must be in place on your system before configuring Claude Desktop:
-
Node.js — download and install the LTS version from nodejs.org. Open a new terminal after installing and verify:
node -v
Expected output: a version number such asv22.x.x. If it returns an error, close all terminal windows and open a new one — the PATH update only applies to new sessions. -
mcp-remote — Claude Desktop connects to the MCP server through
mcp-remote, a Node.js proxy. Install it globally:npm install -g mcp-remote
Then verify and note the path — you will need it in the config step:where mcp-remote
Expected output: a path likeC:\Users\YourName\AppData\Roaming\npm\mcp-remote.cmd
Setup Steps
- Open Claude Desktop and navigate to Settings > Developer.
- Click Edit Config — this opens
claude_desktop_config.jsonin your default text editor using the correct path regardless of how Claude Desktop was installed. -
Paste the following JSON, replacing the three placeholders with your actual values:
{ "mcpServers": { "Your-MCP-Server": { "command": "C:\\Users\\YourName\\AppData\\Roaming\\npm\\mcp-remote.cmd", "args": [ "https://YOUR-SERVER-HOSTNAME:PORT/mcp", "--header", "X-API-Key: YOUR-API-KEY" ], "env": { "NODE_TLS_REJECT_UNAUTHORIZED": "0" } } } }Placeholder Replace with YourNameYour Windows username (from the path shown by where mcp-remote)YOUR-SERVER-HOSTNAMEYour server's hostname or IP address YOUR-API-KEYThe API key configured on the server If the file already has other content, merge only the
mcpServerssection into the existing JSON — do not replace the entire file.The
NODE_TLS_REJECT_UNAUTHORIZED: "0"entry in theenvblock tells Node.js to accept self-signed TLS certificates. On-prem servers typically use self-signed certificates that are not trusted by default, so this setting is required for the connection to succeed. Remove it only if your server uses a certificate issued by a trusted certificate authority. - Press Ctrl+S, close the editor, and fully quit Claude Desktop — right-click the tray icon and select Quit.
- Reopen Claude Desktop from the Start menu or desktop shortcut.
Verifying the Connection
Once Claude Desktop restarts, it should connect to the MCP server automatically.
Go to Settings > Developer. The Your-MCP-Server entry should show as running. If it shows as failed, see the troubleshooting section below.
To test the connection, open a new Claude chat and ask something the MCP server is expected to handle. Claude should call the server and return a response.
If the tools don't appear, restart Claude Desktop once more before troubleshooting further. The MCP server registration only applies to conversations started after the restart — make sure you are in a new conversation.
When Things Don't Work
From my testing, these are the most common failure points. The first place to look is always Settings > Developer > View Logs in Claude Desktop — the error message there will point you to the cause.
Server status shows failed
- Wrong hostname or port in the
argsfield — double-check the server address and port. - Incorrect API key — edit
claude_desktop_config.jsonand correct the key. - Wrong mcp-remote path — run
where mcp-remoteand update thecommandfield to match.
where mcp-remote returns nothing after install
Re-run the install and check where npm puts global packages:
npm install -g mcp-remote npm prefix -g
The mcp-remote.cmd file is in the folder printed by npm prefix -g. Use that full path in the command field.
Server not found / connection timeout
Confirm the server is reachable from the workstation:
ping YOUR-SERVER-HOSTNAME curl -k https://YOUR-SERVER-HOSTNAME:PORT/health
Note: the curl command only works if your MCP server exposes a /health endpoint. If it doesn't, skip that line and rely on the ping to confirm basic network reachability. Check the server's API documentation or source to see if a health endpoint is exposed.
If the server is unreachable, the MCP server on the on-prem machine may not be running. Verify the server-side process is up and accepting connections.
401 Unauthorized in the logs
The API key does not match any entry in the server's configuration. Verify the key is correctly configured on the server side.
Server is running but Claude shows no tools
The MCP server registration only applies to conversations started after restarting Claude Desktop. Make sure you are chatting in a new conversation, not an existing one that was open before the restart.
What This Unlocks
Once connected, the user doesn't need to navigate the product UI for routine interactions. They open Claude Desktop, ask what they need, and the agent handles it through the MCP server.
The same product data, the same actions — just through conversation instead of clicks.
For users who spend significant time in the product, this changes how they interact with it entirely.
What's Next
This covers the connection setup. In the next post I'll share something I discovered while building this — how AI agents actually read your MCP server's documentation, and why it changes how you should write code comments going forward.
Comments
Post a Comment