Cover image
Try Now
2025-04-14

一个存储库演示如何使用github mcp(模型上下文协议)服务的存储库

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

Show How to Use MCP

这个仓库展示了如何使用 GitHub MCP (Model Context Protocol) 服务来自动化管理 GitHub 仓库和进行各种 GitHub 操作。

MCP 是什么?

MCP (Model Context Protocol) 是一个强大的协议,它允许 AI 模型(如 Claude)通过编程方式与 GitHub API 进行交互。通过 MCP,我们可以:

  • 创建和管理仓库
  • 操作文件(创建、读取、更新、删除)
  • 管理 Issues 和 Pull Requests
  • 处理分支和提交
  • 以及更多 GitHub 相关操作

主要功能示例

1. 仓库管理

# 创建仓库
mcp_github_create_repository(name="my-repo", description="My new repository")

# 分叉仓库
mcp_github_fork_repository(owner="original-owner", repo="original-repo")

2. 文件操作

# 创建或更新文件
mcp_github_create_or_update_file(
    owner="username",
    repo="repo-name",
    path="path/to/file",
    message="commit message",
    content="file content"
)

3. Issue 和 PR 管理

# 创建 Issue
mcp_github_create_issue(
    owner="username",
    repo="repo-name",
    title="Issue title",
    body="Issue description"
)

# 创建 Pull Request
mcp_github_create_pull_request(
    owner="username",
    repo="repo-name",
    title="PR title",
    head="feature-branch",
    base="main"
)

使用步骤

  1. 设置 GitHub Personal Access Token
export GITHUB_PERSONAL_ACCESS_TOKEN='your-token-here'
  1. 确保有适当的权限范围(Scopes):

    • repo - 完整的仓库访问权限
    • workflow - 工作流权限(如果需要)
    • admin:org - 组织管理(如果需要)
  2. 开始使用 MCP 功能进行自动化操作

最佳实践

  1. 始终使用有意义的提交信息
  2. 遵循 GitHub 的速率限制
  3. 妥善保管你的访问令牌
  4. 在进行重要操作前先测试
  5. 使用适当的错误处理机制

注意事项

  • 请确保不要在代码中硬编码你的访问令牌
  • 在公开仓库中要特别注意敏感信息
  • 建议在进行批量操作时添加适当的延迟
  • 定期检查和更新访问令牌

贡献

欢迎提交 Issue 和 Pull Request 来改进这个示例仓库!

许可证

MIT License

相关推荐

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

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

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • paulwing
  • 使用MCP服务创建的测试存储库

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

    Reviews

    3.3 (4)
    Avatar
    user_eW5yCRuo
    2025-04-23

    I've been using the show_how_to_use_mcp application by paulwing, and it's a game-changer! The guidance provided is incredibly clear and easy to follow. Whether you’re a newbie or a seasoned pro, this tool will enhance your MCP experience significantly. Don’t miss out!

    Avatar
    user_CaiGctys
    2025-04-23

    As a dedicated user of MCP applications, I must say the "show_how_to_use_mcp" by paulwing is a fantastic resource! It simplifies complex processes and provides clear, step-by-step guidance. The instructions are easy to follow, making it accessible for both new and experienced users. Highly recommended for anyone looking to maximize their MCP usage!

    Avatar
    user_YEeCU46O
    2025-04-23

    I've been using show_how_to_use_mcp by paulwing and it has significantly improved my understanding of MCP applications. It's extremely user-friendly and the step-by-step guidance is invaluable. Highly recommend to anyone looking to master MCP quickly and effectively!

    Avatar
    user_fyYxvf3N
    2025-04-23

    As an avid user of MCP applications, I am blown away by "show_how_to_use_mcp" created by paulwing. This comprehensive guide is intuitive and incredibly helpful. The welcoming messages make you feel right at home, and the detailed instructions ensure that even beginners can easily grasp the concepts. A must-use for anyone looking to maximize their MCP experience!