
mcp_github_agent
Agente de Haystack que usa MCP para automatizar las tareas de Github
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
Haystack MCP Agent for GitHub Issue Automation
Project Description
This project demonstrates how to use an agent to automate routine GitHub repository maintenance tasks. The agent is built with the NLP framework Haystack and leverages GitHub's MCP Server to scan repository files for common spelling mistakes and automatically create an GitHub issue to track and resolve these errors. The project highlights the integration of AI-driven tools into developer workflows, streamlining quality assurance and project management processes.
The agent is powered by the Model Context Protocol (MCP), an open standard specifically designed to streamline how large language models (LLMs) and AI agents interact with external tools, data sources, and APIs. This standard enables greater interoperability, scalability, and maintainability for AI-driven applications, making it much easier for developers to build agents that can perform complex, context-aware tasks across different platforms and environments.
The agent itself utilizes OpenAI's GPT-4o, a state-of-the-art multimodal language model capable of advanced text analysis and reasoning. GPT-4o enables the agent to accurately identify spelling issues and generate actionable issue reports, enhancing the quality assurance process.
Motivation
This project was initiated as part of the "Spring into Haystack" coding challenge. The motivation is to showcase how modern AI agents, using open standards like MCP, can automate and enhance software development workflows. By enabling an agent to identify and report spelling errors in code repositories, developers can maintain higher code quality with less manual effort—demonstrating a practical, real-world use case for LLM-powered automation.
This project serves as a showcase for leveraging MCP and intelligent NLP agents to automate repository maintenance workflows on GitHub. In practical terms, the approach demonstrated here could be expanded to automate a variety of other development tasks, such as code review, dependency monitoring, documentation generation, or integration testing. By connecting additional tools and services through MCP, teams can build more sophisticated agents that proactively manage project health, streamline collaboration, and reduce manual effort across the entire software development lifecycle.
Useful Links
- Haystack Documentation
- Spring into Haystack Challenge
- GitHub MCP Server
- MCP Overview
- Haystack MCP Integration
- OpenAI GPT-4o
Expected Outcomes
- The script uses the OpenAI API to scan the
README.md
file in the forked repo for common typos. - If typos are found, it automatically creates a GitHub issue in your fork with details about the errors and how to fix them.
- The script will either:
- Create an issue in your repo if typos are detected.
- Do nothing if no typos are found.
- Check the Issues tab of your forked repo to see results.
Setup Instructions
To replicate this project and run the Haystack MCP Agent for GitHub Issue Automation on your own fork of the "Spring into Haystack" project, follow these steps:
1. Fork the Repository
- Navigate to deepset-ai/spring-into-haystack.
- Click Fork (top-right corner) to create a copy in your GitHub account.
- Do not rename the forked repository—the script expects the original repo name.
2. Create a GitHub Personal Access Token (PAT)
-
Go to GitHub Settings → Developer Settings → Personal Access Tokens (Fine-grained).
-
Create a new PAT with:
-
Repository access: Select your forked repo (
your-username/spring-into-haystack
). -
Permissions:
- Repository permissions → Contents: Read and Write
- Repository permissions → Issues: Read and Write
- All other permissions: No access.
-
Repository access: Select your forked repo (
-
Save the token securely — you’ll add it to your environment later.
3. Set Up Python Virtual Environment
-
Check your current Python version:
python --version
Ensure the output is at least
Python 3.9.x
. If you see a lower version, you need to install a newer one. -
Create a virtual environment
.venv
with Python:python -m venv .venv # Create virtual environment source .venv/bin/activate # macOS/Linux .venv\Scripts\activate # Windows
-
Install the required packages defined in the requirements.txt file:
pip install -r requirements.txt # Install packages
4. Configure Environment Variables
-
Create a
.env
file in the root directory:GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here OPENAI_API_KEY=your_openai_key_here
Never commit this file to GitHub — add .env
to your .gitignore
.
5. Modify the Python Script
- Open
github-agent.py
in a code editor (e.g., VS Code). - Locate the
owner
variable (e.g.,owner = "d-kleine"
). - Replace
d-kleine
with your GitHub username. -
Do not change
repo
orpath
variables unless you’ve modified the repo/file name.
6. Install Docker
The GitHub MCP Agent requires the GitHub MCP Server to be running as a Docker container. If you do not have Docker installed, install it.
-
Verify your Docker installation:
docker --version
-
Pull and run the GitHub MCP Server Docker image:
docker pull ghcr.io/github/github-mcp-server
7. Run the Typo Detection Agent
-
Ensure your virtual environment is active:
source .venv/bin/activate # macOS/Linux .venv\Scripts\activate # Windows
-
Execute the script:
python github-agent.py
相关推荐
🔥 1Panel proporciona una interfaz web intuitiva y un servidor MCP para administrar sitios web, archivos, contenedores, bases de datos y LLM en un servidor de Linux.
🧑🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.
⛓️Rulego es un marco de motor de regla de orquestación de componentes de alta generación de alto rendimiento, de alto rendimiento y de alto rendimiento para GO.
Cree fácilmente herramientas y agentes de LLM utilizando funciones Plain Bash/JavaScript/Python.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 Qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 Chatgpt 、 Deepseek 、 DiFy 、 Claude 、 Gemini 、 Xai 、 PPIO 、 Ollama 、 LM Studio 、阿里云百炼、火山方舟、 Siliconflow 、 Qwen 、 Moonshot 、 Chatglm 、 SillyTraven 、 MCP 等 LLM 的机器人 / Agente | Plataforma de bots de mensajería instantánea basada en LLM, admite Discord, Telegram, WeChat, Lark, Dingtalk, QQ, Slack
Iniciar aplicaciones de múltiples agentes empoderadas con Building LLM de manera más fácil.
Reviews

user_jNCf1D6j
As a dedicated user of mcp_github_agent, I can confidently say it's an indispensable tool for managing GitHub projects. Created by d-kleine, this agent seamlessly integrates with GitHub, making repository management and workflow automation a breeze. The user interface is intuitive, and the efficiency it brings to my development process is unparalleled. Highly recommended for any developer looking to streamline their GitHub tasks!

user_xJEbkkm9
The mcp_github_agent created by d-kleine is an incredible tool for integrating MCP applications with GitHub seamlessly. As a developer, I found it to be extremely efficient and user-friendly. It has significantly improved my workflow by automating various tasks and providing a smooth experience. Highly recommend it to anyone looking to streamline their GitHub operations!

user_hF8X2Pif
As a dedicated user of the mcp_github_agent developed by d-kleine, I am thoroughly impressed. This tool has seamlessly integrated into my workflow, enhancing my productivity with GitHub tasks. It's well-designed, user-friendly, and has significantly optimized my project management. Highly recommend it to those who rely on GitHub for their development processes!

user_MgMvwNO4
As an avid user of mcp_github_agent, I am genuinely impressed with its seamless integration and efficiency. Developed by the talented d-kleine, this tool streamlines my workflow by automating repetitive tasks on GitHub. Easy to install and intuitive to use, it has become an indispensable part of my daily operations. Highly recommended for developers looking to optimize their GitHub interactions!

user_8vHQyocb
I have been using the mcp_github_agent created by d-kleine and it has significantly streamlined my GitHub management. The tool is highly efficient and has been a game-changer for keeping track of various repositories. The user-friendly interface and reliable performance make it an essential tool for any developer. Highly recommended!

user_0JcEuAng
As a devoted user of the mcp_github_agent, I must say this tool is incredibly efficient. Created by d-kleine, it seamlessly integrates with GitHub, saving me a lot of time on project management. The setup is straightforward, and the welcome information is very helpful for newcomers. Highly recommended for developers!