gemini_cli_query_toolLABSCO SUMMARY
An answer desk for one tool's documentation.
Instead of grepping the docs or trusting a model's recollection of them, the client gets the passages that actually cover the question. What comes back is quoted from the source, so it can be checked against it.
What it is
A server that turns the Gemini CLI's markdown documentation into a searchable index and exposes it as a single MCP tool. A build step walks the docs directory, concatenates the pages, splits them into overlapping chunks and embeds them into a vector store saved as a file in the project; at query time the tool retrieves the passages that match the question and returns them to the client.
What you get
- One tool that takes a plain-language question and returns the documentation passages that match it
- The whole documentation text published as a resource, for a client that would rather read it entire
- An index built and stored locally, from the docs directory you point the extractor at
- Local embeddings, so questions are answered without calling an outside service
- A container the client drives over stdio, so nothing is left running when it is idle
Requirements
Docker to run the container, Python — the project pins 3.13 — to build the index, and a local copy of the gemini-cli documentation for the extract step to walk. No account, no key: the embedding model and the index both run on your machine.
Setup effort
Run a container — build the image from the repository, then point your client at it
USE CASES
Getting an answer out of the Gemini CLI docs
Ask in plain language and the server returns the documentation passages that match, so the client answers from the docs rather than from memory.
Working out why the CLI is behaving that way
A question like why the CLI exits without an interactive prompt on a build server is answered from the pages that cover that configuration, without leaving the terminal.
Querying a pinned copy of the docs offline
The index is built once from the docs directory you point it at and lives locally, so answers do not depend on the documentation site being reachable.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation. Answers cover only the gemini-cli/docs checkout you indexed. docs://gemini-cli/full is a resource returning the whole docs file, not a tool.
Requires
- docker on PATH
- Python 3.13
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
# Clone the repository
git clone https://github.com/pedarias/gemini-cli-rag-mcp.git
cd gemini-cli-rag-mcp
# Install Python dependencies
pip install -r requirements.txt
# Prepare the documentation data
python extract.py
# Create the vector store
python create_vectorstore.py
# Run the MCP Service with Docker (starts gemini-cli-mcp-container)
docker-compose up -dMCP Clients
Gemini CLI
{
"mcpServers": {
"local_rag_server": {
"command": "docker",
"args": [
"exec",
"-i",
"gemini-cli-mcp-container",
"python",
"gemini_cli_mcp.py"
]
}
}
}VS Code
{
"servers": {
"local_rag_server": {
"command": "docker",
"args": [
"exec",
"-i",
"gemini-cli-mcp-container",
"python",
"gemini_cli_mcp.py"
]
}
}
}