https://github.com/wham/github-brain
An experimental MCP server that summarizes GitHub discussions, issues, and pull requests using a fast local database.
https://github.com/wham/github-brain
github golang graphql mcp mcp-server sqllite
Last synced: 17 days ago
JSON representation
An experimental MCP server that summarizes GitHub discussions, issues, and pull requests using a fast local database.
- Host: GitHub
- URL: https://github.com/wham/github-brain
- Owner: wham
- License: mit
- Created: 2025-06-01T00:44:02.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-25T00:47:54.000Z (22 days ago)
- Last Synced: 2025-12-25T22:07:41.835Z (22 days ago)
- Topics: github, golang, graphql, mcp, mcp-server, sqllite
- Language: Go
- Homepage:
- Size: 1.54 MB
- Stars: 67
- Watchers: 0
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
GitHub Brain MCP Server
**GitHub Brain** is an experimental MCP server for summarizing GitHub discussions, issues, and pull requests. Answer questions like:
- _What are the contributions of user X in the last month?_
- _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](https://github.com/github/github-mcp-server). It stores GitHub data in a local database for:
- Fast responses
- More than the standard 100-item API limit
- Token-efficient Markdown output

GitHub Brain is [programmed in Markdown](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-using-markdown-as-a-programming-language-when-building-with-ai/).
## Installation
```sh
npm i -g github-brain
```
Or use `npx github-brain` to run without installing globally.
## Usage
```sh
github-brain
```
Launches the interactive TUI where you can:
1. **Login** - Authenticate with GitHub
2. **Pull** - Populate the local database with GitHub data
Re-run pull anytime to update the database with new GitHub data.
The app loads environment variables from a `.env` file in the GitHub Brain's home directory - `~/.github-brain` by default.
Example .env file
GITHUB_TOKEN=your_github_token
ORGANIZATION=my-org
| Argument | Description |
| :------- | :----------------------------------------- |
| `-m` | Home directory. Default: `~/.github-brain` |
Personal access token scopes
Use [fine-grained personal access tokens](https://github.com/settings/personal-access-tokens).
**Private organizations:** Token needs read access to discussions, issues, metadata, and pull requests. [Generate token](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).
**Public organizations:** Any token works (data is publicly accessible).
## MCP Server
Start the MCP server using the local database:
```sh
github-brain mcp
```
| Argument | Variable | Description |
| :------- | :------------- | :----------------------------------------- |
| `-o` | `ORGANIZATION` | GitHub organization. **Required.** |
| `-m` | | Home directory. Default: `~/.github-brain` |
## MCP Configuration
### Claude
Add to the Claude MCP configuration file:
```json
{
"mcpServers": {
"github-brain": {
"type": "stdio",
"command": "github-brain",
"args": ["mcp"]
}
}
```
Merge with existing `mcpServers` if present.
### VS Code
Add to the VS Code MCP configuration file:
```json
{
"servers": {
"github-brain": {
"type": "stdio",
"command": "github-brain",
"args": ["mcp"],
"version": "0.0.1"
}
}
}
```
Merge with existing `servers` if present.
## Development
`scripts/run` builds and runs `github-brain` with the checkout directory as home `-m` (database in `db/`, config in `.env`).