Analyzes local Git repositories to extract metadata and automatically connects them to newly created GitHub repositories
Automatically creates and configures GitHub repositories with proper settings, topics, and metadata based on local repository analysis
Integrates with GitHub Copilot to provide AI-assisted repository analysis and automated GitHub repository creation workflows
MCP GitHub Repository Creator
A Model Context Protocol (MCP) server that provides tools for AI applications like GitHub Copilot to analyze repositories and create GitHub repositories automatically.
🚀 Features
- Repository Analysis: Automatically analyze local git repositories to extract metadata. Includes traditional and AI approaches to analyze the repository
- GitHub Integration: Create private GitHub repositories with proper configuration
- Topic Management: Automatically add relevant topics based on project analysis
- MCP Compatible: Works with any MCP-compatible AI client (Copilot, Claude, etc.)
- Automated Setup: Complete workflow from analysis to GitHub repository creation
📦 Installation
- Clone this repository:
- Run the setup script:This will:
- Create a Python virtual environment
- Install the MCP SDK and dependencies
- Set up the project for use
🛠 Usage
As an MCP Server (Recommended)
The server provides the following tools for AI applications:
get_repo_analysis_instructions
- Get detailed instructions for repository analysisanalyze_and_generate_metadata_file
- Analyze repository and generate metadatacreate_github_repo_from_metadata
- Create GitHub repository from metadata JSONcreate_github_repository
- Create repository using existing metadata filefull_repository_setup
- Complete workflow: analyze → create → connect
Starting the MCP Server
The server runs on stdio transport and is compatible with MCP clients like:
- GitHub Copilot
- Claude Desktop
- VS Code extensions
- Custom MCP clients
MCP Client Integration
Configure your MCP client to connect to this server:
Manual Usage (Alternative)
You can also use the underlying functionality directly:
🎯 Workflow
- Analysis: The AI analyzes your repository structure, README, dependencies, and code
- Metadata Generation: Creates a
github_repo_metadata.json
with repository details - Repository Creation: Uses GitHub CLI to create a private repository
- Configuration: Sets up topics, enables features, and connects 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
- Gets detailed instructions on what to analyze
- Analyzes your repository structure, README, and code
- Copilot uses
- Generate Metadata: Copilot creates the metadata JSON
- Based on its analysis, Copilot generates repository metadata
- You can review and modify the metadata before proceeding
- Create Repository: Copilot creates the GitHub repository
- Uses
create_github_repo_from_metadata
with the generated metadata - Creates repository, pushes code, and configures settings
- Uses
Example Chat:
⚡ Full Automation Workflow
For complete automation without interaction:
- Single Command Setup: Use the
full_repository_setup
tool- Analyzes repository automatically
- Generates metadata file
- Creates GitHub repository
- Connects and pushes code
- All in one step
Example Chat:
🛠️ Manual/Step-by-Step Workflow
For granular control over each step:
- Generate Metadata File:
analyze_and_generate_metadata_file
- Review/Edit the generated
github_repo_metadata.json
- Create Repository:
create_github_repository
Example Chat:
💬 Usage Examples with Copilot
Once configured, you can use these natural language commands with Copilot:
Analyze Repository
Generate Metadata File
Create GitHub Repository
Full Setup
Step-by-Step Example
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
- Push your code
🚀 Copilot Integration & Installation
Prerequisites for Copilot Integration
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- VS Code with GitHub Copilot extension
- GitHub CLI installed and authenticated
Method 1: VS Code Copilot Integration (Recommended)
- Install GitHub CLI:
- Authenticate GitHub CLI:
- Clone and setup this MCP server:
- Configure VS Code settings (add to your VS Code settings.json):
Method 2: Claude Desktop Integration
- Install Claude Desktop from claude.ai
- Configure Claude Desktop (edit
~/.config/claude-desktop/config.json
): - Restart Claude Desktop and start using the commands
Automatic Installation Script
Create an easy installation script by running:
Or manually create the installer script in your project:
Testing the Integration
- Open a git repository in VS Code
- Start a chat with Copilot and try:
- Copilot should respond with repository analysis and offer to create the GitHub repository
📋 Requirements
- Python 3.8+
- Git repository (local)
- GitHub CLI (
gh
) installed and authenticated - Internet connection for GitHub API calls
GitHub CLI Setup
Install and authenticate GitHub CLI:
🔧 MCP Integration
This server implements the Model Context Protocol specification, making it compatible with various AI applications:
Available Tools
- Repository Analysis: Extracts project metadata automatically
- GitHub Repository Creation: Creates repositories with proper settings
- Topic Management: Adds relevant topics based on analysis
- Complete Workflow: End-to-end repository setup
Supported Transports
- stdio (default): Standard input/output for direct integration
- Compatible with FastMCP framework for easy deployment
📁 Project Structure
Core Modules
server.py
: Main MCP server that exposes tools to AI clientscore/repository_analyzer.py
:RepositoryAnalyzer
class for analyzing repository structure and generating metadatacore/templates.py
: Centralized template functions for all long string messages and instructionscreate_github_repo.py
: Legacy standalone script (for direct usage)demo.py
: Example client showing how to interact with the MCP server
📊 Example Metadata Structure
The server generates metadata in this format:
🎯 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 GitHub CLI for secure, token-based authentication
- Private by Default: Creates private repositories by default for security
- No Data Storage: No sensitive data 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 GitHub CLI
⚠️ Limitations
- GitHub CLI Required: Must have GitHub CLI installed and authenticated
- Git Repository Required: Must be run from within a git repository with commits
- Private Repositories: 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 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 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
Common Issues and Solutions
"Not a git repository" Error
"GitHub CLI not authenticated" Error
"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, 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
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables AI applications to automatically analyze local repositories and create GitHub repositories with proper configuration, topics, and complete setup workflow.
- 🚀 Features
- 📦 Installation
- 🛠 Usage
- 🎯 Workflow
- 🔄 Detailed Workflow Types
- 💬 Usage Examples with Copilot
- 🚀 Copilot Integration & Installation
- 📋 Requirements
- 🔧 MCP Integration
- 📁 Project Structure
- 📊 Example Metadata Structure
- 🎯 Supported Project Types
- 🌐 Language Detection
- 🛡️ Security & Privacy
- ⚠️ Limitations
- 🔧 Error Handling
- 🆘 Troubleshooting
- 🤝 Contributing
- 📜 License
- 🔗 Links
Related MCP Servers
- AsecurityFlicenseAqualityProvides tools for mapping and analyzing GitHub repositories. It allows users to set a GitHub Personal Access Token and retrieve detailed information about a specified repository, including its structure and summary statistics.Last updated -218TypeScript
- AsecurityAlicenseAqualityEnables AI assistants to interact with GitHub through the PyGithub library, providing tools for managing issues, repositories, pull requests, and other GitHub operations with intelligent parameter handling and error management.Last updated -191PythonMIT License
- AsecurityAlicenseAqualityEnables AI models to access GitHub repository contents as context, with features to fetch entire repositories, specific file contents, and repository structures for use in AI interactions.Last updated -32JavaScriptMIT License
- -securityAlicense-qualityEnables interaction with GitHub repositories through the GitHub API, allowing file operations, repository management, issue tracking, and code search through natural language commands.Last updated -32TypeScriptMIT License