Skip to content

An experimental MCP server that summarizes GitHub discussions, issues, and pull requests using a fast local database.

License

Notifications You must be signed in to change notification settings

mcps-stuff/github-brain

 
 

Repository files navigation

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?
  • Summarize this month's discussions.
Claude.mp4

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

As a bonus, GitHub Brain also includes a simple web-based UI for ultra-fast search of the discussions, issues, and pull requests.

As a bonus, GitHub Brain also includes a Raycast extension for ultra-fast search of the discussions, issues, and pull requests.

Prerequisites

  • Go installed

Usage

scripts/run <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:

scripts/run pull -o my-org

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

Argument Variable Description
-t GITHUB_TOKEN Your GitHub personal token to access the API. Required.
-o ORGANIZATION The GitHub organization to pull data from. Required.
-db DB_DIR Path to the SQLite database directory. Default: db folder in the current directory. An <organization>.db file will be created here.
-i Only pull selected entities. Choose from: repositories, discussions, issues, pull-requests. Comma-separated list.
-f Remove all data before pulling. If combined with -i, only the specified items will be removed.
-e EXCLUDED_REPOSITORIES Comma-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:

- Repository permissions: Read access to discussions, issues, metadata, and pull requests. Click [here](https://github.com/settings/personal-access-tokens/new?name=github-brain&description=http%3A%2F%2Fgithub.com%2Fwham%2Fgithub-brain&issues=read&pull_requests=read&discussions=read) to generate.

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

mcp

Start the MCP server using the local database.

Example:

scripts/run mcp -o my-org
Argument Variable Description
-o ORGANIZATION The GitHub organization to work with. Required.
-db DB_DIR Path to the SQLite database directory. Default: db folder in the current directory. Loads data from <organization>.db in this directory.

ui

Start the UI server, which provides a web-based interface for interacting with the GitHub data. Alternative to MCP for quick lookups.

Example:

scripts/run ui -o my-org
Argument Variable Description
-o ORGANIZATION The GitHub organization to work with. Required.
-db DB_DIR Path to the SQLite database directory. Default: db folder in the current directory. Loads data from <organization>.db in this directory.
-p UI_PORT Port for the UI server. Default: 8080.

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.

Raycast Extension

Run the Raycast extension with:

scripts/raycast

The extension uses the MCP server to search GitHub data.

About

An experimental MCP server that summarizes GitHub discussions, issues, and pull requests using a fast local database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 89.8%
  • HTML 4.8%
  • TypeScript 4.6%
  • Shell 0.8%