这是一个基于Model Context Protocol (MCP) 的服务器,它提供了与GitHub API交互的工具。目前,该服务器支持通过描述、主题标签和网站URL来创建仓库。
GitHub MCP服务器提供了便捷的方式与GitHub API交互,助力你高效管理仓库。
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 [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"
}
});
这将:
更新仓库描述:
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"
}
});
该工具理解各种自然语言模式和关键词:
要修改或扩展服务器:
src/index.ts
。npm run build
本项目采用MIT许可证。