From 5d90ccf80702c168bbfd6afd6b6cc325d3e86dbe Mon Sep 17 00:00:00 2001 From: adithya32 <163162210+KumarADITHYA123@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:24:12 +0530 Subject: [PATCH 1/2] feat: Dockerize GitHub MCP server and optimize build --- README.md | 62 ++++++++++++++++++++-- backend/github_mcp_server/Dockerfile | 22 ++++++++ backend/github_mcp_server/requirements.txt | 17 ++++++ docker-compose.yml | 19 +++++++ env.example | 1 + 5 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 backend/github_mcp_server/Dockerfile create mode 100644 backend/github_mcp_server/requirements.txt create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 1dce8efa..b5bc9769 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # 🤖 Devr.AI - AI-Powered Developer Relations Assistant - + [![License:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![GitHub Org's stars](https://img.shields.io/github/stars/AOSSIE-Org/Devr.AI?style=social) [![Discord](https://img.shields.io/discord/1022871757289422898?color=7289da&logo=discord&logoColor=white)](https://discord.gg/BjaG8DJx2G) @@ -18,24 +18,28 @@ Devr.AI is revolutionizing open-source community management with advanced AI-pow ## 🚀 Features ### 🧠 LangGraph Agent-Based Intelligence + - **ReAct Reasoning Pattern** - Think → Act → Observe workflow for intelligent decision making - **Conversational Memory** - Persistent context across Discord sessions with automatic summarization - **Multi-Tool Orchestration** - Dynamic tool selection including web search, FAQ, and GitHub operations - **Self-Correcting Capabilities** - Iterative problem-solving with intelligent context awareness ### 💬 Discord Community Integration + - **Intelligent Message Processing** - Real-time classification and context-aware responses - **GitHub Account Verification** - OAuth-based account linking for enhanced personalization - **Command Interface** - Comprehensive bot commands for verification and management - **Thread Management** - Organized conversation flows with persistent memory ### 🔗 GitHub Integration + - **OAuth Authentication** - Secure GitHub account linking and verification - **User Profiling** - Automatic repository and contribution analysis - **Repository Operations** - Read access and basic GitHub toolkit functionality - **Cross-Platform Identity** - Unified profiles across Discord and GitHub ### 🏗️ Advanced Architecture + - **Asynchronous Processing** - RabbitMQ message queue with priority-based processing - **Multi-Database System** - Supabase (PostgreSQL) + Weaviate (Vector DB) integration - **Real-Time AI Responses** - Google Gemini LLM with Tavily web search capabilities @@ -44,28 +48,33 @@ Devr.AI is revolutionizing open-source community management with advanced AI-pow ## 💻 Technologies Used ### Backend Services + - **LangGraph** - Multi-agent orchestration and workflow management - **FastAPI** - High-performance async web framework - **RabbitMQ** - Message queuing and asynchronous processing - **Google Gemini** - Advanced LLM for reasoning and response generation ### AI & LLM Services + - **Gemini 2.5 Flash** - Primary reasoning and conversation model - **Tavily Search API** - Real-time web information retrieval - **Text Embeddings** - Semantic search and knowledge retrieval - **ReAct Pattern** - Reasoning and Acting workflow implementation ### Data Storage + - **Supabase** - PostgreSQL database with authentication - **Weaviate** - Vector database for semantic search - **Agent Memory** - Persistent conversation context and state management ### Platform Integrations + - **Discord.py (py-cord)** - Modern Discord bot framework - **PyGithub** - GitHub API integration and repository access - **OAuth Integration** - Secure account linking and verification ### Frontend Dashboard + - **React + Vite** - Modern web interface with TypeScript - **Tailwind CSS** - Responsive design system - **Framer Motion** - Interactive UI animations @@ -81,6 +90,7 @@ Devr.AI is revolutionizing open-source community management with advanced AI-pow Devr.AI utilizes a complex multi-service architecture with AI agents, message queues, and multiple databases. Setting up can be challenging, but we've streamlined the process. **Quick Start:** + 1. Clone the repository 2. Follow our comprehensive [Installation Guide](./docs/INSTALL_GUIDE.md) 3. Configure your environment variables (Discord bot, GitHub OAuth, API keys) @@ -106,7 +116,7 @@ For detailed setup instructions, troubleshooting, and deployment guides, please ## 📱 Screenshots
- + | Discord Integration | GitHub Verification | Agent Dashboard | | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------- | | | | | @@ -124,6 +134,7 @@ For detailed setup instructions, troubleshooting, and deployment guides, please Thank you for considering contributing to Devr.AI! Contributions are highly appreciated and welcomed. To ensure a smooth collaboration, please refer to our [Contribution Guidelines](./CONTRIBUTING.md). ### Development Setup + 1. Fork the repository 2. Create a feature branch 3. Follow our coding standards and testing guidelines @@ -160,4 +171,49 @@ Thanks a lot for spending your time helping Devr.AI grow. Keep rocking 🥂
Built with ❤️ for the open-source developer community -
\ No newline at end of file +
+ +## 🐳 Docker Compose Setup + +Devr.AI includes a Docker setup for the GitHub MCP server to streamline local development. + +### Running the GitHub MCP Server + +1. **Configure Environment**: Ensure your `.env` file in the root directory has the required variables: + + ```bash + GITHUB_TOKEN=your_token + GITHUB_ORG=your_org + ``` + +2. **Start the Service**: + Run the following command from the **root** directory: + + ```bash + docker-compose up --build + ``` + + The service will be available at `http://localhost:5001`. + +3. **Verify Health**: + ```bash + curl http://localhost:5001/health + # Expected: {"status": "healthy", "service": "github-mcp"} + ``` + +### Running Backend Infrastructure + +The database logic and message queues (Weaviate, RabbitMQ, FalkorDB) are managed by a separate Docker Compose file in the `backend` directory. + +To start infrastructure services: + +```bash +cd backend +docker-compose up -d +``` + +### Troubleshooting + +- **Port Conflicts**: The MCP server maps internal port `8001` to external port `5001`. If `5001` is in use, modify `docker-compose.yml`. +- **Environment Variables**: If the container fails to start, check `docker-compose logs github-mcp` to see if tokens are missing. +- **Hot Reloading**: The `backend` directory is mounted to `/app` in the container, so code changes will reload the server automatically. diff --git a/backend/github_mcp_server/Dockerfile b/backend/github_mcp_server/Dockerfile new file mode 100644 index 00000000..90a2227e --- /dev/null +++ b/backend/github_mcp_server/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.10-slim + +WORKDIR /app + +# Install dependencies first for better caching +COPY github_mcp_server/requirements.txt . +RUN pip install --upgrade pip && \ + pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \ + pip install --no-cache-dir -r requirements.txt + +# Copy the entire backend directory to /app +COPY . . + +# Expose the port the app runs on +EXPOSE 8001 + +# Health check (optional but recommended best practice) +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:8001/health || exit 1 + +# Start the server +CMD ["python", "start_github_mcp_server.py"] diff --git a/backend/github_mcp_server/requirements.txt b/backend/github_mcp_server/requirements.txt new file mode 100644 index 00000000..374736f7 --- /dev/null +++ b/backend/github_mcp_server/requirements.txt @@ -0,0 +1,17 @@ +fastapi +uvicorn +requests +python-dotenv +pydantic +langgraph==0.4.8 +langchain==0.3.26 +langchain-google-genai==2.1.5 +langchain-core +ddgs +sqlalchemy +langchain-community +torch +sentence-transformers +weaviate-client +supabase +pydantic-settings diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..9bc05619 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3.8' + +services: + github-mcp: + build: + context: ./backend + dockerfile: github_mcp_server/Dockerfile + container_name: github-mcp + ports: + - "5001:8001" + environment: + - GITHUB_TOKEN=${GITHUB_TOKEN} + - GITHUB_ORG=${GITHUB_ORG} + - SUPABASE_URL=${SUPABASE_URL} + - SUPABASE_KEY=${SUPABASE_KEY} + volumes: + - ./backend:/app + # Use the default network so it can be reached if needed, + # though it doesn't strictly depend on the backend infra for startup. diff --git a/env.example b/env.example index 6ed55bcc..302e4210 100644 --- a/env.example +++ b/env.example @@ -5,6 +5,7 @@ TAVILY_API_KEY=your_tavily_api_key_here # Platform Integrations DISCORD_BOT_TOKEN=your_discord_bot_token_here GITHUB_TOKEN=your_github_token_here +GITHUB_ORG=your_github_org_here # Database SUPABASE_URL=your_supabase_url_here From c17b59960d6c32c25f5c7d88fd6d2f7a99f31158 Mon Sep 17 00:00:00 2001 From: adithya32 <163162210+KumarADITHYA123@users.noreply.github.com> Date: Mon, 26 Jan 2026 13:04:21 +0530 Subject: [PATCH 2/2] fix: Apply remaining CodeRabbit fixes - curl, torch removal, SUPABASE docs --- README.md | 2 ++ backend/github_mcp_server/Dockerfile | 7 ++++--- backend/github_mcp_server/requirements.txt | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b5bc9769..ba70e018 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,8 @@ Devr.AI includes a Docker setup for the GitHub MCP server to streamline local de ```bash GITHUB_TOKEN=your_token GITHUB_ORG=your_org + SUPABASE_URL=your_supabase_url + SUPABASE_KEY=your_supabase_key ``` 2. **Start the Service**: diff --git a/backend/github_mcp_server/Dockerfile b/backend/github_mcp_server/Dockerfile index 90a2227e..5aea431a 100644 --- a/backend/github_mcp_server/Dockerfile +++ b/backend/github_mcp_server/Dockerfile @@ -2,9 +2,10 @@ FROM python:3.10-slim WORKDIR /app -# Install dependencies first for better caching -COPY github_mcp_server/requirements.txt . -RUN pip install --upgrade pip && \ +# Install curl and dependencies in a single layer for optimization +RUN apt-get update && apt-get install -y curl && \ + rm -rf /var/lib/apt/lists/* && \ + pip install --upgrade pip && \ pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \ pip install --no-cache-dir -r requirements.txt diff --git a/backend/github_mcp_server/requirements.txt b/backend/github_mcp_server/requirements.txt index 374736f7..2463a812 100644 --- a/backend/github_mcp_server/requirements.txt +++ b/backend/github_mcp_server/requirements.txt @@ -10,7 +10,6 @@ langchain-core ddgs sqlalchemy langchain-community -torch sentence-transformers weaviate-client supabase