Lean Github Mcp

MCP开发工具

提供方 noushad999 · 包名 @noushad999/lean-github-mcp

开发工具 stdio · 本地进程 OAuth 授权 社区 / 第三方 Claude DesktopClaudeCursorCodex
查看接入方式

The lean GitHub MCP server for Claude — 26x smaller responses, 19 tools, zero Docker required.

一句话选型结论

按资料字段整理

Lean Github Mcp 属于开发工具类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

githubmcpclaude

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
npx -y @noushad999/lean-github-mcp

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Lean Github Mcp当前 未标注 stdio · 本地进程 本地部署 有 未标注
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方noushad999上游标注的维护方 noushad999
分类开发工具本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时@noushad999/lean-github-mcp · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

17.1 KB
来自项目仓库与上游目录的原文,未做删改

Lean GitHub MCP

Control GitHub entirely through Claude — in plain English.

Create PRs, manage issues, trigger workflows, cut releases, review diffs — without touching a browser.

26x smaller responses than the official GitHub MCP — your Claude context window goes further.


What is this?

This is a Model Context Protocol (MCP) server that connects Claude directly to the GitHub API. Once installed, you can manage your entire GitHub workflow through natural conversation — no GUI, no copy-pasting URLs, no context switching.

You type this in Claude:```
Merge PR #47 with squash, delete the branch, then create a release v2.1.0 with those changes


**Claude does all of it.** Three API calls. Done.

---

## Why this instead of the official GitHub MCP?

| | This Server | Official GitHub MCP |
|---|---|---|
| **Setup** | `npm install` + token | Docker required |
| **Response size** | ~320 avg tokens | 2000+ tokens (raw API) |
| **Token efficiency** | Null stripping, compactify | Raw JSON passthrough |
| **Caching** | 120s in-memory cache | No cache |
| **Tools** | 19 tools | ~30 tools |
| **Default branch** | Auto-detected | Hard-coded `main` |
| **Error messages** | Status codes included | Generic messages |
| **License** | MIT — use anywhere | MIT |

**Bottom line:** This server was built to be lean. Every response is stripped of nulls, truncated intelligently, and cached where it makes sense. Your Claude context window is treated as a precious resource.

---

## 60-Second Setup

**Option 1 — Run with npx (no install needed):**```bash
GITHUB_TOKEN=ghp_your_token npx @noushad999/lean-github-mcp

Option 2 — Install globally from npm:```bash
npm install -g @noushad999/lean-github-mcp
lean-github-mcp


**Option 3 — Docker _(coming soon)_:**```bash
docker run -e GITHUB_TOKEN=ghp_your_token ghcr.io/noushad999/lean-github-mcp

Option 4 — Clone from source:```bash
git clone https://github.com/noushad999/lean-github-mcp.git
cd lean-github-mcp
npm install && npm run build
echo "GITHUB_TOKEN=ghp_your_token" > .env


**Claude Desktop** — edit `%APPDATA%\Claude\claude_desktop_config.json` (Windows) or `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac):

