Skip to main content
Glama
RohitCds

Local MCP Gemini Automation Engine

by RohitCds

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

Available Tools

2 tools
mcp_edit_documentA

Overwrites or updates a document's total content with new text.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesThe ID of the document to edit.
contentYesThe full, updated content to write into the document.

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of disclosure. It clearly states that the operation overwrites the total content, which is a key behavioral trait. However, it does not mention prerequisites (e.g., document must exist), reversibility, permissions, or error behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is front-loaded and to the point. It does not waste words, though 'overwrites or updates' is slightly redundant; 'overwrites' alone would be more direct. Overall, it is concise and readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter mutation tool, the description conveys the core effect (full content replacement), but lacks information about return values, error conditions, and whether the document must already exist. Since there is no output schema, the description should have provided some of this context to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for both parameters, so the schema already describes doc_id and content adequately. The description adds no additional parameter semantics beyond the schema; it repeats the notion of 'total content' which matches the content parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('overwrites or updates') and identifies the resource ('a document's total content'), making it clear this is a write operation. It distinguishes from the sibling tool mcp_read_document by focusing on modification rather than reading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage (to modify a document's content) but does not explicitly state when to use this over mcp_read_document or mention any exclusions. The sibling tool name provides context, but the description itself offers no direct guidance on selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

mcp_read_documentB

Reads a document and returns its contents.

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesThe ID of the document to read.

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. The verb 'reads' implies non-destructive behavior, but the description does not explicitly state that it is read-only, nor does it mention error handling, permissions, or output formatting. This leaves significant behavioral ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no filler words. It is front-loaded with the action and outcome, making it easy to scan. No unnecessary information is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description should clarify what 'contents' means (e.g., plain text, JSON) and what happens for invalid doc_id. These gaps leave the agent uncertain about the return format and error conditions, making the description incomplete for a reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter, doc_id, is fully documented in the schema with a clear description ('The ID of the document to read'). The tool description does not add any extra meaning beyond referring to the document, which meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('reads') and resource ('document'), and states the outcome ('returns its contents'). This clearly distinguishes it from the sibling tool mcp_edit_document, which is for modifications.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving document contents, but it does not explicitly state when to prefer this over mcp_edit_document or any exclusion criteria. No alternatives are mentioned, so the agent must infer from the sibling name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedmcp_edit_document
    • First observedmcp_read_document

TDQS

A3.6/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness2/5

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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    A
    maintenance
    Turns 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.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    A 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.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RohitCds/local-mcp-gemini-cli'

If you have feedback or need assistance with the MCP directory API, please join our Discord server