An AI-powered agent that generates comprehensive architecture summaries for GitHub repositories using Amazon Bedrock and Model Context Protocol (MCP).
Available in both TypeScript and Python implementations!
- 🤖 Uses latest AI SDK / LangChain with MCP (Model Context Protocol) client
- 🔗 Integrates with GitHub MCP server
- ☁️ Powered by Amazon Bedrock models
- 📊 Generates detailed repository architecture summaries with Mermaid diagrams
- 🔄 Supports streaming responses for real-time output
- 🐍 NEW: Python implementation using LangChain + LangGraph
- Node.js 18+
- AWS Account with Bedrock access
- GitHub Personal Access Token
- Access to GitHub SSE MCP server endpoint
- Clone the repository:
git clone <your-repo-url>
cd github-sumary- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile with the following variables:
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key_id
AWS_SECRET_ACCESS_KEY=your_secret_access_key
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_SSE_MCP_URL=https://github.com/mcp-sse-endpoint
BEDROCK_MODEL=meta.llama3-8b-instruct-v1:0npm run dev <repo-owner> <repo-name>Example:
npm run dev vercel next.js- Build the project:
npm run build- Run the built application:
npm start <repo-owner> <repo-name>- MCP Client Initialization: Connects to the GitHub SSE MCP server using Server-Sent Events (SSE) transport
- Repository Data Retrieval:
- First attempts to use MCP tools from the GitHub SSE MCP server
- Falls back to GitHub REST API if MCP tools are unavailable
- Architecture Analysis: Uses Amazon Bedrock to analyze the repository data
- Summary Generation: Generates a comprehensive markdown summary including:
- Repository overview
- Technology stack and dependencies
- Project structure and organization
- Key components and modules
- Architecture patterns
- Build and deployment setup
- Notable features and design decisions
This project has two implementations:
- Location:
src/index.ts - Framework: Vercel AI SDK
- MCP Transport: HTTP/SSE
- Agent: Experimental_Agent from AI SDK
- View TypeScript Documentation
- Location:
python/ - Framework: LangChain + LangGraph
- MCP Transport: stdio (runs MCP server locally)
- Agent: ReAct agent from LangGraph
- View Python Documentation
- Quick Start Guide
github-sumary/
├── src/
│ └── index.ts # TypeScript implementation
├── python/ # Python implementation (NEW)
│ ├── main.py # Main Python application
│ ├── requirements.txt # Python dependencies
│ ├── setup.sh # Automated setup script
│ ├── README.md # Python documentation
│ ├── QUICKSTART.md # Quick start guide
│ └── IMPLEMENTATION_NOTES.md # Technical details
├── dist/ # Compiled JavaScript (generated)
├── package.json # TypeScript dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Ensure your AWS credentials have permissions to access Amazon Bedrock models. The default model is meta.llama3-8b-instruct-v1:0, but you can change it via the BEDROCK_MODEL environment variable.
Your GitHub token needs the following scopes:
repo(for private repositories)read:org(if accessing organization repositories)
The application expects a GitHub SSE MCP server endpoint. If the server provides repository-related tools, they will be used automatically. Otherwise, the application falls back to the GitHub REST API.
npm run dev- Run in development mode with TypeScriptnpm run build- Compile TypeScript to JavaScriptnpm start- Run the compiled applicationnpm run type-check- Type check without emitting files
ai- Vercel AI SDK for AI model interactions@ai-sdk/amazon-bedrock- Amazon Bedrock provider for AI SDK@modelcontextprotocol/sdk- Model Context Protocol SDKdotenv- Environment variable managementtypescript- TypeScript compilertsx- TypeScript execution for development
The application includes comprehensive error handling:
- Validates required environment variables
- Handles MCP connection failures gracefully
- Falls back to GitHub API if MCP tools fail
- Provides clear error messages for debugging
MIT
Contributions are welcome! Please feel free to submit a Pull Request.