Hi! I've been trying to give my OpenClaw
agent (using google-gemini-cli provider)
filesystem write access. Here's where I am:
Setup:
- OpenClaw gateway on WSL2 Ubuntu, systemd,
Telegram channel - Provider: google-gemini-cli /
gemini-2.5-flash - Created a bundle plugin at
~/.openclaw/extensions/fs-bundle/ with
.claude-plugin/plugin.json + .mcp.json
(pointing to
@modelcontextprotocol/server-filesystem) - Plugin loads correctly — gateway logs
show ready (3 plugins: acpx, fs-bundle,
telegram) - OpenClaw generates
/tmp/openclaw-gemini-mcp-*/settings.json
with filesystem in mcp.allowed and
mcpServers — confirmed correct
What works:
- Running gemini interactively in the
terminal: /mcp shows 🟢 filesystem - Ready
(14 tools) including
mcp_filesystem_write_file ✅ - loadEnabledBundleMcpConfig returns the
correct config in isolation ✅
The problem:
When OpenClaw runs Gemini CLI in headless
mode (--output-format json --prompt "..."),
the mcp_filesystem_write_file tool is
never available to the agent. Session logs
show the model calls write_file and gets
"Tool not found. Did you mean: read_file,
cli_help, generalist?" — only OpenClaw's
own loopback tools are present.
Root cause we found:
It seems the Gemini CLI in
headless/non-interactive mode doesn't
initialize stdio-based MCP servers (those
defined with command:). Only the HTTP
loopback MCP (openclaw) connects. The
filesystem server requires spawning an npx
process that never gets started.
Question:
What's the correct way to give the agent
write_file access when using
google-gemini-cli as the provider? Should
the filesystem MCP be run as a persistent
HTTP/SSE service instead of a stdio
command:? Is there another supported path
we're missing?