**Using npx (easiest — no install needed):**```json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@noushad999/lean-github-mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Using local build:```json
{
"mcpServers": {
"github": {
"command": "node",
"args": ["C:/absolute/path/to/lean-github-mcp/dist/index.js"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}


**Claude Code (CLI):**```bash
claude mcp add github -- node /absolute/path/to/lean-github-mcp/dist/index.js

Restart Claude. You're done.


Token Permissions Required

Go to github.com/settings/tokens?type=beta → Fine-grained token:

Permission Level Used by
Contents Read & Write get_file, create_branch, delete_branch
Issues Read & Write list_issues, create_issue, assign_issue, add_comment
Pull requests Read & Write list_prs, create_pr, merge_pr, get_pr_diff
Actions Read & Write list_workflows, trigger_workflow
Metadata Read list_repos, get_repo

Available Tools

Repositories

list_repos

List repositories for any user or organization.```
"Show me all of vercel's public repos sorted by recent activity"


Param · Type · Required · Default
`owner` · string · yes · —
`type` · `owner` \ · `member` · no · `owner`

---

#### `get_repo`
Get detailed stats for a specific repository.```
"Tell me about facebook/react — stars, forks, language, open issues"
Param Type Required
owner string yes
repo string yes

Issues

list_issues

List issues with labels and assignees.```
"Show all open bugs in my repo"


Param · Type · Required · Default
`owner` · string · yes · —
`repo` · string · yes · —
`state` · `open` \ · `closed` \ · `all` · no · `open`

---

#### `create_issue`
Create a new issue with labels.```
"Create an issue titled 'Login crashes on Safari' with labels bug and priority"
Param Type Required
owner string yes
repo string yes
title string yes
body string no
labels string[] no

assign_issue

Add or remove assignees on an issue or PR.```
"Assign issue #42 to alice and bob"


Param · Type · Required · Default
`owner` · string · yes · —
`repo` · string · yes · —
`issue_number` · number · yes · —
`assignees` · string[] · yes · —
`action` · `add` \ · `remove` · no · `add`

---

### Pull Requests

#### `list_prs`
List pull requests by state.```
"What PRs are currently open in vercel/next.js?"

Param · Type · Required · Default
owner · string · yes · —
repo · string · yes · —
state · open \ · closed \ · all · no · open


create_pr

Create a pull request. Automatically detects the repo's default branch if base is omitted.```
"Create a PR from feat/dark-mode to main titled 'Add dark mode support'"


| Param | Type | Required | Default |
|---|---|---|---|
| `owner` | string | yes | — |
| `repo` | string | yes | — |
| `title` | string | yes | — |
| `body` | string | no | — |
| `head` | string | yes | — |
| `base` | string | no | repo default |

---

#### `get_pr_diff`
Get the unified diff of a pull request — up to 200 lines.```
"Show me the diff for PR #88"
Param Type Required
owner string yes
repo string yes
pull_number number yes

merge_pr

Merge with your chosen strategy.```
"Squash-merge PR #47 with title 'feat: dark mode'"


Param · Type · Required · Default
`owner` · string · yes · —
`repo` · string · yes · —
`pull_number` · number · yes · —
`method` · `merge` \ · `squash` \ · `rebase` · no · `merge`
`commit_title` · string · no · —

---

### Branches

#### `create_branch`
Create a branch from any base. Auto-detects default branch.```
"Create branch fix/header-overflow from main"
Param Type Required Default
owner string yes —
repo string yes —
branch string yes —
base string no repo default

delete_branch

Delete a branch — typically after merging.```
"Delete the feat/dark-mode branch, it's been merged"


| Param | Type | Required |
|---|---|---|
| `owner` | string | yes |
| `repo` | string | yes |
| `branch` | string | yes |

---

### Commits & Files

#### `list_commits`
View recent commit history with authors and timestamps.```
"Show the last 5 commits on the main branch"
Param Type Required Default
owner string yes —
repo string yes —
branch string no repo default
per_page 1–10 no 10

get_file

Read file content from any branch. Files over 100 lines are truncated.```
"Show me the contents of src/auth.ts on the dev branch"


| Param | Type | Required | Default |
|---|---|---|---|
| `owner` | string | yes | — |
| `repo` | string | yes | — |
| `path` | string | yes | — |
| `branch` | string | no | repo default |

---

#### `search_code`
Search code across GitHub.```
"Find all TypeScript files using useAuth hook"
Param Type Required Default
query string yes —
per_page 1–10 no 10

> GitHub's code search API requires authentication and has a rate limit of ~10 requests/minute. Results are cached for 120s.


Comments

add_comment

Comment on any issue or pull request.```
"Add a comment to PR #55 saying the deployment is ready for testing"


| Param | Type | Required |
|---|---|---|
| `owner` | string | yes |
| `repo` | string | yes |
| `issue_number` | number | yes |
| `body` | string | yes |

---

### Releases

#### `get_release`
Get the latest release or look up a specific tag.```
"What's the latest release of vercel/next.js?"
Param Type Required Default
owner string yes —
repo string yes —
tag string no latest

create_release

Publish a new release with release notes.```
"Create release v2.1.0 on the main branch with the changelog I'll paste"


| Param | Type | Required | Default |
|---|---|---|---|
| `owner` | string | yes | — |
| `repo` | string | yes | — |
| `tag_name` | string | yes | — |
| `name` | string | no | tag name |
| `body` | string | no | — |
| `draft` | boolean | no | `false` |
| `prerelease` | boolean | no | `false` |
| `target_commitish` | string | no | repo default |

---

### GitHub Actions

#### `list_workflows`
List all workflows in a repository.```
"What GitHub Actions workflows does this repo have?"
Param Type Required
owner string yes
repo string yes

trigger_workflow

Trigger a workflow dispatch event with optional inputs.```
"Trigger the deploy.yml workflow on the staging branch"


Param · Type · Required · Default
`owner` · string · yes · —
`repo` · string · yes · —
`workflow_id` · string \ · number · yes · —
`ref` · string · no · repo default
`inputs` · object · no · `{}`

---

## How It Works```
You (natural language)
        │
        ▼
   Claude AI
        │  MCP Protocol (stdio)
        ▼
┌──────────────────────────────────┐
│        lean-github-mcp           │
│                                  │
│  ┌─────────────────────────┐     │
│  │   19 Tool Handlers      │     │
│  └────────┬────────────────┘     │
│           │                      │
│  ┌────────▼─────┐  ┌──────────┐  │
│  │  Token Guard │  │  Cache   │  │
│  │  4000 char   │  │  120s    │  │
│  │  null strip  │  │  200 max │  │
│  └────────┬─────┘  └────┬─────┘  │
│           └──────┬───────┘        │
│                  ▼                │
│      ┌──────────────────┐         │
│      │  GitHub Client   │         │
│      │  Axios + Auth    │         │
│      │  Status codes    │         │
│      └──────────────────┘         │
└──────────────┬───────────────────┘
               │ HTTPS
               ▼
        api.github.com

Token Efficiency — Why It Matters

Every response the MCP server sends consumes your Claude context window. Bloated responses mean Claude forgets earlier parts of your conversation faster. This server aggressively minimizes response size:

Raw GitHub API response for a single repository:```json
{
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"private": false,
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "...",
... 20 more owner fields
},
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
... 80+ more fields, mostly null
}

**~2,400 tokens**

**This server's response:**```json
{
  "name": "Hello-World",
  "full_name": "octocat/Hello-World",
  "description": "This your first repo!",
  "stars": 2045,
  "forks": 1731,
  "language": "JavaScript",
  "open_issues": 12,
  "updated_at": "2024-01-15T10:30:00Z",
  "html_url": "https://github.com/octocat/Hello-World"
}

~90 tokens — 26x smaller


Real-World Example Conversations

Full PR workflow:```
You: Show me open PRs in my-org/my-repo

Claude: Found 3 open PRs:
#88 — "Add OAuth2 support" by sarah_dev
#91 — "Fix memory leak in worker" by john_k
#94 — "Upgrade to Node 22" by bot

You: Show me the diff for #91

Claude: [shows unified diff of the memory leak fix]

You: Looks good. Merge it with squash, then delete the branch

Claude: Done — squash merged PR #91 (sha: a3f9c21), deleted branch fix/memory-leak

You: Now create a release v3.2.1 from main with changelog: "Fixed memory leak in background workers"

Claude: Release v3.2.1 published — https://github.com/my-org/my-repo/releases/tag/v3.2.1

Four separate GitHub operations. One conversation.

---

**Automated triage:**```
You: List open issues in my-org/api-server, assign the ones labeled "bug" to me

Claude: Found 4 open issues. 2 have the "bug" label (#34, #41).
  Assigned #34 and #41 to you.

Testing```bash

npm run build
npx tsx tests/simulate-10-users.ts


Expected output:```
╔══════════════════════════════════════════════════════════╗
║     GitHub MCP Server - 10 User Deployment Test        ║
║          19 Tools · Full Coverage Simulation           ║
╚══════════════════════════════════════════════════════════╝
...
║  Total Tests:        49                  ║
║  Passed:             49                  ║
║  Failed:             0                   ║
║  Pass Rate:          100.0          %    ║
║  Null Fields Found:  0                   ║
║  Avg Response:       319            tokens ║
╚══════════════════════════════════════════╝
🎉 ALL TESTS PASSED! Ready for production.

You can also inspect live with the MCP Inspector:```bash
npx @modelcontextprotocol/inspector node dist/index.js


---

## Project Structure```
lean-github-mcp/
├── src/
│   ├── index.ts                  # MCP server entry, tool registration
│   ├── github-client.ts          # Axios client + getDefaultBranch helper
│   ├── middleware/
│   │   └── tokenGuard.ts         # Response trimmer: null strip, compactify, 4000 char limit
│   ├── utils/
│   │   └── cache.ts              # 120s TTL in-memory cache, max 200 entries
│   └── tools/                    # 19 tool handlers (one file each)
│       ├── list_repos.ts
│       ├── get_repo.ts
│       ├── list_issues.ts
│       ├── create_issue.ts
│       ├── assign_issue.ts
│       ├── list_prs.ts
│       ├── create_pr.ts
│       ├── get_pr_diff.ts
│       ├── merge_pr.ts
│       ├── create_branch.ts
│       ├── delete_branch.ts
│       ├── list_commits.ts
│       ├── get_file.ts
│       ├── search_code.ts
│       ├── add_comment.ts
│       ├── get_release.ts
│       ├── create_release.ts
│       ├── list_workflows.ts
│       └── trigger_workflow.ts
├── tests/
│   └── simulate-10-users.ts      # Full simulation test, 49 assertions
├── dist/                         # Compiled JS (after npm run build)
├── package.json
├── tsconfig.json
└── .env.example

Troubleshooting

GITHUB_TOKEN not setbash cat .env # make sure GITHUB_TOKEN=ghp_... is there

GitHub API (403): Rate limited or insufficient permissions
- Fine-grained tokens need explicit repository access — check the permissions table above
- Code search has a stricter limit (~10 req/min) — wait 60s and retry

GitHub API (404): Resource not found
- Double-check the owner and repo spelling
- Private repos need your token to have access to them

GitHub API (422): Unprocessable
- Usually means a PR already exists for that branch, or a branch name is invalid

Command not found: node in Claude Desktop
- Use the full path: C:\Program Files\nodejs\node.exe (Windows) or run which node on Mac/Linux


Contributing

Contributions are welcome — see CONTRIBUTING.md for a step-by-step guide to adding new tools, code conventions, and the PR checklist.


Roadmap

  • [ ] list_workflow_runs — view CI status for a branch
  • [ ] get_commit — detailed single commit with files changed
  • [ ] compare_branches — diff between two branches
  • [ ] update_file — commit a file change directly
  • [ ] add_label / remove_label — label management

Open an issue if you want something added.


License

MIT — do whatever you want with it.


Built for developers who'd rather talk to Claude than click through GitHub.

Report a bug · Request a feature

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Lean Github Mcp 怎么安装?

在客户端按下面的安装命令接入:npx -y @noushad999/lean-github-mcp。对应的包名是 @noushad999/lean-github-mcp。装完在客户端配置里引用同一个包或端点。

Lean Github Mcp 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Lean Github Mcp 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Lean Github Mcp 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Lean Github Mcp 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Lean Github Mcp 能提供哪些能力?

资料显示能力标签包括 github、mcp、claude、typescript、automation。具体工具清单以官方文档为准。

Lean Github Mcp 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

Lean Github Mcp 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。