Local MCP Gemini Automation Engine
A local AI agent workspace that allows users to interact with simulated data files via custom slash commands and context mentions, powered by Google GenAI SDK and MCP.
README
Local MCP Gemini Automation Engine
A highly responsive, production-grade local AI agent workspace built on Anthropics' Model Context Protocol (MCP) and powered by the modern Google GenAI SDK.
This system intercepts custom markdown slash commands (/format) and relative resource targeting context syntax (@) directly from an asynchronous terminal user interface thread to read, reformat, and manipulate local simulated data files autonomously via background tool chains.
š ļø System Architecture
The application is engineered using a decoupled, four-phase micro-process architecture to maximize scalability and isolate runtime concerns:
[Your Terminal UI Input] āā> Catch / or @ Shortcuts (cli.py)
ā
ā¼
[Orchestration Engine] āā> Intercepts Prompt Template History (cli_chat.py)
ā
ā¼
[Gemini Cloud Engine] āā> Reads context and returns autonomous Tool Action requests (gemini.py)
ā
ā¼
[Tool Schema Router] āā> Maps parameters and selects correct target pipeline (tools.py)
ā
ā¼
[MCP Process Gateway] āā> Streams arguments through background OS text pipes (mcp_client.py)
ā
ā¼
[Local Secure Server] āā> Edits or Reads your local memory data blocks securely (mcp_server.py)
Phase 1: Core Infrastructure (core/gemini.py, mcp_server.py) ā Houses the authenticated cloud AI client wrapper and a standalone local micro-server running over system standard input/output (stdio) channels.
⢠Phase 2: Gateway Clients (mcp_client.py, core/tools.py) ā Establishes the background subprocess connection pipelines and translates local tool schema models into JSON configurations the AI natively understands.
⢠Phase 3: Orchestration Brain (core/chat.py, core/cli_chat.py) ā Handles conversational persistence, monitors tool calling queues, pre-seeds custom structural histories, and parses page-relative targets.
⢠Phase 4: Interface Shell (core/cli.py, main.py) ā Drives the asynchronous user interface buffer loops, keybindings, and reactive dropdown autocompletion filters.
š Getting Started
Prerequisites
⢠Python 3.10+
⢠uv (Fast Python package installer and resolver)
⢠A Google AI Studio API Key
Installation & Configuration
1. Clone this repository to your local machine:
git clone [https://github.com/YOUR_USERNAME/local-mcp-gemini-cli.git](https://github.com/YOUR_USERNAME/local-mcp-gemini-cli.git)
cd cli_project
2. Create a local environment configuration file named .env in the root directory:
GEMINI_API_KEY=your_actual_google_ai_studio_key_here
GEMINI_MODEL=gemini-2.5-flash
USE_UV=1
(Note: The .env file is explicitly protected via .gitignore and will never be tracked or exposed via public source control.)
3. Launch the application environment thread using uv:
uv run --active main.py
š» Usage & Interactivity
Once the active application loop boots up, you can interact with the system via standard messaging or structural shortcuts:
⢠Standard Context Mentioning (@): Type an @ symbol anywhere in your prompt line to dynamically open an autocompletion menu containing all exposed server documents. Selecting a file injects its text content straight into the background query layout context.
⢠Slash Automation Command (/format): Type /format (e.g., /format report.pdf) to fetch pre-baked prompt instructions from the server. The client intercepts the turn, spins up a dedicated history thread, reads the file via background tools, converts it to clean markdown layout structures, and saves it directly back to the mock vault without any verbose text filler.
šļø Project Directory Structure
cli_project/
āāā core/
ā āāā cli.py # Terminal user interface buffer & keybind loops
ā āāā cli_chat.py # Command interceptors & history translation engines
ā āāā chat.py # Core chat loop & automated tool execution wheels
ā āāā tools.py # JSON schema translators and route selectors
ā āāā gemini.py # Stateless model wrappers & payload serializers
āāā main.py # Master context stack bootloader & orchestrator
āāā mcp_client.py # Background stdio process management client
āāā mcp_server.py # FastMCP tool, resource, and prompt provider
āāā .gitignore # Secret file shield exclusions
āāā .env # Private configurations (Local only)
āāā README.md # Project blueprint documentation
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.