github-second-brain
Providing tools to AI to explore github codebase like agent
claude mcp add --transport stdio baonguyen09-github-second-brain docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/baonguyen09/github-second-brain:latest \ --env GITHUB_PERSONAL_ACCESS_TOKEN="YOUR_PERSONAL_GITHUB_ACCESS_TOKEN"
How to use
Github Second Brain exposes MCP tools that allow your AI agent to access and explore a GitHub repository on demand. The core capability is to connect to a locally running MCP server (via Docker in the provided setup) and invoke tools for fetching repository structure, reading file contents, and retrieving contextual information such as issues or pull requests when needed. This enables your AI to grounding its responses in the actual repository data without leaking data or relying on external fetches. Typical workflows involve pointing your MCP-enabled AI client at the local server and then asking questions that require code or documentation context, such as “What is the purpose of this function?” or “Show the directory tree up to depth 2.”
How to install
Prerequisites:
- Docker installed and running on your machine.
- A GitHub Personal Access Token (PAT) with permissions suitable for the repositories you want to access.
- Optional: Claude Desktop or Cursor as your MCP-enabled client if you want to connect via those tools.
Install and run using Docker:
- Ensure Docker is running and you are logged in if needed:
- docker login ghcr.io
- Run the MCP server container locally (example command):
docker run -i --rm \
-e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_PERSONAL_GITHUB_ACCESS_TOKEN \
ghcr.io/baonguyen09/github-second-brain:latest
- If you prefer to pass the token via environment in your client config, you can reference the same token in your MCP config (see the provided mcp_config structure).
- In Claude Desktop:
- Settings > Developer > Edit Config
- Replace with the MCP config snippet (see mcp_config section).
- In Cursor:
- Edit ~/.cursor/mcp.json with the same MCP server entry as shown in the examples.
Prerequisites recap:
- Docker must be installed and running
- A GitHub Personal Access Token with appropriate scopes
- (Optional) Tools to interact with MCP servers like Claude Desktop or Cursor for easier setup
Additional notes
Tips and considerations:
- The MCP server relies on a Docker image hosted at ghcr.io/baonguyen09/github-second-brain:latest. If you encounter image pull issues, you may need to run docker logout ghcr.io and re-authenticate.
- The GITHUB_PERSONAL_ACCESS_TOKEN should be kept secret. Do not commit it or expose it in public configurations.
- If you need to revoke access, regenerate the token from GitHub and update your MCP config accordingly.
- The server is designed to be self-contained and private to your environment; data never leaves your machine through MCP prompts.
- If you encounter token permission errors, verify that the token has access to the repositories you intend to explore (e.g., read:org, repo scopes as needed).
- The Docker approach is used to isolate the MCP server; alternatives in the future may include other runtimes, but the current setup uses a container image.
Related MCP Servers
jupyter
🪐 🔧 Model Context Protocol (MCP) Server for Jupyter.
Gitingest
mcp server for gitingest
Vector-Knowledge-Base
A semantic search engine that transforms your documents into an intelligent, searchable knowledge base using vector embeddings and AI
Helios
An AI IDE secure coding MCP service
mcp-raganything
API/MCP wrapper for RagAnything
rest-to -adapter
A Python library for converting REST API specifications into MCP (Model Context Protocol) tools for AI agents.