#How do i get openclaw to connect to my custom mcp?

1 messages · Page 1 of 1 (latest)

thorny basalt
#

I am hosting it on hostinger, and i don't know how to add skills of my custom mcp.

I have the url, the published npm package, exactly what to drop into the mcp config file but i literally dont know where to find the config file. Any guidance?

ionic oliveBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

molten flareBOT
#

Your OpenClaw “main config file” is not an MCP config — it’s the OpenClaw JSON5 config.

1) Where the OpenClaw config lives

On the machine running the Gateway (your Hostinger VPS), OpenClaw reads:

  • $OPENCLAW_CONFIG_PATH
  • default: ~/.openclaw/openclaw.json (JSON5)

Docs: https://docs.openclaw.ai/help/faq#what-format-is-the-config-where-is-it

If you’re unsure which machine/config your daemon is using, run on the VPS and paste back:

openclaw --version
openclaw gateway status
openclaw status --all

(status --all usually makes it obvious what config path the service is using.)

#

2) “Adding skills” (how OpenClaw thinks about this)

OpenClaw skills are skill folders (SKILL.md) loaded from:

  • bundled skills (ship with OpenClaw)
  • ~/.openclaw/skills
  • <workspace>/skills
  • plus optional extra dirs via skills.load.extraDirs

Docs:

3) About “MCP config files” specifically

OpenClaw itself doesn’t use the “Claude Desktop style” MCP config file.

If what you actually want is: “my agent can call my MCP server’s tools”, the current easiest path in OpenClaw is to use the bundled mcporter skill (it’s literally an MCP client/manager CLI):

  • Skill: mcporter (MCP client CLI)
#
  • Its own config default is: ./config/mcporter.json (relative to where you run it), or you can pass --config <path> to make it live somewhere stable.

Once mcporter is installed + configured with your server URL, the agent can invoke tools via mcporter call ....

Quick question so I can point you to the exact steps

Is your MCP server:

  1. HTTP/SSE (you have a URL like https://…/mcp), or
  2. stdio (you run an npm package command like npx … / node … and it speaks MCP over stdin/stdout)?

If you paste the exact snippet you were told to put into the “mcp config”, I can translate it into either:

  • the right OpenClaw setup (skills + where to put the files), or
  • a mcporter config/add command.
thorny basalt
molten flareBOT
#

Yep — that JSON you pasted is basically already a valid mcporter server entry. mcporter uses the same top-level shape (mcpServers) and just infers transport:

  • command + args (+ env) ⇒ stdio
  • baseUrl/url (+ headers) ⇒ HTTP/SSE

1) Put that into mcporter’s config (on the Gateway host)

Create ~/.mcporter/mcporter.json on your Hostinger box:

{
  "mcpServers": {
    "XXXXX": {
      "command": "npx",
      "args": ["-y", "XXXXX-mcp"],
      "env": {
        "XXXXX_API_KEY": "${XXXXX_API_KEY}"
#
      }
    }
  }
}

Important: don’t hardcode the key in the file if you can avoid it — use ${XXXXX_API_KEY} like above, and set the env var.

Then sanity check outside OpenClaw first:

XXXXX_API_KEY="..." npx mcporter list XXXXX --schema
# then call one tool once you see the tool names
XXXXX_API_KEY="..." npx mcporter call XXXXX.some_tool foo=bar
#

2) (Optional) If you want to use your hosted SSE URL instead

Add another entry like:

{
  "mcpServers": {
    "XXXXX-sse": {
      "baseUrl": "https://your-domain.example/mcp",
      "headers": { "Authorization": "Bearer ${XXXXX_API_KEY}" }
    }
  }
}

3) Make OpenClaw able to run mcporter

OpenClaw’s own config file is ~/.openclaw/openclaw.json (JSON5). Docs: https://docs.openclaw.ai/help/faq#what-format-is-the-config-where-is-it

#

The mcporter OpenClaw skill is only “eligible” if the mcporter binary is on PATH for the Gateway. Quick check:

openclaw skills list --eligible | grep mcporter

If it’s missing, install it on the same machine/user running the gateway (one of these):

npm i -g mcporter
# or
pnpm add -g mcporter

If you tell me your hosted SSE URL and whether it needs headers vs query params, I can suggest the cleanest baseUrl/headers entry for it.

thorny basalt
#
  1. how do i get the mcporter installed and where do i find the mcporter’s config (on the Gateway host) (do i need to ssh into it)
molten flareBOT
#

Yes — you’ll need shell access to the Gateway host (your Hostinger VPS) to install mcporter and to create its config file. That usually means SSH (Hostinger sometimes also has a “web terminal”, which is effectively the same thing).

1) Install mcporter (on the VPS)

First SSH in as the same user that runs your OpenClaw gateway service.

Then:

node -v   # should be >= 22
npm -v

Install mcporter globally:

npm i -g mcporter
#
# (or: pnpm add -g mcporter)

Verify it’s on PATH:

which mcporter
mcporter --version

And confirm OpenClaw now sees the skill as eligible:

openclaw skills list --eligible | grep mcporter
#

2) Where mcporter config lives (default)

The simplest place is the home config on the VPS:

  • ~/.mcporter/mcporter.json (or .jsonc)

Create/edit it:

mkdir -p ~/.mcporter
nano ~/.mcporter/mcporter.json

(You can also use a “project config” at ./config/mcporter.json if you’re inside a repo folder, but for a VPS service I’d stick to ~/.mcporter/mcporter.json.)

3) Where to put your API key (important for daemons)

Don’t paste secrets into Discord.

#

Because OpenClaw usually runs as a daemon/service, it often won’t inherit your interactive shell env vars. Easiest fix: put your key in:

  • ~/.openclaw/.env on the VPS

Example:

nano ~/.openclaw/.env
# add:
XXXXX_API_KEY=...

Then restart the gateway:

openclaw gateway restart