Gemini CLI integration
Install and wire mog skills, rules, and MCP servers into Google Gemini CLI with automatic configuration.
mog has first-class support for Google Gemini CLI. The CLI auto-detects Gemini CLI projects, installs skill packages to .gemini/skills/, and writes MCP server config directly to .gemini/settings.json.
How auto-detection works
When you run mog install in a project directory, the CLI looks for a .gemini/ directory. If it finds one, it sets the target to gemini-cli and uses Gemini CLI-specific install paths. You can always override with --target gemini-cli.
Installing skills
Skills are SKILL.md packages that extend Gemini's capabilities within your project.
mog install acme/react-testing-skill
This downloads the package, verifies its SHA-256 hash, and extracts it to:
.gemini/skills/react-testing-skill/
SKILL.md
README.md
Gemini CLI picks up skills from the .gemini/ directory in your project, making them available to the agent immediately.
Installing MCP servers
MCP server packages are installed by writing configuration to .gemini/settings.json — no file extraction needed.
mog install acme/github-mcp-server
The CLI prompts for any required environment variables and writes the config:
{
"mcpServers": {
"acme-github-mcp-server": {
"command": "npx",
"args": ["-y", "@acme/github-mcp-server@1.0.0"],
"env": {
"GITHUB_TOKEN": "ghp_your_token"
}
}
}
}
If .gemini/settings.json already has other servers or settings configured, mog merges the new mcpServers entry without overwriting existing ones.
User-level settings
Gemini CLI also reads from ~/.gemini/settings.json for user-level configuration. Project-level settings in .gemini/settings.json take precedence. Use --target gemini-cli with mog to install to the project scope.
Passing env vars non-interactively
For CI or agent-driven installs, pass environment variables with --env:
mog install acme/github-mcp-server --env GITHUB_TOKEN=ghp_xxx
Supported transports
Gemini CLI supports stdio, SSE, and Streamable HTTP transports for MCP servers. mog writes the correct config for each transport type based on the package's mog.yaml manifest.
Project health check
Run mog doctor to verify your Gemini CLI project is set up correctly:
mog doctor
This checks:
- CLI authentication status
- Lockfile integrity (
mog.lock.json) - Installed packages match the lockfile (version and SHA-256)
- MCP server config validity in
.gemini/settings.json
Listing installed packages
mog ls
2 installed packages
acme/react-testing-skill@1.2.0 gemini-cli
.gemini/skills/react-testing-skill/
Installed: 1/15/2026
acme/github-mcp-server@1.0.0 gemini-cli (mcp)
.gemini/settings.json
Installed: 1/16/2026
Updating packages
mog update --dry-run
mog update
Updates respect semver: by default only patch and minor versions are applied. The lockfile is updated and the old files are replaced.
Uninstalling
mog uninstall acme/react-testing-skill
For skills, this removes the extracted files from .gemini/skills/ and the lockfile entry.
For MCP servers, this removes the mcpServers entry from .gemini/settings.json.
File layout summary
After installing a mix of skills and MCP servers, your Gemini CLI project looks like this:
my-project/
.gemini/
settings.json # MCP server configs (auto-managed)
skills/
react-testing-skill/
SKILL.md
README.md
another-skill/
SKILL.md
mog.lock.json # Lockfile (commit to version control)
Tips
- Commit
mog.lock.jsonto version control so teammates get the same package versions. - Don't commit secrets in
.gemini/settings.json— add it to.gitignoreif your MCP configs contain API keys. - You can use
gemini mcp addto add MCP servers manually, or let mog handle it for packages from the marketplace. - Use
mog explain <vendor>/<package>to preview a package's metadata, install path, and target compatibility before installing. - Use
mog install --preflightto see exactly what would happen without making changes.