Code Summarizer logo

Code Summarizer

by nicobailon

Code Summarizer is a command-line tool that summarizes code files in a given directory using Gemini Flash 2.0. It also includes an MCP server for integration with LLM tools.

View on GitHub

Last updated: N/A

What is Code Summarizer?

Code Summarizer is a tool that recursively processes code files in a directory, respecting .gitignore rules, and summarizes them using Gemini Flash 2.0. It also provides an MCP server for integration with LLM tools like Claude Desktop, Cursor AI, and Cline.

How to use Code Summarizer?

To use Code Summarizer, clone the repository, install dependencies, configure your Google API key, and build the project. You can then use the command-line interface to summarize code in a directory or start the MCP server for integration with LLM tools. Detailed instructions for each LLM tool are provided in the README.

Key features of Code Summarizer

  • Recursively processes code files in a directory

  • Respects .gitignore rules

  • Summarizes code files using Gemini Flash 2.0

  • MCP server for integration with LLM tools

  • Configurable detail level and summary length

  • Secure API key management

  • Authentication for MCP server endpoints

  • Retry mechanism with exponential backoff for LLM calls

  • Rate limiting to prevent abuse

Use cases of Code Summarizer

  • Summarizing large codebases for better understanding

  • Integrating code summarization into LLM-powered development workflows

  • Quickly understanding the functionality of unfamiliar code files

  • Generating documentation for code projects

FAQ from Code Summarizer

How do I set up the Google API key?

Create a .env file with the GOOGLE_API_KEY variable set to your API key.

How do I start the MCP server?

Run npm start -- server.

What LLM tools are supported by the MCP server?

Claude Desktop, Cursor AI, and Cline are currently supported.

How do I connect Claude Desktop to the MCP server?

Create a ~/.claude/claude_desktop_config.json file with the appropriate configuration.

What are the common MCP connection issues?

Connection refused, authentication errors, transport errors, permission issues, Claude Desktop not finding the MCP server, and rate limiting. See the Troubleshooting section in the README for solutions.