Back to MCP directory
publicPublicdnsLocal runtime

github-mcp-server

一个用于GitHub的模型上下文协议(MCP)服务器,提供与GitHub的集成,允许LLM通过MCP与GitHub交互,支持搜索仓库、问题、提交、代码、用户、主题、标签等功能。

article

README

🚀 Github MCP 服务器

Github MCP 服务器是一个为 Github 提供的 Model Context Protocol 服务器。它通过 MCP 与 Github 集成,允许大语言模型(LLMs)与 Github 进行交互。

Github REST Api 文档

🚀 快速开始

本服务器允许大语言模型(LLMs)通过 MCP 与 Github 进行交互。下面将为你介绍如何安装、配置和运行该服务器。

📦 安装指南

1. 安装依赖项

pnpm install

2. 配置 Github 访问令牌

.env 中配置 Github 访问令牌:

GITHUB_PERSONAL_ACCESS_TOKEN=<your_personal_github_access_token>

3. 本地运行并进行热重载

pnpm dev

4. 构建服务器

pnpm build

5. 使用调试器进行本地调试

pnpm inspector

💻 使用示例

基础用法

以下是一些与 Github 交互的示例提示:

  1. "modelcontextprotocol" → 执行 search_repositories 工具以查找提及 modelcontextprotocol 的仓库。
  2. "什么是 modelcontextprotocol 服务器 repo 中的 739 号问题?" → 执行 get_issue 工具以查找 modelcontextprotocol 服务器 repo 中的 739 号问题。
  3. "什么是 modelcontextprotocol 服务器 repo 中的 717 号拉取请求?" → 执行 get_pull_request 工具以查找 modelcontextprotocol 服务器 repo 中的 717 号拉取请求。

📚 详细文档

开发步骤

1. 安装依赖项

pnpm install

2. 配置 Github 访问令牌

.env 中配置 Github 访问令牌:

GITHUB_PERSONAL_ACCESS_TOKEN=<your_personal_github_access_token>

3. 本地运行并进行热重载

pnpm dev

4. 构建服务器

pnpm build

5. 使用调试器进行本地调试

pnpm inspector
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client