← Blog
April 17, 2026

Stdio MCP Mode with Smart Daemon Detection

MentisDB 0.9.2 introduces a smarter stdio MCP mode that makes connecting Claude Desktop, Cursor, and other MCP-spawning clients effortless. The stdio process now auto-detects a running daemon, proxies to it if found, or launches one in the background if not. Zero configuration, shared live state.


The Problem

Previously, mentisdbd --mode stdio created its own independent MentisDbService instance every time it started. This worked fine as a standalone process, but meant:

The mcp-remote bridge works, but it's an extra dependency chain: Node.js ≥ 20, npm install, TLS self-signed cert handling, NODE_TLS_REJECT_UNAUTHORIZED. For a tool that runs on localhost, that's a lot of friction.


How Stdio Mode Works Now

When mentisdbd --mode stdio starts, it follows a three-step flow:

Step 1: Detect

The stdio process hits http://127.0.0.1:9471/health with a 500ms timeout. If it gets a 200 response, a daemon is already running.

Step 2: Launch (if needed)

If no daemon responds, the stdio process launches one in the background:

It then polls the health endpoint for up to 10 seconds, waiting for the daemon to become responsive.

Step 3: Proxy

Once a daemon is confirmed, the stdio process acts as a lightweight JSON-RPC proxy:

Stdio MethodProxy Behavior
initializeHandled locally — returns protocol version and capabilities
pingHandled locally — returns empty result
tools/listForwarded to daemon's POST /tools/list
tools/callForwarded to daemon's POST /tools/execute
resources/listHandled locally — returns mentisdb://skill/core
resources/readHandled locally — returns embedded skill markdown

Static methods (initialize, ping, resources) are served from the stdio process itself. Dynamic methods (tools/list, tools/call) are forwarded to the daemon's HTTP MCP endpoints. This minimizes latency for handshake operations while ensuring all tool execution hits the live daemon state.

Fallback

If daemon launch fails (e.g., binary not found, permission denied), the stdio process falls back to the original local mode — creating its own MentisDbService with state shared only via disk files. This ensures Claude Desktop still works even when the daemon can't start.


Claude Desktop Configuration

The entire Claude Desktop config is now three lines:

{
  "mcpServers": {
    "mentisdb": {
      "command": "mentisdbd",
      "args": ["--mode", "stdio"]
    }
  }
}

That's it. No Node.js. No mcp-remote. No TLS config. No daemon pre-start. Just point Claude Desktop at the mentisdbd binary and go.

You can also run the setup wizard to write this automatically:

mentisdbd setup claude-desktop

Other MCP Clients

Any MCP client that spawns stdio subprocesses benefits from this:

HTTP-based clients (Claude Code, Codex, Qwen Code) continue to use the streamable HTTP MCP endpoint at http://127.0.0.1:9471 as before. The stdio mode is specifically for clients that spawn subprocesses.


Why Proxy Instead of Local?

The proxy approach solves several problems at once:


Upgrade

cargo install mentisdb --force

Then update your Claude Desktop config to use stdio mode. If you were previously using mcp-remote, you can remove the Node.js and mcp-remote dependencies entirely.


Environment Variables

The stdio proxy respects the same environment variables as the daemon:

If you run the daemon on a non-standard port, the stdio process will detect and proxy to it automatically.