Cover image
Try Now
2025-04-02

GO中GitHub的MCP服务器的非官方实现。内部用于Metoro。

3 years

Works with Finder

0

Github Watches

0

Github Forks

3

Github Stars

GitHub MCP Server in Go

A Go implementation of the GitHub Model Context Protocol (MCP) server. This implementation allows AI assistants to interact with the GitHub API to perform operations such as creating repositories, managing branches, manipulating files, and more.

Prerequisites

  • Go 1.21 or higher
  • A GitHub personal access token with appropriate permissions

Installation

go get github.com/metoro-io/github-mcp-server-go

Authentication

The server supports two methods of authentication:

Environment Variable Authentication

Set your GitHub personal access token as an environment variable:

export GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token

HTTP Header Authentication

The server can also extract authentication tokens from HTTP requests. You can pass your GitHub token via the Authorization header:

Authorization: Bearer your_github_token

or simply:

Authorization: your_github_token

Context Passthrough

For HTTP handlers, the server supports both:

  1. The standard http_request context value for HTTP requests.
  2. The ginContext value when using the Gin framework.

This enables seamless integration with different web frameworks while maintaining a consistent authentication mechanism.

Usage

  1. Set your GitHub personal access token (as described in the Authentication section).

  2. Run the server:

go run main.go

Available Tools

The server provides the following tools:

  • search_repositories: Search for GitHub repositories
  • create_repository: Create a new GitHub repository in your account
  • fork_repository: Fork a GitHub repository to your account or specified organization
  • create_branch: Create a new branch in a GitHub repository
  • get_file_contents: Get the contents of a file or directory from a GitHub repository
  • create_or_update_file: Create or update a single file in a GitHub repository
  • push_files: Push multiple files to a GitHub repository in a single commit
  • create_issue: Create a new issue in a GitHub repository
  • get_issue: Get details of a specific issue in a GitHub repository
  • list_issues: List issues in a GitHub repository with filtering options
  • update_issue: Update an existing issue in a GitHub repository
  • add_issue_comment: Add a comment to an existing issue
  • list_commits: Get list of commits of a branch in a GitHub repository
  • search_code: Search for code across GitHub repositories
  • search_issues: Search for issues and pull requests across GitHub repositories
  • search_users: Search for users on GitHub

Development

Project Structure

  • main.go: Entry point for the application
  • common/: Common utilities and error handling
  • operations/: GitHub API operations implementation
  • tools/: MCP tool definitions and handlers

Building from Source

go build -o github-mcp-server

Running Tests

go test ./...

License

This project is licensed under the MIT License.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • rahulc0dy
  • 测试您的MCP服务器。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • modelcontextprotocol
  • 模型上下文协议服务器

    Reviews

    3 (1)
    Avatar
    user_WkKjbRcR
    2025-04-16

    github-mcp-server-go by metoro-io is an outstanding tool for managing MCP applications efficiently. It's written in Go, ensuring high performance and reliability. The server setup is intuitive, and the documentation is thorough. Check it out at https://github.com/metoro-io/github-mcp-server-go.