Sponsored by Deepsite.site

GitHub MCP Server

Created By
Joseph198201246 months ago
A GitHub MCP server demo with create repository functionality
Content

GitHub MCP Server

A Model Context Protocol (MCP) server that provides GitHub repository management functionality.

Features

  • Create Repository: Create new GitHub repositories with customizable settings

Prerequisites

  • Python 3.8 or higher
  • GitHub Personal Access Token with repository creation permissions

Installation

  1. Clone this repository:
git clone https://github.com/Joseph19820124/joseph-github-mcp-server.git
cd joseph-github-mcp-server
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up your GitHub token:
export GITHUB_TOKEN="your_github_personal_access_token"

Usage

Running the MCP Server

python main.py

The server will start and listen for MCP requests via stdin/stdout.

Available Tools

create_repository

Creates a new GitHub repository.

Parameters:

  • name (required): Repository name
  • description (optional): Repository description
  • private (optional): Whether the repository should be private (default: false)

Example Request:

{
  "method": "tools/call",
  "params": {
    "name": "create_repository",
    "arguments": {
      "name": "my-new-repo",
      "description": "A sample repository",
      "private": false
    }
  },
  "id": "1"
}

Example Response:

{
  "content": [
    {
      "type": "text",
      "text": "{\n  \"success\": true,\n  \"repository\": {\n    \"id\": 123456789,\n    \"name\": \"my-new-repo\",\n    \"full_name\": \"username/my-new-repo\",\n    \"html_url\": \"https://github.com/username/my-new-repo\",\n    \"clone_url\": \"https://github.com/username/my-new-repo.git\",\n    \"ssh_url\": \"git@github.com:username/my-new-repo.git\",\n    \"private\": false,\n    \"description\": \"A sample repository\"\n  }\n}"
    }
  ],
  "id": "1"
}

GitHub Token Setup

To use this MCP server, you need a GitHub Personal Access Token with the following permissions:

  1. Go to GitHub Settings > Developer settings > Personal access tokens

  2. Generate a new token with the following scopes:

    • repo (for repository access)
    • user (for user information)
  3. Set the token as an environment variable:

export GITHUB_TOKEN="your_token_here"

Development

Project Structure

joseph-github-mcp-server/
├── main.py              # Main MCP server implementation
├── requirements.txt     # Python dependencies
├── README.md           # This file
└── pyproject.toml      # Project configuration

Testing

You can test the server by sending JSON-RPC requests:

  1. Start the server:
python main.py
  1. Send a test request:
echo '{"method": "tools/list", "id": "1"}' | python main.py

MCP (Model Context Protocol)

This server implements the Model Context Protocol, which is an open standard for connecting AI applications with external data sources and tools. The protocol uses JSON-RPC 2.0 over stdio for communication.

Supported MCP Methods

  • tools/list: List available tools
  • tools/call: Execute a specific tool

Tool Schema

The create_repository tool follows the MCP tool schema:

{
  "name": "create_repository",
  "description": "Create a new GitHub repository",
  "inputSchema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "Repository name"
      },
      "description": {
        "type": "string",
        "description": "Repository description",
        "default": ""
      },
      "private": {
        "type": "boolean",
        "description": "Whether the repository should be private",
        "default": false
      }
    },
    "required": ["name"]
  }
}

License

MIT License

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors