Labsco
MCP SERVER

Kontxt MCP Server

by ReyNeill

One tool that reads a whole repository with Gemini and answers the question in front of it.

Codebase Context Packing & Compression
Summary
The repository is read in Gemini's context, and your client only sees the answer.

That is the whole trade: a large codebase costs Gemini tokens on your own key instead of filling the context window your agent is working in. It also means the quality of the digest is Gemini's call rather than your agent's.

What it is

A server that points Gemini Flash at a local repository and hands back a digest instead of raw files. The client sees a single tool; behind it, Gemini lists the repository structure, reads the files it decides it needs and greps the code, then returns only what bears on the question asked. Files you reference in a query are named to Gemini rather than pasted in, so their contents are pulled only if they matter.

What you get
  • One tool the client calls with a question, answered from the repository you launched the server against
  • Structure listing, file reading and grep performed on Gemini's side, so the client's context receives the digest and not the files
  • Referenced files passed as leads, read only when the query needs them
  • A configurable ceiling on how much context an analysis may build, and a report of the tokens each one consumed
  • A standalone SSE server several clients can share, or stdio when you would rather the client start and stop it
  • CORS limited to loopback origins unless you name the origins yourself
Requirements

A Google Gemini API key, since every question is answered by Gemini on your account. Python with the project's dependencies, the tree command available on the machine, and the repository path given to the server when it starts. Token counts are estimated with a gated Hugging Face tokenizer; without access to it the server keeps running on a heuristic estimator and switches over on its own once you have access.

Setup effort

One command plus a key — pip install -r requirements.txt, then supply credentials