Semlith

Connect Gemini CLI to Semlith

How to connect Gemini CLI to Semlith over MCP, the command or file that adds it, and how to check the connection works.

Every stanza writes ${SEMLITH_BIN} where the binary goes, the path which semlith prints. Set up your agent client explains it and the HTTP form.

Gemini CLI — ~/.gemini/settings.json. No Gemini-specific Agent Skill or steering hook is written, because neither has been run against a live Gemini CLI. The key for a streamable-HTTP server is httpUrl, not url; a plain url is read as the older SSE transport and the connection fails. gemini mcp add takes -s, --scope and writes ~/.gemini/settings.json for user and .gemini/settings.json for project, so --scope user covers everything (https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md).

~/.gemini/settings.json
{
  "mcpServers": {
    "semlith": {
      "command": "${SEMLITH_BIN}",
      "args": ["mcp"]
    }
  }
}

Or against a daemon on another machine, over HTTP:

{
  "mcpServers": {
    "semlith": {
      "httpUrl": "http://127.0.0.1:7365/mcp",
      "headers": { "Authorization": "Bearer ${SEMLITH_AGENT_KEY}" }
    }
  }
}
gemini mcp add --transport http --header "Authorization: Bearer ${SEMLITH_AGENT_KEY}" semlith http://127.0.0.1:7365/mcp

To replace an existing entry, name the scope: remove takes the same flag and defaults to project.

gemini mcp remove --scope user semlith
gemini mcp add --scope user semlith "${SEMLITH_BIN}" mcp

A user-scope registration does not mean the server runs everywhere. With folder trust on (the default), Gemini CLI disables user-level MCP servers in any folder not listed in ~/.gemini/trustedFolders.json, and gemini mcp list there shows semlith as Disabled. Trust the folder and semlith connects.

Its user-level instructions file, read on every session, to which semlith setup --register-all appends the rule block — see https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/gemini-md.md.

~/.gemini/GEMINI.md
${SEMLITH_RULES}