github-brain

wham/github-brain

3.2

If you are the rightful owner of github-brain and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

GitHub Brain is an experimental MCP server designed to summarize GitHub discussions, issues, and pull requests.

GitHub Brain Logo

GitHub Brain MCP Server

GitHub Brain is an experimental MCP server for summarizing GitHub discussions, issues, and pull requests. It helps answer questions like:

  • What are the contributions of user X in the last month?
  • List all pull requests merged by the members of team Y in the last week.
  • Summarize this month's discussions.

https://github.com/user-attachments/assets/80910025-9d58-4367-af00-bf4c51e6ce86

GitHub Brain complements (but does not replace) the official GitHub MCP server. It uses a local database to store data pulled from GitHub, enabling:

  • Fast responses
  • More results than the standard 100-item API limit
  • Markdown output for token efficiency

Prerequisites

  • Go installed

Usage

go run main.go <command> [<args>]

Workflow:

  1. Populate the local database with the pull command.
  2. Start the MCP server with the mcp command.

Re-run pull anytime to update the database with new GitHub data. You can do this while mcp is running, but MCP requests may temporarily return errors during the update.

Each command has its own arguments. Some can be set via environment variables. The app will also load variables from a .env file in the current directory.

Example .env file
GITHUB_TOKEN=your_github_token
ORGANIZATION=my-org

pull

Populate the local database with GitHub data.

Example:

go run main.go pull -o my-org

The first call for an organization may take a while. Subsequent calls are faster, updating only with new data.

ArgumentVariableDescription
-tGITHUB_TOKENYour GitHub personal token to access the API. Required.
-oORGANIZATIONThe GitHub organization to pull data from. Required.
-dbDB_DIRPath to the SQLite database directory. Default: db folder in the current directory. An <organization>.db file will be created here.
-iOnly pull selected entities. Choose from: repositories, discussions, issues, pull-requests, teams. Comma-separated list.
-fRemove all data before pulling. If combined with -i, only the specified items will be removed.
-eEXCLUDED_REPOSITORIESComma-separated list of repositories to exclude from the pull of discussions, issues, and pull-requests. Useful for large repositories that are not relevant to the analysis.
Personal access token scopes
Use the [fine-grained personal access tokens](https://github.com/settings/personal-access-tokens).

For private organizations, the token must have the following configuration:

- Organization permissions: Read access to members
- Repository permissions: Read access to discussions, issues, metadata, and pull requests

For public organizations, an empty token is sufficient, as the data is publicly accessible.

mcp

Start the MCP server using the local database.

Example:

go run main.go mcp -o my-org
ArgumentVariableDescription
-oORGANIZATIONThe GitHub organization to work with. Required.
-dbDB_DIRPath to the SQLite database directory. Default: db folder in the current directory. Loads data from <organization>.db in this directory.

Installation

scripts/run is a convenience script that runs the MCP server. It builds the Go code and runs the mcp command with the checkout directory as the working directory. As a result, the SQLite database will be created in the db folder of the checkout directory.

Claude

Add to the Claude MCP configuration file:

{
  "mcpServers": {
    "github-brain": {
      "type": "stdio",
      "command": "<path-to-the-checkout-directory>/scripts/run",
      "args": ["mcp"]
    }
}

Where <path-to-the-checkout-directory> is the path to the GitHub Brain repository on your local machine. Merge if mcpServers already exists.

VS Code

Add to the VS Code MCP configuration file:

{
  "servers": {
    "github-brain": {
      "type": "stdio",
      "command": "<path-to-the-checkout-directory>/scripts/run",
      "args": ["mcp"],
      "version": "0.0.1"
    }
  }
}

Where <path-to-the-checkout-directory> is the path to the GitHub Brain repository on your local machine. Merge if servers already exists.