GitHub Agent
- 🤖 GitHub Agent is an LLM-powered agent built using the LangGraph ReAct Agent workflow and GitHub MCP Server.
- 🌐 Protocol Support: Compatible with A2A protocol for integration with external user clients.
- 🛡️ Secure by Design: Enforces GitHub API token-based RBAC and supports secondary external authentication for strong access control.
- 🏭 MCP Server: The MCP server is generated by our first-party openapi-mcp-codegen utility, ensuring version/API compatibility and software supply chain integrity.
- 🔌 MCP Tools: Uses langchain-mcp-adapters to glue the tools from GitHub MCP server to LangGraph ReAct Agent Graph.
🏗️ Architecture
Detailed Sequence Diagram with Agentgateway
System Diagram
Sequence Diagram
⚙️ Local Development Setup
Use this setup to test the agent against GitHub.
🔑 Get GitHub API Token
- Go to GitHub.com → Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give your token a descriptive name
- Set an expiration date (recommended: 90 days)
- Select the required permissions:
⚠️ Note: Always grant the minimum required permissions (principle of least privilege) when generating your GitHub API token. Only select the scopes necessary for your use case to enhance security.
repo
(Full control of private repositories)workflow
(Update GitHub Action workflows)admin:org
(Full control of orgs and teams)admin:public_key
(Full control of public keys)admin:repo_hook
(Full control of repository hooks)admin:org_hook
(Full control of organization hooks)gist
(Create gists)notifications
(Access notifications)user
(Update ALL user data)delete_repo
(Delete repositories)write:packages
(Upload packages to GitHub Package Registry)delete:packages
(Delete packages from GitHub Package Registry)admin:gpg_key
(Full control of GPG keys)admin:ssh_signing_key
(Full control of SSH signing keys)
- Click "Generate token"
- Copy the token immediately (you won't be able to see it again)
Add to your .env
:
GITHUB_PERSONAL_ACCESS_TOKEN=<your_token>
GITHUB_API_URL=https://api.github.com
Local Development
# Navigate to the GitHub agent directory
cd ai_platform_engineering/agents/github
# Run the MCP server in stdio mode
make run-a2a