Skip to main content
Glama
luizHramoss

GitHub MCP Server

by luizHramoss

GitHub MCP Server

自定义 MCP(Model Context Protocol)服务器,使用 TypeScript 编写,将 Claude 连接到 GitHub REST API。

它的功能

提供 6 个 Claude 可以调用的工具(tools):

工具

描述

list_repos

列出已认证用户的仓库

get_repo

特定仓库的详细信息

list_issues

列出某个仓库的 issues

create_issue

创建新的 issue

get_file_content

读取仓库中文件的内容

search_code

在 GitHub 上搜索代码

Related MCP server: remote-mcp-oauth-github

1. 生成 GitHub Personal Access Token

  1. 访问 GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens

  2. 创建具有最小必要权限的 token:

    • Contents: Read(用于 get_file_content

    • Issues: Read and write(用于 list_issues/create_issue

    • Metadata: Read(始终必需)

  3. 复制生成的 token(以 github_pat_... 开头)

安全提示:切勿将 token 提交到仓库。请使用环境变量。

2. 安装并构建

npm install
npm run build

这会生成 build/index.js,即服务器的可执行文件(通过 stdio 通信,这是 MCP 的标准协议)。

3. 本地测试(可选,无需 Claude)

export GITHUB_PERSONAL_ACCESS_TOKEN="seu_token_aqui"
npm start

如果 stderr 中出现 GitHub MCP server rodando via stdio.,就说明它在正常工作。要以交互方式测试这些工具,请使用 MCP Inspector

npx @modelcontextprotocol/inspector node build/index.js

4. 连接到 Claude Desktop

编辑 Claude Desktop 的配置文件:

  • macOS~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows%APPDATA%\Claude\claude_desktop_config.json

添加:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["/caminho/absoluto/para/github-mcp-server/build/index.js"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "seu_token_aqui"
      }
    }
  }
}

重启 Claude Desktop。GitHub 的相关工具应该会出现在对话的工具图标(🔨)中。

5. 后续步骤(扩展并强化作品集的想法)

  • 添加写入类工具:create_pull_requestmerge_pull_requestcreate_branch

  • 添加真正的分页(基于 cursor),而不是只使用 per_page

  • 速率限制和缓存(GitHub 对已认证请求的限制为 5000 req/h)

  • 使用 Vitest/Jest 编写自动化测试

  • 使用 GitHub Actions 在每次推送时运行 lint + 测试 + build 的 CI

  • 作为 npm 包发布(npx github-mcp-server

  • 将服务器 Docker 化(是与你其他 DevOps 项目集成的良好切入点)

项目结构

github-mcp-server/
├── src/
│   └── index.ts      # lógica do servidor e definição das tools
├── build/             # gerado pelo `npm run build`
├── package.json
├── tsconfig.json
└── README.md
Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Connects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.
    452
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables to interact with GitHub repositories directly from Claude, supporting actions like viewing repos, checking status, committing and pushing changes, and managing pull requests.

View all related MCP servers

Related MCP Connectors

  • Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

  • Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…

  • Connect Claude to Fathom meeting recordings, transcripts, and summaries

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luizHramoss/github-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server