返回 MCP 目录
public公开dns本地运行

PoliTwit1984_github-meta-mcp-server

一个GitHub MCP服务器,提供与GitHub API交互的工具,支持创建和管理仓库(包括描述、标签和网站设置)。

article

README

🚀 GitHub MCP 服务器

这是一个基于Model Context Protocol (MCP) 的服务器,它提供了与GitHub API交互的工具。目前,该服务器支持通过描述、主题标签和网站URL来创建仓库。

🚀 快速开始

GitHub MCP服务器提供了便捷的方式与GitHub API交互,助力你高效管理仓库。

✨ 主要特性

  • 可依据描述自动生成名称来创建GitHub仓库。
  • 能够为仓库添加主题标签/标签。
  • 支持设置仓库主页。
  • 会自动将仓库初始化为README文件。

📦 安装指南

  1. 克隆仓库。
  2. 安装依赖:
npm install
  1. 构建服务器:
npm run build

📚 详细文档

配置

该服务器需要一个具有仓库创建权限的GitHub个人访问令牌。请将以下内容添加到您的MCP设置文件中:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["path/to/github-server/build/index.js"],
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      }
    }
  }
}

可用工具

create_repo

使用自然语言命令创建或更新GitHub仓库。

命令格式

该工具接受不同操作的自然语言命令:

创建仓库:

Create a repository for [description] with tags [tag1 tag2 tag3] website [url]

或者

Make a new repository called [description] tagged with [tag1, tag2, tag3]

更新仓库描述:

Update [owner/repo] description to [new description]

或者

Change [repo-name] description as [new description]

更新仓库标签:

Update [owner/repo] tags to [tag1 tag2 tag3]

或者

Set [repo-name] topics as [tag1, tag2, tag3]

更新仓库网站:

Update [owner/repo] website to [url]

或者

Set [repo-name] homepage as [url]
示例用法

💻 使用示例

基础用法

创建新仓库:

const result = await use_mcp_tool({
  server_name: "github",
  tool_name: "create_repo",
  arguments: {
    command: "Create a repository for my machine learning image classifier with tags python tensorflow computer-vision website https://example.com/docs"
  }
});

这将:

  1. 创建名为"my-machine-learning-image-classifier"的仓库。
  2. 设置描述为"my machine learning image classifier"。
  3. 添加"python", "tensorflow", 和 "computer-vision"作为仓库主题标签。
  4. 设置网站为"https://example.com/docs"。
  5. 初始化带有README文件。
高级用法

更新仓库描述:

const result = await use_mcp_tool({
  server_name: "github",
  tool_name: "create_repo",
  arguments: {
    command: "Update username/existing-repo description to Updated ML project for image classification"
  }
});

更新仓库标签:

const result = await use_mcp_tool({
  server_name: "github",
  tool_name: "create_repo",
  arguments: {
    command: "Update username/existing-repo tags to machine-learning python updated"
  }
});

更新仓库网站:

const result = await use_mcp_tool({
  server_name: "github",
  tool_name: "create_repo",
  arguments: {
    command: "Update username/existing-repo website to https://example.com/new-docs"
  }
});

该工具理解各种自然语言模式和关键词:

  • Create/make/new:创建仓库
  • Update/change/set/modify:更新仓库
  • "description to/as":更新描述
  • "tags/topics to/as":更新标签
  • "website/homepage/url to/as":更新网站

开发

要修改或扩展服务器:

  1. 修改 src/index.ts
  2. 重新构建服务器:
npm run build

📄 许可证

本项目采用MIT许可证。

help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端