A local MCP client/server pair that gives an LLM safe, tool-mediated access to your filesystem, straight from the terminal.
A terminal-native MCP client and server pair that lets Gemini read, write, and clean up files in any directory — no copy-pasting code into a browser chatbot.
Getting an LLM's help on a piece of code usually meant copying it out of my editor and pasting it into a browser tab — losing directory context, and repeating the round trip for every file.
I wanted Gemini to read, summarize, and clean up code directly from the filesystem I was already working in, without leaving the terminal.
And I wanted it built on a protocol another client could reuse, instead of a one-off script wired straight to an API.
I built both sides of the exchange: an MCP server that exposes the filesystem, and an MCP client that connects it to Gemini.
Exposes three kinds of capability:
list_directory, read_file, write_file, delete_file, update_file.file:// resource for attaching file contents.summarize_file and clean_up_code.Spawns the server as a subprocess over stdio and forwards its tool schema to Gemini as function declarations. It then drives the tool-call loop:
This is the part that took real engineering. Gemini calls sometimes fail outright and sometimes hang, so I split failures into two classes:
ServerErrors — exponential backoff, three attempts.ClientErrors — fail fast.Both fall back gracefully to the next prompt instead of taking the whole session down.
Classified Gemini API failures into retryable (ServerError, exponential backoff, 3 attempts) versus terminal (ClientError, fail fast) so an overloaded or slow model never crashes the chat session — it falls back to the next prompt instead.
Exposes 5 filesystem tools, 1 dynamic file:// resource, and 2 LLM-driven prompts (summarize_file, clean_up_code) through the standard MCP tool-calling protocol, so any MCP-compatible client can drive it, not just this one.
Replaced copy-pasting code into a browser chatbot with a single @filename mention that attaches the file as a resource directly in the terminal.