这是一个模型上下文协议 (MCP) 服务器,为用户提供了与 GitHub API 交互的实用工具。目前,它支持依据描述、主题以及网站 URL 来创建仓库,极大地提升了仓库创建与管理的效率。
此服务器可助力你便捷地与 GitHub API 交互,实现仓库的创建与管理。
git clone https://github.com/your-repository.git
npm install
npm run build
该服务器需要一个具备仓库创建权限的 GitHub 个人访问令牌。请将以下内容添加到您的 MCP 设置文件中:
{
"mcpServers": {
"github": {
"command": "node",
"args": ["path/to/github-server/build/index.js"],
"env": {
"GITHUB_TOKEN": "your-github-token"
}
}
}
}
此工具可借助自然语言命令来创建或更新 GitHub 仓库。
该工具支持多种自然语言命令,以执行不同操作:
Create a repository for [描述] with tags [标签1 标签2 标签3] website [url]
或者
Make a new repository called [描述] tagged with [标签1, 标签2, 标签3]
Update [owner/repo] description to [新描述]
或者
Change [repo-name] description as [新描述]
Update [owner/repo] tags to [标签1 标签2 标签3]
或者
Set [repo-name] topics as [标签1, 标签2, 标签3]
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"
}
});
此命令将完成以下操作:
更新仓库描述:
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 相关内容
});