mcp-gemini-cli-base
MCP implementations using FastMCP, integrated into Gemini CLI.
Documentation
MCP Project Setup
This document outlines the steps to set up the `mcp` project environment.
1. Create Conda Environment
Create a new conda environment named `mcp` with Python 3.12:
conda create -n mcp python=3.12 -y2. Install uv
Install the `uv` package manager using the following command:
curl -LsSf https://astral.sh/uv/install.sh | sh3. Install fastmcp
Install the `fastmcp` package using `uv` in the `mcp` environment:
conda run -n mcp uv pip install fastmcp4. Verify Installation
Confirm the `fastmcp` installation by running the following command:
conda run -n mcp fastmcp version5. Running the Hello World Server
`mcp_hello.py` is a "hello world" type mcp server. You can run the MCP inspector for it using the following command:
conda run -n mcp fastmcp dev mcp_hello.py:mcp6. Connecting with Proxy Session Token
Copy the provided session token from CLI, click on the provided link, paste in Configuration -> Proxy Session Token, click connect.
7. Inspect hello_world tool
Click on Tools in the top menu bar. "hello_world" should be listed with a parameter "name". Input your name and click "Run Tool". The tool should succeed and return a greeting.
8. Running Resource Tests
`mcp_resources.py` defines MCP resources. You can run tests for these resources using the `--test` argument:
uv run mcp_resources.py --test9. Weather Server
`mcp_weather.py` exposes a tool to get current weather data from OpenWeatherMap.
Before running: Ensure you have set your `OPENWEATHER_API_KEY` in the `.env` file:
OPENWEATHER_API_KEY=YOUR_API_KEY_HERETo run the weather server manually:
conda run -n mcp fastmcp dev mcp_weather.py:mcpTo run tests for the weather tool:
uv run mcp_weather.py --test10. Integrating with Gemini CLI
To allow the Gemini CLI to automatically start and connect to your `mcp_weather` server, you need to configure its `settings.json` file.
1. Locate `settings.json`:
The `settings.json` file is typically located at:
If the file or directory does not exist, create them.
2. Add `mcpServers` entry:
Add the following entry to the `mcpServers` section in your `settings.json` file. Replace `/mnt/d/Projects/_sandbox/mcp/` with the absolute path to your `mcp` project directory.
{
"mcpServers": {
"weather_server": {
"command": "uv",
"args": [
"run",
"/mnt/d/Projects/_sandbox/mcp/mcp_weather.py"
],
"cwd": "/mnt/d/Projects/_sandbox/mcp",
"timeout": 10000
}
}
}Once configured, when you run `gemini`, the CLI will automatically start your `mcp_weather.py` server and make its `get_current_weather` tool available to the Gemini model.
References
- Gemini CLI Configuration: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md - For information on setting up MCP with the Gemini CLI.
- FastMCP: https://github.com/jlowin/fastmcp - The FastMCP library used for building MCP servers.
Frequently asked questions
What is mcp-gemini-cli-base?
mcp-gemini-cli-base is MCP implementations using FastMCP, integrated into Gemini CLI.
How do I install mcp-gemini-cli-base?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-gemini-cli-base open source?
Yes — it is hosted on GitHub at https://github.com/MarkAndersonIX/mcp-gemini-cli-base and has 1 stars.
Related MCP tools
Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory across sessions with a self-hosted knowledge graph engine.
Automate browser based workflows with AI
Hindsight: Agent Memory That Learns
A privacy-first app that strips AI watermarks from content you own.
Agent framework and applications built upon Qwen>=3.0, featuring Function Calling, MCP, Code Interpreter, RAG, Chrome extension, etc.
The power of Claude Code / GeminiCLI / CodexCLI + [Gemini / OpenAI / OpenRouter / Azure / Grok / Ollama / Custom Model / All Of The Above] working as one.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP