GitHub MCP Server
README.md
# GitHub MCP Server đ
A custom Model Context Protocol (MCP) server built with Node.js and TypeScript. This server allows any MCP-compatible AI Assistant (like Gemini Code Assist, Claude Desktop, Roo Code, etc.) to interact directly with your GitHub account.
## ⨠Features (Available Tools)
This server exposes 7 powerful tools to your AI assistant:
1. `create_repository`: Create a new public or private repository.
2. `get_my_repositories`: List the authenticated user's most recently updated repositories.
3. `get_repository`: Fetch details of a specific repository.
4. `get_file_content`: Read the exact content of any file inside a repository for code analysis.
5. `search_code`: Search for functions, keywords, or syntax across repositories.
6. `create_issue`: Open a new issue in a specific repository.
7. `list_issues`: View open issues for a repository.
---
## đ ī¸ Installation & Setup
1. **Clone the repository:**
```bash
git clone [https://github.com/YOUR_USERNAME/mcp-github-server.git](https://github.com/YOUR_USERNAME/mcp-github-server.git)
cd mcp-github-server
Install dependencies:
Bash
npm install
Build the project:
Bash
npm run build
## đ How to Get Your GitHub Token
To allow this server to act on your behalf, you need a Personal Access Token (PAT) from GitHub.
Go to your GitHub account settings.
Navigate to Developer settings (at the bottom of the left sidebar).
Click on Personal access tokens -> Tokens (classic).
Click Generate new token (classic).
Give your token a note (e.g., "MCP Server").
Required Scopes:
Check the repo box (This grants full control of private repositories, which is required to create repos, read files, and manage issues).
Scroll down and click Generate token.
Copy the token immediately (it starts with ghp_...).
Setting up the Environment
Create a .env file in the root directory of this project:
Bash
touch .env
Add your token to the .env file:
Ų
ŲØĒØˇŲ Ø§ŲØąŲ
Ø˛
GITHUB_TOKEN=your_generated_token_here
đ Connecting to Your IDE / AI Client
To use this server with an MCP-supported IDE or extension, you need to configure your client's MCP settings (usually a mcp.json or mcp_config.json file) to point to the built index.js file.
Example configuration:
JSON
{
"mcpServers": {
"github-mcp": {
"command": "node",
"args": [
"--no-warnings",
"ABSOLUTE_PATH_TO_YOUR_PROJECT/dist/index.js"
],
"env": {
"GITHUB_TOKEN": "your_generated_token_here"
}
}
}
}
Note: Make sure to replace ABSOLUTE_PATH_TO_YOUR_PROJECT with the actual path on your machine.
đ¤ Contributing
This is a small educational project! If you'd like to add more tools (like pull request management, or commit reading), feel free to fork the repository and submit a Pull Request.This server cannot be deployed
Maintenance
ActivitySlowing
ResponsivenessNo issues