summarize_fileLABSCO SUMMARY
Summaries cost model calls, so the retry logic matters.
Every file summarized is a Gemini call on your key, which is why the backoff and rate limiting are more than boilerplate on a large repository. Worth noting that the summaries come from Gemini regardless of which assistant is asking — this is a second model doing the reading, and your assistant gets its output.
What it is
A summarizer that reads a directory recursively and produces a short explanation of what each code file does, using Gemini Flash 2.0. It started as a command-line tool and also runs as an MCP server, so an assistant can ask for a summary rather than having code pasted into the conversation.
What you get
- A summary per file, with the detail level and length configurable rather than fixed
- Directory traversal that honours
.gitignoreand skips the usual noise —node_modules,distand similar - Summaries written out to a text file when run from the command line
- The same capability over MCP: file summaries, directory browsing, batch summarization of many files, and configuration changes through the interface
- A retry mechanism with exponential backoff around the model calls, plus rate limiting
- Authentication on the MCP endpoints via an
x-api-keyheader
Requirements
A Google API key for Gemini, set as GOOGLE_API_KEY. Node.js 18+. Clone the repository, npm install, build, then start the server with npm start -- server. It listens on port 24312 by default and speaks SSE, so Cursor and Cline point at http://localhost:24312/sse with the key in an x-api-key header; change the port with npm start -- config set --port. Claude Desktop instead launches bin/code-summarizer.js server with GOOGLE_API_KEY in the env block. Package code-summarizer at 1.0.0.
Setup effort
Build from source — git clone https://github.com/nicobailon/code-summarizer.git
USE CASES
Getting oriented in a repository you just cloned
Ask for a high-level overview and let each file's summary stand in for reading it.
Explaining one file without opening it
Point at the path and get back what it does, instead of pasting it into the conversation.
Producing a written map of a codebase
Run it from the command line so the summaries land in a text file you can keep and share.
3 tools
Listed in project docs. Your client may show a different list.
summarize_directoryset_configBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
Node.js 18+
INSTALLATION
Connect your client
Server setup
git clone https://github.com/nicobailon/code-summarizer.git
cd code-summarizer
npm installCreate a .env file with your Google API key:
GOOGLE_API_KEY=<YOUR_GOOGLE_API_KEY>npm run build
npm start -- serverMCP Clients
Cursor
{
"mcpServers": {
"code-summarizer": {
"url": "http://localhost:24312/sse",
"headers": {
"x-api-key": "<YOUR_API_KEY>"
}
}
}
}Start the server first (npm start -- server, port 24312). <YOUR_GOOGLE_API_KEY> is the API key the server runs with — the GOOGLE_API_KEY in your .env, or the key set with npm start -- config set --api-key. Every endpoint except /health rejects requests without it.
Cline
/mcp add code-summarizer http://localhost:24312/sse
/mcp config code-summarizer headers.x-api-key <YOUR_API_KEY>Start the server first (npm start -- server, port 24312). <YOUR_GOOGLE_API_KEY> is the API key the server runs with — the GOOGLE_API_KEY in your .env, or the key set with npm start -- config set --api-key. Every endpoint except /health rejects requests without it.