Local MCP Gemini Automation Engine
Provides tools for invoking Google's Gemini AI models to read, reformat, and manipulate local data files autonomously via tool chains, using the Google GenAI SDK.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Local MCP Gemini Automation Engine /format report.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 documentationAvailable Tools
2 toolsmcp_edit_documentA
Overwrites or updates a document's total content with new text.
Inputs: doc_id (required), content (required).
mcp_read_documentB
Reads a document and returns its contents.
Inputs: doc_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one reads documents and the other edits/overwrites them. There is no overlap or ambiguity in their intended actions.
Both tool names follow a consistent verb_noun pattern with a common 'mcp_' prefix: mcp_read_document and mcp_edit_document. Naming is uniform and predictable.
With only 2 tools, the set is on the thin side for a server named 'Gemini Automation Engine.' While the tools are focused, the count feels minimal and may not justify a broader automation scope.
The domain appears to be document management, but the surface only covers reading and editing. Missing operations like create, delete, or list documents represent significant gaps that would hinder agents from performing basic lifecycle tasks.
Maintenance
Related MCP Connectors
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Open-source workspace where AI agents do the work and humans set direction. Apache 2.0.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Workspace where AI agents publish, read and hand off markdown over MCP. No account.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI agents to interact with Google Workspace services including Drive, Docs, and Sheets through natural language commands.8MIT
- FlicenseNot gradedqualityDmaintenanceA robust, generic Model Context Protocol (MCP) Server that integrates AI agents with Google Workspace, enabling them to interact with Gmail and Google Docs.-
- AlicenseNot gradedqualityBmaintenanceTurns local project directories into persistent MCP workspaces, allowing AI agents to read files, modify code, run commands, manage Git, and save session progress across conversations.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA single-file MCP server that turns any folder into a workspace for AI agents, enabling file operations, code search, shell commands, background jobs, HTTP testing, headless browsing, PDF extraction, and screen capture.-