原始内容
GitHub Repository Assistant
A tool that uses the MCP (Model Control Protocol) to connect Claude with GitHub repositories, allowing users to analyze code and get assistance with tasks like creating deployment workflows.
Features
- Clone and analyze any GitHub repository
- Interact with repositories through Claude 3.5 Sonnet
- Request deployment workflows and other code generation tasks
- Seamless integration via Streamlit frontend
- MCP server with specialized tools for repository interaction
Requirements
- Python 3.13 or higher
- Git installed and available in PATH
- An Anthropic API key
Installation
Clone this repository:
git clone <your-repo-url> cd <repo-directory>Install the required dependencies:
pip install -r requirements.txtSet your Anthropic API key in the
.envfile:ANTHROPIC_API_KEY=your_api_key_here
Usage
Start the Streamlit application:
streamlit run app.pyIn the sidebar, connect to the MCP server by entering the path to the
server.pyfile in the "Server Script Path" field and clicking "Connect to Server".Enter a GitHub repository URL (e.g.,
https://github.com/deploypilotorg/example-repo) and click "Analyze Repository".Once the repository is analyzed, you can interact with it by asking questions or requesting tasks like:
- "What files are in this repository?"
- "What does the main.py file do?"
- "Create a GitHub Actions workflow for deploying this code"
- "Generate a Dockerfile for this application"
How It Works
The application uses the Model Control Protocol (MCP) to enable Claude to interact with GitHub repositories through specialized tools:
- The MCP server (
server.py) provides tools for cloning, analyzing, and reading from GitHub repositories - The Streamlit frontend (
app.py) provides a user-friendly interface for interactions - Claude uses the provided tools to understand repository structure and generate relevant responses
Limitations
- Currently only supports public GitHub repositories
- Large repositories may take longer to clone and analyze
- Generated deployment workflows may need manual adjustments based on specific requirements