This repository demonstrates a real-world developer setup for building an AI agent with the Docker MCP Toolkit that can connect to a GitHub repository and answer questions about its contents.
The agent:
- Summarizes repositories
- Explains functions and modules
- Finds where specific API calls are made
- Retrieves code references with file/line details
It uses:
- Docker MCP Toolkit for tool integration (GitHub API)
- Docker Compose for orchestration
- OpenAI GPT-4o for reasoning and natural language responses
- Docker & Docker Compose
- Python 3.10+
- OpenAI API key
- GitHub Personal Access Token with at least:
repo
read:org
(for private repos)
git clone https://github.com/<your-username>/<your-repo>.git
cd <your-repo>
docker compose up -d mcp-gateway-github
docker mcp secret set github.personal_access_token=<YOUR_GITHUB_TOKEN>
Create a file named .env
in the root directory and add your OpenAI API key:
OPENAI_API_KEY=sk-********************************
Create and activate a Python virtual environment, then install dependencies from requirements.txt
:
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.tx
python app.py
Example usage:
Enter your query: Summarize https://github.com/owner/repo
- Add more MCP connectors (e.g., Jira, Slack, Databases) by adding new services to
docker-compose.yml
. - Containerize the agent itself for a fully portable deployment.
- Integrate with CI/CD pipelines using the same Compose file.