You've learned how to set up MCP servers and understand the protocol. Now it's time to connect your AI assistant to GitHub—one of the most powerful MCP integrations available. This module teaches you to manage repositories, remotes, and issues directly from AI chat, automating workflows that typically require constant browser-IDE switching.
See module overview for full prerequisites list.
In this hands-on walkthrough, you'll:
- Configure the GitHub MCP server (HTTP-based, no installation needed)
- Authenticate with GitHub API
- List your repositories through AI chat
- Create a new empty repository on GitHub
- Add a new Git remote named
forkpointing to the new repository - Push code to the new remote:
git push fork main - Verify the code appeared on GitHub
- Conduct an interactive requirements interview (like Module 055)
- Create a GitHub issue with interview findings for future implementation
Time required: 15-20 minutes
Unlike the echo server from Module 100, the GitHub MCP server:
- HTTP-based - Connects to GitHub's official API endpoint
- No local installation - Runs on GitHub's infrastructure
- Authentication-based - Requires GitHub token for access
- Rich functionality - Repositories, issues, PRs, branches, commits
Traditional workflow:
- Open browser → Navigate to GitHub
- Create repository manually
- Copy repository URL
- Switch to terminal → Add remote
- Push code
- Switch to browser → Create issue
- Write issue description
- Repeat for each task
MCP workflow:
- Ask AI in chat: "Create a new repo and push my code there"
- Approve tool calls
- Done
Important: Configuration location differs between IDEs!
For VS Code users:
- Create or open:
.vscode/mcp.jsonin your workspace root - Example path:
c:/workspace/hello-genai/.vscode/mcp.json(Windows) or~/workspace/hello-genai/.vscode/mcp.json(macOS/Linux)
For Cursor users:
- Create or open:
.cursor/mcp.jsonin your workspace root - Example path:
c:/workspace/hello-genai/.cursor/mcp.json(Windows) or~/workspace/hello-genai/.cursor/mcp.json(macOS/Linux)
Quick reference from Module 100:
- VS Code uses
.vscode/mcp.jsonwith root key"servers" - Cursor uses
.cursor/mcp.jsonwith root key"mcpServers"
If the file doesn't exist, create it based on your IDE:
VS Code template:
{
"servers": {}
}Cursor template:
{
"mcpServers": {}
}Add the GitHub server configuration to your mcp.json:
For VS Code (.vscode/mcp.json):
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}For Cursor (.cursor/mcp.json):
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}Key differences from local servers:
- type: "http" - Connects to remote endpoint (not local script)
- url - Points to GitHub's official MCP API
- No
commandorargs- Server runs on GitHub's infrastructure
After saving mcp.json:
- Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Type "Reload Window"
- Press Enter
This connects your IDE to GitHub MCP server.
Your IDE:
- Read the updated
mcp.jsonconfiguration - Connected to
https://api.githubcopilot.com/mcp/via HTTP - Discovered available GitHub tools (repositories, issues, branches, etc.)
- Made these tools available to your AI assistant
Check connection: Open Output panel (View → Output) and select "Model Context Protocol". You should see:
[info] Starting HTTP server github
[info] Connection state: Running
The GitHub MCP server uses your GitHub Copilot subscription for authentication. This means:
- No need to create personal access tokens manually
- Automatic authentication through your IDE's GitHub login
- Permissions inherit from your GitHub account
VS Code:
- Look at bottom-left corner for GitHub account indicator
- Click the account icon if not signed in
- Select "Sign in to GitHub"
- Complete authentication in browser
Cursor:
- Open Settings (gear icon)
- Navigate to "Accounts"
- Ensure GitHub account is connected
- If not, click "Sign in with GitHub"
Open AI chat and ask:
List my GitHub repositories using the GitHub MCP server
Expected behavior:
- AI detects the
list_repositoriestool from GitHub MCP - Shows approval dialog with tool call details
- After approval, returns your repository list
If authentication fails:
- Error message: "Authentication required" or "Unauthorized"
- Solution: Sign out and re-sign in to GitHub in your IDE
- Verify GitHub Copilot subscription is active
If you need to switch to a different GitHub account for the MCP server:
VS Code method (recommended):
- Open your
.vscode/mcp.jsonfile - Hover over the GitHub server configuration
- Click the "More..." link that appears above the server name
- Select "Disconnect Account" from the menu
- The server will restart and prompt you to authenticate with a different account
- Complete authentication in the browser with your desired GitHub account
Alternative method:
- Open Command Palette (
Ctrl+Shift+P) - Type "MCP" to see MCP-related commands
- Look for options to manage server connections
Why this matters:
- GitHub MCP uses its own authentication, separate from VS Code's GitHub login
- Changing the account in VS Code's bottom-left corner does NOT change MCP authentication
- You must disconnect the MCP server account specifically using the steps above
After switching accounts:
- Reload the IDE window if needed
- Verify new account by asking AI to check current user
- Create repositories under the correct account
To see all GitHub MCP tools, ask AI:
What GitHub tools are available through MCP?
You should have access to:
- Repositories: Create, list, get details, delete
- Issues: Create, list, update, close, add comments
- Pull Requests: Create, list, review, merge
- Branches: Create, list, delete
- Commits: List, get details
- Files: Read content, create, update, delete
For this walkthrough, we'll focus on repositories and issues.
Skip this section if you are not using an Enterprise Managed User account (e.g., non-corporate users).
If your GitHub account is an Enterprise Managed User (e.g., corporate accounts ending in _company), you will see this error when trying to create repositories through MCP:
Your account is an Enterprise Managed User (EMU), which has strict restrictions:
Cannot create public repositories
Cannot create repositories under your personal account at all
To create a repository, it needs to be done within your organization on GitHub Enterprise.
You'd need:
The organization name
Organization admin permissions to create repos there
The solution: Use a personal GitHub account (non-corporate) for repository operations, and your corporate account for Copilot AI tokens.
GitHub account authentication appears in three separate places in this workflow. Each uses a different account:
| # | Connection Point | Recommended Account | Purpose |
|---|---|---|---|
| 1 | MCP Server — manage GitHub via AI chat | Personal account | Create repos, manage issues |
| 2 | Git Remote — push/pull code | Personal account | Code storage |
| 3 | Copilot Chat — AI token consumption | Corporate _company account |
AI model access |
The GitHub MCP server connects to one specific GitHub account. To verify or change it:
- Open
.vscode/mcp.jsonin your workspace - You will see a bar above the server block like:
▷ Start | 40 tools | 2 prompts | More... - Click "More..."
- A dropdown appears with these options:
- Disconnect Account (current-username) — shows the currently connected account
- Start Server / Stop Server
- Show Configuration / Show Output
- Configure Model Access / Browse Resources
- Click "Disconnect Account" to switch accounts
- The server restarts — authenticate with your personal GitHub account (not the
_companyone)
Why personal account for MCP? EMU accounts cannot create repositories at the personal level. Your personal account is required for the create_repository MCP tool to work.
When adding Git remotes (git remote add fork ...), the URL should point to your personal GitHub account's repository. As long as MCP is authenticated with your personal account (Connection 1), repositories will be created there automatically and the remote URL will be correct.
No extra steps needed here — it follows from Connection 1.
This controls which account's license funds the AI model usage. To ensure it uses your corporate subscription:
- Open the Extensions panel in VS Code (
Ctrl+Shift+X) - Find GitHub Copilot Chat in the Installed list
- Right-click on it → select "Account Preferences"
- A dropdown shows all connected GitHub accounts
- Select the account ending in
_company(e.g.,Stiven-Pupkin_company)
Result: Copilot Chat uses your corporate license for AI model access. Your personal account handles all repository operations. Both work seamlessly together in the same VS Code window.
Summary:
_companyaccount = AI brain (Copilot tokens). Personal account = code home (repositories & Git).
This hands-on section walks through the complete workflow:
- List existing repositories
- Create a new empty repository
- Add new remote named
forkto current workspace - Push code to the new remote:
git push fork main - Verify code appeared on GitHub
Ask AI:
Show me all my GitHub repositories using the github MCP tool
Review the approval dialog:
- Tool name:
list_repositories - Parameters: May include filters (public/private, organization, etc.)
Click "Allow" and review the output. You'll see:
- Repository names
- Visibility (public/private)
- URLs
- Descriptions
Note the repository count - you'll verify the new one appears here later.
Before creating, let's understand what we're building. Ask AI:
Create a new GitHub repository with these details:
- Name: vibecoding-fork-test
- Description: Test repository for MCP GitHub integration training
- Visibility: Public
- No README, .gitignore, or license (empty repository)
Approval dialog shows:
- Tool:
create_repository - Parameters:
{ "name": "vibecoding-fork-test", "description": "Test repository for MCP GitHub integration training", "private": false, "auto_init": false }
Click "Allow" - GitHub creates the repository.
What just happened:
- AI called GitHub API through MCP
- Created repository under your GitHub account
- Returned repository URL and details
Verify: Ask AI to list repositories again. The new repository should appear in the list.
Now connect your current workspace to the new repository. Ask AI:
Add a new Git remote named "fork" pointing to the repository "vibecoding-fork-test" we just created
What the AI will do:
- Get the repository URL (e.g.,
https://github.com/your-username/vibecoding-fork-test.git) - Run:
git remote add fork <repository-url> - Verify the remote was added
Approval dialog shows:
- Tool: Likely uses terminal execution or Git commands
- Command:
git remote add fork https://github.com/your-username/vibecoding-fork-test.git
Click "Allow"
Ask AI:
Show me all Git remotes in this workspace
Expected output:
origin https://github.com/original-repo/project.git (fetch)
origin https://github.com/original-repo/project.git (push)
fork https://github.com/your-username/vibecoding-fork-test.git (fetch)
fork https://github.com/your-username/vibecoding-fork-test.git (push)
You now have two remotes:
origin- Your original repositoryfork- The new test repository
Ask AI:
Push the current branch (main) to the fork remote
What happens:
- AI determines current branch (likely
main) - Executes:
git push fork main - Pushes all commits to the new repository
Approval dialog:
- Command:
git push fork main - Explanation: Pushing local commits to remote
Click "Allow" and watch the output. You should see:
Counting objects: X, done.
Delta compression using up to Y threads.
Compressing objects: 100% (Z/Z), done.
Writing objects: 100% (X/X), done.
To https://github.com/your-username/vibecoding-fork-test.git
* [new branch] main -> main
Ask AI:
Open the vibecoding-fork-test repository URL in my browser
Or manually navigate to: https://github.com/your-username/vibecoding-fork-test
Verify:
- Repository contains your code files
- Commit history matches your local branch
- File structure is identical to your workspace
Success! You've created a repository, configured a remote, and pushed code entirely through AI chat.
In Module 055: Clarifying Requirements Before Start, you learned how AI can interview users to gather requirements before implementation. Now we'll combine that skill with GitHub MCP to create a complete workflow:
- AI interviews you about a new feature/module
- AI captures requirements, goals, and technical details
- AI creates a GitHub issue with the interview summary
- Issue becomes a task for future implementation
We'll ask AI to:
- Review the instructions for creating training modules
- Interview you about a new skill/module you want to add to the course
- Find the logical place in the course structure
- Create a GitHub issue with all findings (NOT implement the module yet)
This demonstrates delegation through GitHub Issues—documenting work for later execution.
Ask AI:
Read the file ./instructions/create-training-module.agent.md to understand how to create new training modules
AI will read the instructions file and confirm understanding of:
- Module structure (about.md, walkthrough.md)
- Numbering scheme (increments of 10, with 5 for insertions)
- Required sections in both files
- Integration with training-plan.md
Ask AI:
Interview me about a new training module I want to add to this course. Follow the questions from create-training-module.agent.md. After gathering all information, create a GitHub issue with the findings—do NOT implement the module yet.
AI will ask questions like:
- What specific skill will this module teach?
- Where should it be placed in the learning sequence (after which module)?
- What are the main topics to cover (3-5 bullet points)?
- What are the prerequisites (which modules should be completed first)?
- What practical outcome should the learner achieve?
- What are the concrete hands-on steps to practice this skill?
Example interview:
AI: What specific skill will this module teach?
You: I want to teach developers how to use AI to generate API documentation from code comments and function signatures. The module should show how to parse Python code, extract docstrings, and generate Markdown documentation automatically.
AI: Where should it be placed in the learning sequence? After which module?
You: After Module 160 (Bulk File Processing with AI), since it involves processing multiple Python files.
AI: What are the main topics to cover?
You:
- Parsing Python files for function signatures
- Extracting docstrings and type hints
- Generating Markdown documentation
- Automating documentation updates
- Integrating with CI/CD pipelines
AI: What are the prerequisites?
You:
- Module 160: Bulk File Processing with AI
- Module 180: Python integration basics
- Basic understanding of Python docstrings
AI: What practical outcome should the learner achieve?
You: Learners should be able to automatically generate API documentation for any Python project by pointing AI at the source code directory.
AI: What are the concrete hands-on steps?
You:
- Create a sample Python project with multiple modules
- Write an AI prompt to parse Python files
- Extract function/class information
- Generate structured Markdown output
- Save documentation to docs/ folder
- Verify generated documentation is accurate
After gathering all information, AI will say something like:
I have all the information needed. I'll now create a GitHub issue to document this new module.
Approval dialog shows:
- Tool:
create_issue - Parameters:
{ "repository": "vibecoding-for-managers", "title": "New Module: AI-Generated API Documentation", "body": "## Module Overview\n\n**Skill:** Generate API documentation from Python code using AI\n\n**Placement:** After Module 160 (Bulk File Processing)\n\n**Module Number:** 165\n\n## Topics to Cover\n\n- Parsing Python files for function signatures\n- Extracting docstrings and type hints\n- Generating Markdown documentation\n- Automating documentation updates\n- Integrating with CI/CD pipelines\n\n## Prerequisites\n\n- Module 160: Bulk File Processing with AI\n- Module 180: Python integration basics\n- Basic understanding of Python docstrings\n\n## Learning Outcome\n\nLearners will be able to automatically generate API documentation for any Python project by pointing AI at the source code directory.\n\n## Hands-on Steps\n\n1. Create a sample Python project with multiple modules\n2. Write an AI prompt to parse Python files\n3. Extract function/class information\n4. Generate structured Markdown output\n5. Save documentation to docs/ folder\n6. Verify generated documentation is accurate\n\n## Implementation Notes\n\n- Use AI to parse Python AST (Abstract Syntax Tree)\n- Consider using existing tools like pydoc or sphinx as examples\n- Focus on automation rather than manual documentation writing\n", "labels": ["enhancement", "training-module", "documentation"] }
Click "Allow" - The issue is created on GitHub.
Ask AI:
Show me the issue we just created
Or navigate to your repository's Issues tab in the browser.
You should see:
- Issue title: "New Module: AI-Generated API Documentation"
- Complete description with all interview findings
- Labels: enhancement, training-module, documentation
- Status: Open
What we accomplished:
- Documented a new feature without implementing it
- Created a structured task for future work
- Preserved all requirements and context in GitHub
This is the power of MCP + GitHub Issues:
- No context-switching to browser
- Structured requirements capture
- Backlog management through AI chat
- Delegation to future AI sessions (or human developers)
Traditional development:
- Idea emerges during conversation
- Write it down in notes/Slack/email
- Later, try to remember context
- Manually create GitHub issue
- Implementation happens (maybe)
MCP + GitHub workflow:
- Idea emerges during AI conversation
- AI interviews you to clarify details
- AI creates structured GitHub issue immediately
- Issue contains complete context for future implementation
- No information loss, no manual data entry
Use Case 1: Feature Brainstorming
- Discuss multiple feature ideas with AI
- For each idea, run quick interview
- Create GitHub issues for top 3 priorities
- Backlog is populated without leaving IDE
Use Case 2: Bug Reports
- Discover a bug during development
- Describe symptoms to AI
- AI asks clarifying questions (reproduction steps, expected behavior)
- AI creates detailed bug report issue
Use Case 3: Code Review Findings
- AI analyzes codebase and identifies improvements
- For each finding, AI creates an issue with:
- Current state
- Proposed improvement
- Affected files
- Suggested implementation approach
Use Case 4: Learning Path Planning
- Interview learners about their skills and goals
- AI recommends training modules
- Create GitHub issues for custom modules
- Track learning progress through issue completion
What we practiced here is called Agent Delegation:
-
Current AI session (interviewer):
- Gathers requirements
- Documents context
- Creates structured task
-
Future AI session (implementer):
- Reads GitHub issue
- Has complete context
- Implements the solution
- Closes issue when done
Benefits:
- Work can be split across multiple sessions
- Context is preserved in structured format
- No information loss between sessions
- Clear task boundaries
You've successfully completed this module when you can check off:
✅ Understand how to configure GitHub MCP server (HTTP-based)
✅ Know the difference between local MCP servers and HTTP-based servers
✅ Successfully authenticate with GitHub through your IDE
✅ List repositories using GitHub MCP tools
✅ Create a new GitHub repository through AI chat
✅ Add a new Git remote (fork) pointing to the new repository
✅ Push code to the fork remote using git push fork main
✅ Verify code appeared on GitHub
✅ Conduct an interactive requirements interview (Module 055 pattern)
✅ Create a GitHub issue with interview findings
✅ Understand the Agent Delegation pattern
Answer these questions to verify comprehension:
-
What's the difference between GitHub MCP server and the echo server from Module 100?
Expected answer: GitHub MCP is HTTP-based (connects to remote API) with no local installation, while echo server is local (PowerShell/Bash script). GitHub requires authentication, echo server doesn't. GitHub provides production-grade tools for real workflows.
-
Why use MCP for GitHub instead of just using the GitHub website?
Expected answer: MCP eliminates context-switching between IDE and browser. You can manage repositories, issues, and remotes entirely through AI chat. This speeds up workflows and keeps you in the development environment.
-
How does GitHub MCP authentication work?
Expected answer: It uses your GitHub Copilot subscription and IDE's GitHub login. No need to create personal access tokens manually—authentication inherits from your GitHub account.
-
What is the Agent Delegation pattern?
Expected answer: One AI session (interviewer) gathers requirements and creates a GitHub issue. A future AI session (implementer) reads the issue and implements the solution. Context is preserved through structured documentation.
-
Why create GitHub issues instead of implementing immediately?
Expected answer: Issues serve as backlog for planned work. They preserve context, allow prioritization, enable asynchronous implementation, and provide a record of decisions. Not all ideas should be implemented immediately.
-
What information should a good GitHub issue include?
Expected answer: Clear title, detailed description, context/background, requirements, acceptance criteria, technical notes, labels, and links to related issues/PRs. Enough information for someone (human or AI) to implement without additional questions.
-
How do multiple Git remotes (origin, fork) enable collaboration?
Expected answer:
originpoints to main repository,forkpoints to personal copy. You can fetch updates fromorigin, develop on local branches, and push toforkfor testing. Then create PRs from fork to origin. This is the standard open-source contribution workflow.
Symptoms: AI says GitHub tools are unavailable
Solutions:
- Verify
mcp.jsonhas correct URL:https://api.githubcopilot.com/mcp/ - Check you're editing the right file (
.vscode/mcp.jsonvs.cursor/mcp.json) - Reload IDE window after configuration changes
- Check Output panel for connection errors
Symptoms: Tool calls fail with "Unauthorized" or "Authentication required"
Solutions:
-
Disconnect MCP server account (recommended):
- Open
.vscode/mcp.jsonfile - Hover over GitHub server configuration
- Click "More..." link above server name
- Select "Disconnect Account"
- Re-authenticate when prompted
- Open
-
Alternative solutions:
- Verify GitHub Copilot subscription is active
- Check internet connection (HTTP-based server requires network)
- Try reloading IDE window
- Check Output panel (View → Output → Model Context Protocol) for detailed errors
Important: Changing the GitHub account in VS Code's bottom-left corner does NOT affect MCP authentication. You must disconnect the MCP server account specifically.
Symptoms:
- Repository appears under unexpected GitHub account (e.g.,
coparentinstead ofcodenjoyme) - MCP uses different account than shown in VS Code
Root cause: GitHub MCP has its own authentication, separate from VS Code's GitHub login
Solution:
- Open
.vscode/mcp.jsonin your workspace - Hover over the
"github"server configuration - Click the "More..." link that appears above the server
- From the dropdown menu, select "Disconnect Account (coparent)" (shows current account)
- Server will restart and prompt for authentication
- Complete authentication with your desired GitHub account in browser
- Reload IDE window:
Ctrl+Shift+P→ "Reload Window" - Verify account changed by asking AI to check current user
Alternative workaround:
- Manually create repository on GitHub under desired account
- Add it as remote:
git remote add fork https://github.com/your-username/repo.git - Continue with the walkthrough
Symptoms:
- Error: "Cannot create public repositories" or "Cannot create repositories under your personal account at all"
- MCP tool call fails with Enterprise Managed User restriction message
Root cause: Your MCP server is authenticated with an enterprise account (_company), which has repository creation restrictions.
Solution — use personal account for MCP:
- Open
.vscode/mcp.json - Click "More..." above the
"github"server block - Select "Disconnect Account (your-corporate-username)"
- Re-authenticate with your personal GitHub account (the non-
_companyone) - Retry the repository creation command
Copilot tokens still from corporate account:
- This change only affects MCP — your AI model access stays under the corporate subscription
- To verify: open Extensions → right-click GitHub Copilot Chat → Account Preferences → confirm
_companyaccount is selected
See Part 3.5 for full setup details.
Symptoms: git push fork main fails
Solutions:
- Verify Git authentication is configured (SSH keys or credential manager)
- Check repository permissions on GitHub (you must have write access)
- Ensure repository URL is correct (verify with
git remote -v) - Try HTTPS URL instead of SSH if SSH keys aren't configured
Symptoms: Cannot create repository with chosen name
Solutions:
- Repository names must be unique within your account
- Check if you already have a repository with this name
- Choose a different name
- Delete old repository if it's no longer needed
Symptoms: Issue appears in different repository than expected
Solutions:
- Explicitly specify repository name in your prompt
- Verify workspace is connected to correct Git repository
- Check
git remote -voutput for correct repository URL - Be specific: "Create issue in repository vibecoding-for-managers"
Congratulations! You've mastered GitHub MCP integration and the Agent Delegation pattern. Here's what comes next:
-
Practice the workflow
Apply what you learned to real projects:
- Interview yourself about upcoming features
- Create GitHub issues for each feature
- Implement one issue at a time using AI
- Close issues as you complete work
-
Explore advanced GitHub MCP tools
Beyond repositories and issues:
- Pull Requests: Create, review, merge through AI
- Branches: Create feature branches, switch, delete
- Code Search: Find code patterns across repositories
- Workflows: Trigger GitHub Actions from AI chat
-
Combine MCP servers
Use multiple MCP servers together:
- GitHub MCP for issue management
- File system MCP for code operations
- Database MCP for data queries
- AI orchestrates across all servers
-
Continue to Module 110: Development Environment Setup
Learn to set up complete development environments using AI, building on your Git and GitHub skills.
- GitHub MCP Server Documentation
- GitHub REST API Reference
- Git Remotes Documentation
- Module 055: Clarifying Requirements - Review interview techniques
- Module 150: GitHub Coding Agent Delegation - Advanced delegation patterns
Ready to continue your training? Head to Module 110: Development Environment Setup