Skip to content

Self-Host MCP Server with Node.js: Local and Server Deployment

import { Steps } from ‘@astrojs/starlight/components’;

Run the Xplorr MCP server directly with Node.js — no Docker required. This is the simplest self-hosting option for development, testing, or environments where Docker isn’t available.

  • Node.js 20+ — Check with node --version
  • npm or yarn — Comes with Node.js
  • An Xplorr API token — Get one at console.xplorr.io > Settings > API Tokens
  1. Clone the repository

    Terminal window
    git clone https://github.com/Xplorrio/xplorr-mcp-server.git
    cd xplorr-mcp-server
  2. Install dependencies

    Terminal window
    npm install
  3. Configure your API token

    Terminal window
    cp .env.example .env

    Edit .env:

    Terminal window
    XPLORR_API_TOKEN=xplorr_your_token_here
  4. Start the server

    Terminal window
    npm start

    Output:

    MCP server running on http://localhost:3005
    Mode: single-tenant
    Tools: 26
  5. Verify it’s healthy

    In another terminal:

    Terminal window
    curl http://localhost:3005/health
    {"status":"ok","service":"xplorr-mcp","tools":26,"mode":"single-tenant"}

macOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: Edit %APPDATA%\Claude\claude_desktop_config.json

{
"mcpServers": {
"xplorr": {
"url": "http://localhost:3005/mcp"
}
}
}

Restart Claude Desktop. The 26 Xplorr tools appear in Claude’s tool list.

Run with auto-reload for development:

Terminal window
npm run dev

The server restarts automatically when you edit source files. Useful if you’re modifying the MCP server or adding custom tools.

For persistent deployment on a server (without Docker), use a process manager:

Using pm2:

Terminal window
npm install -g pm2
pm2 start npm --name xplorr-mcp -- start
pm2 save
pm2 startup # auto-start on reboot

Using systemd (Linux):

Create /etc/systemd/system/xplorr-mcp.service:

[Unit]
Description=Xplorr MCP Server
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/opt/xplorr-mcp-server
EnvironmentFile=/opt/xplorr-mcp-server/.env
ExecStart=/usr/bin/node src/index.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Terminal window
sudo systemctl enable xplorr-mcp
sudo systemctl start xplorr-mcp

If you run the full Xplorr platform on your own infrastructure, override the API URL:

Terminal window
XPLORR_API_TOKEN=xplorr_your_token_here
XPLORR_API_URL=https://api.your-company.com

The MCP server appends /api/v1/... to this URL for all API calls.

VariableRequiredDefaultDescription
XPLORR_API_TOKENYesYour xplorr_ API token
XPLORR_API_URLNohttps://api.xplorr.ioOverride for on-prem backends
PORTNo3005Listen port

See the Configuration reference for details.

Error: Cannot find module

Run npm install first. If you pulled recent changes, run it again.

Port 3005 already in use

Either stop whatever is using it (lsof -i :3005) or change the port in .env:

Terminal window
PORT=3006

Update your Claude Desktop config to match.

Token exchange fails / auth errors on tool calls

  • Verify your token is valid at console.xplorr.io > Settings > API Tokens
  • Make sure the server can reach https://api.xplorr.io (or your custom XPLORR_API_URL)
  • Check for network/proxy issues: curl https://api.xplorr.io/api/v1/health

What Node.js versions are supported? Node.js 20 and above. The server uses ES modules and modern JavaScript features.

Can I run this alongside the Docker version? Yes, but use different ports. Set PORT=3006 for one of them.

How do I update to the latest version?

Terminal window
cd xplorr-mcp-server
git pull
npm install
npm start