Back to Documentation
Gemini CLI Integration
Use ContextFS with Google Gemini CLI via MCP
Prerequisites
- Gemini CLI installed (
npm install -g @anthropic-ai/gemini-cli) - Python 3.10+ with pip or uv
Quick Install
1. Install ContextFS
pip install contextfsOr with uv: uv tool install contextfs
2. Start the MCP Server
contextfs server start mcpThis starts the MCP server on port 8003 (default).
3. Configure Gemini CLI
Add this to your ~/.gemini/settings.json:
{
"mcpServers": {
"contextfs": {
"type": "sse",
"url": "http://127.0.0.1:8003/sse"
}
}
}4. Restart Gemini CLI
Restart Gemini CLI to load the new MCP configuration. ContextFS tools will now be available.
Install as Background Service (Recommended)
For automatic startup, install the MCP server as a system service:
contextfs install-service mcpThis installs a launchd service (macOS) or systemd service (Linux) that starts automatically.
Available MCP Tools
Once configured, these tools are available in Gemini CLI:
Memory Operations
contextfs_save- Save memoriescontextfs_search- Search memoriescontextfs_recall- Recall by IDcontextfs_list- List recentcontextfs_evolve- Update with historycontextfs_link- Link memories
Repository Indexing
contextfs_init- Initialize repocontextfs_index- Index codebasecontextfs_index_status- Check progresscontextfs_sync- Cloud sync
Cross-Tool Memory Sync
Share memories between Gemini CLI, Claude Code, and other tools:
# Enable cloud sync
contextfs cloud login
contextfs cloud sync
# Memories saved in Claude Code are now available in Gemini CLINext Steps
- Set up Claude Code - Use the same memory store with Claude
- Quick Start Guide - Learn the basics of ContextFS
- Enable Cloud Sync - Sync memories across devices