#How do i get openclaw to connect to my custom mcp?
1 messages · Page 1 of 1 (latest)
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:
- Skills overview: https://docs.openclaw.ai/tools/skills
- Skills config: https://docs.openclaw.ai/tools/skills-config
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:
- HTTP/SSE (you have a URL like
https://…/mcp), or - 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
mcporterconfig/add command.
- It is SSE
- stdio: yes i run a npm package i installed npx
I think i understand it now, i need to use mcporter as kind of the middleman.
here is what i put inside the Claude Ai Agent:
{
"mcpServers": {
"XXXXX": {
"command": "npx",
"args": [
"-y",
"XXXXX-mcp"
],
"env": {
"XXXXX_API_KEY": "XXXXXXX"
}
}
}
}
thanks for ur help so far btw
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) ⇒ stdiobaseUrl/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.
- 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)
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/.envon the VPS
Example:
nano ~/.openclaw/.env
# add:
XXXXX_API_KEY=...
Then restart the gateway:
openclaw gateway restart