🚀 MCP GitHub Repository Creator
The Model Context Protocol (MCP) server offers tools for AI applications such as GitHub Copilot. It can analyze repositories and automatically create GitHub repositories, streamlining the process for developers.
🚀 Quick Start
Prerequisites
- Python 3.8+
- A local Git repository
- Installed and authenticated GitHub CLI (
gh)
- An internet connection for GitHub API calls
Installation
- Clone this repository:
git clone https://github.com/flickleafy/mcp-github-repo-creator.git
cd mcp-github-repo-creator
- Run the setup script:
bash setup.sh
This script will create a Python virtual environment, install the MCP SDK and dependencies, and set up the project for use.
Starting the MCP Server
source venv/bin/activate
python server.py
The server uses stdio transport and is compatible with MCP clients like GitHub Copilot, Claude Desktop, VS Code extensions, and custom MCP clients.
MCP Client Integration
Configure your MCP client to connect to this server:
{
"name": "github-repo-creator",
"command": "python",
"args": ["server.py"],
"cwd": "/path/to/mcp-github-repo-creator"
}
✨ Features
- Repository Analysis: Automatically analyze local git repositories to extract metadata. It employs both traditional and AI approaches for comprehensive analysis.
- GitHub Integration: Create private GitHub repositories with proper configuration.
- Topic Management: Automatically add relevant topics based on project analysis.
- MCP Compatible: Works seamlessly with any MCP-compatible AI client, including Copilot, Claude, etc.
- Automated Setup: Provides a complete workflow from analysis to GitHub repository creation.
📦 Installation
The installation steps are already covered in the Quick Start section. Here is a recap:
- Clone the repository:
git clone https://github.com/flickleafy/mcp-github-repo-creator.git
cd mcp-github-repo-creator
- Run the setup script:
bash setup.sh
💻 Usage Examples
As an MCP Server (Recommended)
The server offers the following tools for AI applications:
get_repo_analysis_instructions: Get detailed instructions for repository analysis.
analyze_and_generate_metadata_file: Analyze the repository and generate metadata.
create_github_repo_from_metadata: Create a GitHub repository from metadata JSON.
create_github_repository: Create a repository using an existing metadata file.
full_repository_setup: Complete the end - to - end workflow: analyze → create → connect.
Manual Usage (Alternative)
You can directly use the underlying functionality:
source venv/bin/activate
python create_github_repo.py
python create_github_repo.py --create
python create_github_repo.py --manage-topics
📚 Documentation
Workflow
- Analysis: The AI analyzes your repository structure, README, dependencies, and code.
- Metadata Generation: Creates a
github_repo_metadata.json file with repository details.
- Repository Creation: Uses the GitHub CLI to create a private repository.
- Configuration: Sets up topics, enables features, and connects the local repository.
- Push: Pushes your local code to the new GitHub repository.
Detailed Workflow Types
The MCP server supports three main workflow approaches:
🤝 Interactive Copilot Workflow (Recommended)
This approach gives Copilot more control and allows for customization:
- Request Analysis Instructions: Ask Copilot to analyze the repository. Copilot uses
get_repo_analysis_instructions to get detailed analysis instructions and then analyzes your repository structure, README, and code.
- Generate Metadata: Copilot creates the metadata JSON based on its analysis. You can review and modify the metadata before proceeding.
- Create Repository: Copilot creates the GitHub repository using
create_github_repo_from_metadata with the generated metadata, pushes the code, and configures the settings.
Example Chat:
"Please analyze this repository and create a GitHub repository for it.
I want to review the metadata before you create the repo."
⚡ Full Automation Workflow
For complete automation without interaction:
- Single Command Setup: Use the
full_repository_setup tool. It automatically analyzes the repository, generates the metadata file, creates the GitHub repository, connects, and pushes the code in one step.
Example Chat:
"Automatically set up this project on GitHub with full automation."
🛠️ Manual/Step - by - Step Workflow
For granular control over each step:
- Generate Metadata File: Use
analyze_and_generate_metadata_file.
- Review/Edit the generated
github_repo_metadata.json.
- Create Repository: Use
create_github_repository.
Example Chat:
"First, generate a metadata file for this repository. I want to review it before creating the GitHub repo."
Usage Examples with Copilot
Once configured, you can use these natural language commands with Copilot:
"Analyze this repository and tell me what metadata would be generated for GitHub."
"Generate a github_repo_metadata.json file for this repository."
- Create GitHub Repository:
"Create a GitHub repository for this local project. First analyze it, generate metadata, then create the GitHub repo and connect everything."
"Set up this entire project on GitHub - analyze the code, create appropriate metadata, and create the repository."
- Step - by - Step Example:
"Please create a GitHub repository for this project. Analyze the code,
generate appropriate metadata, and set up the repository on GitHub."
Copilot will analyze your project structure and code, detect the programming language and frameworks, generate topics and description, create github_repo_metadata.json, create the GitHub repository, connect your local repo to GitHub, and push your code.
Copilot Integration & Installation
Prerequisites for Copilot Integration
- A GitHub Copilot subscription (Individual, Business, or Enterprise).
- VS Code with the GitHub Copilot extension.
- GitHub CLI installed and authenticated.
Method 1: VS Code Copilot Integration (Recommended)
- Install GitHub CLI:
brew install gh
sudo apt install gh
winget install GitHub.cli
- Authenticate GitHub CLI:
gh auth login
- Clone and setup this MCP server:
git clone https://github.com/flickleafy/mcp-github-repo-creator.git
cd mcp-github-repo-creator
bash setup.sh
- Configure VS Code settings (add to your VS Code settings.json):
{
"github.copilot.enable": {
"*": true,
"mcp": true
},
"mcp.servers": {
"github-repo-creator": {
"command": "python",
"args": ["server.py"],
"cwd": "/full/path/to/mcp-github-repo-creator",
"env": {
"PATH": "/full/path/to/mcp-github-repo-creator/venv/bin:${env:PATH}"
}
}
}
}
Method 2: Claude Desktop Integration
- Install Claude Desktop from claude.ai.
- Configure Claude Desktop (edit
~/.config/claude-desktop/config.json):{
"mcpServers": {
"github-repo-creator": {
"command": "python",
"args": ["/full/path/to/mcp-github-repo-creator/server.py"],
"env": {
"PATH": "/full/path/to/mcp-github-repo-creator/venv/bin"
}
}
}
}
- Restart Claude Desktop and start using the commands.
Automatic Installation Script
You can create an easy installation script by running:
curl -sSL https://raw.githubusercontent.com/flickleafy/mcp-github-repo-creator/main/install-copilot.sh | bash
Or manually create the installer script in your project:
cat > install-copilot.sh << 'EOF'
echo "🚀 Installing MCP GitHub Repository Creator for Copilot..."
command -v python3 >/dev/null 2>&1 || { echo "❌ Python 3 is required but not installed."; exit 1; }
command -v git >/dev/null 2>&1 || { echo "❌ Git is required but not installed."; exit 1; }
if ! command -v gh &> /dev/null; then
echo "📦 Installing GitHub CLI..."
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install gh
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt update && sudo apt install gh
else
echo "⚠️ Please install GitHub CLI manually: https://cli.github.com/"
exit 1
fi
fi
INSTALL_DIR="$HOME/.mcp-servers/github-repo-creator"
echo "📁 Installing to $INSTALL_DIR..."
mkdir -p "$HOME/.mcp-servers"
git clone https://github.com/flickleafy/mcp-github-repo-creator.git "$INSTALL_DIR"
cd "$INSTALL_DIR"
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
VSCODE_CONFIG="$HOME/.config/Code/User/settings.json"
echo "⚙️ Adding VS Code configuration..."
echo "✅ Installation complete!"
echo "🔧 Next steps:"
echo "1. Authenticate with GitHub: gh auth login"
echo "2. Restart VS Code"
echo "3. Start using Copilot with MCP commands!"
EOF
chmod +x install-copilot.sh
Testing the Integration
- Open a git repository in VS Code.
- Start a chat with Copilot and try:
"Use the MCP GitHub Repository Creator to analyze this repository and create a GitHub repo for it."
- Copilot should respond with repository analysis and offer to create the GitHub repository.
Requirements
- Python 3.8+
- A local Git repository
- GitHub CLI (
gh) installed and authenticated
- An internet connection for GitHub API calls
GitHub CLI Setup
Install and authenticate the GitHub CLI:
brew install gh
sudo apt install gh
gh auth login
MCP Integration
This server implements the Model Context Protocol specification, making it compatible with various AI applications:
- Available Tools:
- Repository Analysis: Automatically extracts project metadata.
- GitHub Repository Creation: Creates repositories with proper settings.
- Topic Management: Adds relevant topics based on analysis.
- Complete Workflow: Provides end - to - end repository setup.
- Supported Transports:
- stdio (default): Standard input/output for direct integration.
- Compatible with the FastMCP framework for easy deployment.
Project Structure
mcp-github-repo-creator/
├── server.py # Main MCP server using FastMCP
├── core/
│ ├── repository_analyzer.py # Repository analysis logic
│ └── templates.py # String templates for messages and instructions
├── create_github_repo.py # Legacy standalone script
├── demo.py # Demo MCP client
├── requirements.txt # Dependencies including MCP SDK
├── setup.sh # Environment setup script
├── pyproject.toml # Optional project metadata
├── .gitignore # Git ignore rules
└── README.md # This file
Core Modules
server.py: The main MCP server that exposes tools to AI clients.
core/repository_analyzer.py: The RepositoryAnalyzer class for analyzing repository structure and generating metadata.
core/templates.py: Centralized template functions for all long string messages and instructions.
create_github_repo.py: A legacy standalone script (for direct usage).
demo.py: An example client showing how to interact with the MCP server.
Example Metadata Structure
The server generates metadata in the following format:
{
"repository_name": "my-awesome-project",
"description": "🚀 A powerful tool for automating GitHub repository creation",
"topics": ["python", "automation", "github", "mcp", "ai-tools"],
"created_date": "2025-01-01",
"project_type": "CLI Tool",
"primary_language": "Python",
"license": "GPL-3.0",
"features": [
"Command-line interface",
"GitHub integration",
"Automated analysis"
]
}
Supported Project Types
The MCP server automatically detects and properly categorizes various project types:
- AI/ML Projects: Detects TensorFlow, PyTorch, scikit - learn, Transformers, Langchain.
- Web Applications: React, Vue, Angular, Svelte, Flask, Django, FastAPI, Express, Next.js.
- CLI Tools: Command - line applications and utilities.
- APIs: RESTful services, GraphQL, and microservices.
- Mobile Apps: React Native, Flutter, Ionic.
- Desktop Apps: Electron, Tauri, PyQt, Tkinter.
- Libraries: Software packages, frameworks, and SDKs.
- Game Development: Unity, Godot, Pygame.
- DevOps Tools: Docker, Kubernetes, Terraform configurations.
- Data Science: Jupyter notebooks, data analysis projects.
Language Detection
Automatically detects and supports a wide range of programming languages:
- Primary Languages: Python, JavaScript, TypeScript, Java, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala, R, Shell/Bash.
- Web Technologies: HTML, CSS, Vue, React (JSX/TSX), Svelte, SCSS/Sass, Less.
- Specialized: SQL, YAML, TOML, JSON, Dockerfile, Makefile.
The analyzer examines file extensions, dependencies, and project structure to accurately determine the primary language and technology stack.
Security & Privacy
- Secure Authentication: Uses the GitHub CLI for secure, token - based authentication.
- Private by Default: Creates private repositories by default for security.
- No Data Storage: No sensitive data is stored in metadata files.
- Local Processing: Repository analysis happens locally on your machine.
- GitHub Best Practices: Follows GitHub's security recommendations.
- Token Scope: Uses minimal required permissions through the GitHub CLI.
Limitations
- GitHub CLI Required: You must have the GitHub CLI installed and authenticated.
- Git Repository Required: The tool must be run from within a git repository with commits.
- Private Repositories: It creates private repositories only (can be changed manually after creation).
- GitHub API Limits: Subject to GitHub API rate limits.
- Topic Restrictions: Limited to repositories that fit GitHub's topic requirements (20 topics max).
- Network Dependency: Requires an internet connection for GitHub API calls.
Error Handling
The MCP server provides comprehensive error handling with clear messages for common issues:
- Repository Errors:
- Missing git repository: Clear instructions to initialize git.
- No commits: Guidance to make an initial commit.
- Untracked files: Prompts to add and commit files.
- Authentication Errors:
- GitHub CLI not found: Installation instructions.
- Not authenticated: Authentication setup guidance.
- Token expired: Re - authentication steps.
- GitHub API Errors:
- Repository name conflicts: Suggestions for alternative names.
- Permission issues: Troubleshooting steps.
- Rate limiting: Wait time recommendations.
Troubleshooting
"Not a git repository" Error
git init
git add .
git commit -m "Initial commit"
"GitHub CLI not authenticated" Error
gh auth status
gh auth login
"Permission denied" Error
Solutions:
- Check GitHub CLI authentication:
gh auth status.
- Ensure you have permission to create repositories in your account.
- Verify your GitHub token has appropriate scopes.
- For organization repositories, check organization permissions.
"Repository name already exists" Error
Solutions:
- Choose a different repository name.
- Check your GitHub account for existing repositories.
- Use the suggested alternative names from the error message.
- Add a suffix or prefix to make the name unique.
"GitHub API rate limit exceeded" Error
Solutions:
- Wait for the rate limit to reset (usually 1 hour).
- Use authenticated requests (ensure
gh auth login is completed).
- For high - volume usage, consider GitHub API rate limit best practices.
"Invalid metadata format" Error
Solutions:
- Check the generated
github_repo_metadata.json for syntax errors.
- Ensure all required fields are present.
- Validate JSON format using a JSON validator.
- Re - run the metadata generation tool.
"Network connectivity issues" Error
Solutions:
- Check internet connection.
- Verify GitHub.com is accessible.
- Check for firewall or proxy issues.
- Try again after network issues are resolved.
🤝 Contributing
- If you like the project, give a ⭐ to the repository.
- Create a feature branch, make your changes, and submit a pull request.
- Ensure your code follows the project's coding standards.
- Add tests for new features or bug fixes.
- Update documentation as needed.
📄 License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
🔗 Links
Built with ❤️ using the Model Context Protocol