Github Second Brain
@BaoNguyen09
Providing tools to AI to explore github codebase like agent
概览
What is Github Second Brain?
Github Second Brain is a self-hosted MCP (Model Context Protocol) server that gives AI assistants a set of tools to explore and understand GitHub repositories on demand. It connects an AI client to GitHub repos so the AI can fetch issues, file content, directory trees, and code diffs, enabling more accurate, grounded responses without hallucinations. It is open-source, free, and does not collect personal data or store queries.
How to use Github Second Brain?
Install by running a Docker container with a GitHub Personal Access Token. Configure the server in Claude Desktop or Cursor by adding a JSON entry to the MCP configuration, specifying the Docker command and token. Once running, prompt your AI assistant with code or documentation questions; the AI uses the server’s tools (with your approval) to retrieve repository data.
Key features of Github Second Brain
- Grants AI access to latest documentation on any GitHub project
- Eliminates hallucinations by providing accurate repository context
- Completely open, free, and self-hosted for privacy
- Extracts and analyzes data from GitHub repositories
- Provides tools like tree directory, file contents, issue context, and code diff
Use cases of Github Second Brain
- Understanding the structure of a large open-source repository
- Getting precise answers about a project’s features, functions, or concepts
- Reviewing the context around a GitHub issue or pull request
- Examining code differences between branches, tags, or commits
FAQ from Github Second Brain
What are the prerequisites to run Github Second Brain?
You need Docker installed and running, and a GitHub Personal Access Token with appropriate permissions for the GitHub APIs the server will use.
How does Github Second Brain work?
Your AI assistant connects to a local MCP server built from a Docker image. When you ask a repo-related question, the AI sends requests to use the server’s tools, which execute API calls and return relevant data, allowing the AI to generate a grounded response.
What tools does Github Second Brain provide?
It provides get_tree_directory (full tree directory), get_repo_contents (file/folder content), get_issue_context (issue details and comments), and get_code_diff (diff for pull requests, branches, tags, commits). The get_processed_repo tool is deprecated.
Is Github Second Brain free and private?
Yes. It is open-source, completely free to use, and self-hosted. It does not collect personal information or store queries, so all data stays on your machine.
What license does Github Second Brain use?
It is licensed under the Apache License 2.0.