slim-github-mcp
slim-github-mcp
読み取り専用のGitHub MCPサーバーで、小さな結果を返します。
ほとんどのGitHub MCPサーバーは、モデルに生のGitHub APIオブジェクトを渡します。それは高速なAPIの背後にあるフロンティアモデルには問題ありませんが、ローカルモデルには苦痛です。リポジトリ検索結果の1ページはおよそ**14KBのJSON(約3.5kトークン)**で、その大半は誰も読まないURLと権限フラグです。さらにツールスキーマが約7kトークン加わると、ローカルホストのモデルは「リポジトリを一覧表示」に数分かかるか、または終わらないこともあります。
このサーバーは逆の立場を取ります。すべてのツールは役に立つフィールドを少しだけ返し、すべてのリストはサーバー側で上限が設定され、ツールの全体は9つの関数だけです。モデルは、どんな引数をでっち上げても、巨大なペイロードを取得できません。
一般的なGitHub MCP | slim-github-mcp | |
ツールスキーマ | 27ツール、約7.4kトークン | 9ツール、約830トークン |
"my public repos" | ツールではなく検索が必要 |
|
リポジトリ一覧1件 | 約14–280KB(完全なオブジェクト) | 約2.4KB–(10個の削減済みオブジェクト) |
書き込み | 通常は利用可能 | 構造上不可能 |
ツール
ツール | 戻り値 |
| 認証されたアカウント: ログイン、名前、公開リポジトリ数 |
| 自分のリポジトリ。更新が新しい順。 |
| 任意のユーザーまたは組織の公開リポジトリ |
| リポジトリ検索。 |
| コード検索 — ヒットごとにリポジトリ、パス、URLのみで、スニペットなし |
|
|
|
|
| 最近のコミット — sha、日付、作者、件名行 |
| 1つのファイルの内容、またはディレクトリ一覧 |
すべてのlimitはデフォルトで 10 と、30 でクランプされます。gh_file は20k文字を超えると切り詰め、truncated フラグでその旨を知らせます。リポジトリは full_name、private、160文字の description、language、stars、updated、url — それ以外は返しません。
意図的に書き込み経路はありません。クライアントは api.github.com に対して GET を送るだけです。
Related MCP server: GitHub MCP Server
GitHubトークンを取得する
サーバーには1つのトークンが必要で、すべての呼び出しに使用します。読み取りアクセスのみが必要です。
GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token に移動します。
有効期限を設定し、トークンがアクセスできるリポジトリを選択します — Public repositories only にすればプライベートデータがGitHubの外に出ることはありません。また
gh_my_repos(visibility="private")を使いたい場合は All repositories を選びます。Repository permissions で、実際に必要なものへの読み取り専用アクセスを許可します:
Metadata: Read-only — 必須で、リポジトリ一覧と検索に十分です。
Contents: Read-only —
gh_fileとgh_commits用です。Issues: Read-only —
gh_issues用です。Pull requests: Read-only —
gh_pulls用です。
Account permissions はすべてそのままにします。
トークンをコピーします。GitHub が表示するのは一度だけです。
repo スコープを持つクラシックトークンでも動作しますが、このサーバーに必要な範囲よりかなり広いため、fine-grained トークンを推奨します。
未認証のGitHub API呼び出しは1時間あたり60リクエストの制限があるため、実際にはトークンなしでは話にりません。トークンがあれば1時間あたり5,000リクエストできます。
インストール
git clone https://github.com/0xBakeer/slim-github-mcp.git
cd slim-github-mcp
python3 -m venv venv
./venv/bin/pip install -r requirements.txt
cp .env.example .env
$EDITOR .env # put your token in GITHUB_MCP_TOKEN実行します:
set -a; . ./.env; set +a
./venv/bin/uvicorn slim_github_mcp.main:app --host 127.0.0.1 --port "${GITHUB_MCP_PORT:-9130}"起動してトークンが機能することを確認します:
curl -s http://127.0.0.1:9130/api/health
curl -s -H "Authorization: Bearer $GITHUB_MCP_SECRET" \
'http://127.0.0.1:9130/api/my-repos?visibility=public&limit=5'MCPエンドポイント自体は次のとおりです:
http://127.0.0.1:9130/tools/mcp/v1ストリーミングHTTPを話すため、URLを受け付けるMCPクライアントならどれでも使えます。
設定
変数 | デフォルト | 説明 |
| — | すべてのAPI呼び出しに使用するGitHubトークン。必須。 |
| (空) | クライアントが |
|
| リッスンするポート。 |
| (空) | リバースプロキシの背後で使用する公開ホスト名。例: |
ポートがlocalhost以外から到達できる場合は GITHUB_MCP_SECRET を必ず設定してください。 サーバーはあなたのプライベートリポジトリを読み取れる可能性のあるトークンを保持しており、それ以外の場合、呼び出し元を認証しません。openssl rand -hex 24 で生成できます。
GITHUB_MCP_PUBLIC_HOST があるのは、MCPがデフォルトでDNSリバインディング保護を有効にするためです。リバースプロキシから届いたリクエストは、公開された Host ヘッダーを持ち、そのホスト名が宣言されていない限り拒否されます。忘れると、/api/health は正常なのにMCPエンドポイントだけ 400 を返すという症状が出ます。
サービスとして実行する
scripts/github-mcp.service はsystemdユニットで、User とパスを設定し、EnvironmentFile を上記の変数を保持するroot所有の 0600 ファイルに指定します。トークン はユニットファイル自体には置かないでください。
Dockerfile もあります:
docker build -t slim-github-mcp .
docker run -d --name github-mcp -p 127.0.0.1:9130:9130 --env-file .env slim-github-mcpリバースプロキシの裏で使う
複雑なことはありません。ただしMCPのストリームを維持するため、バッファリングは必ずオフにします:
location /tools/mcp/ {
proxy_pass http://127.0.0.1:9130;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
}GITHUB_MCP_PUBLIC_HOST をプロキシ元のホスト名に設定します。
Open WebUI で使う
Open WebUIはMCPをネイティブに話せます(0.6.x 以降)。ヘルパースクリプトでサーバーを登録します:
export OPEN_WEBUI_URL=https://webui.example.com
export OPEN_WEBUI_KEY=sk-... # Settings -> Account -> API keys
export GITHUB_MCP_URL=http://127.0.0.1:9130/tools/mcp/v1
export GITHUB_MCP_SECRET=... # if you set one
./scripts/register-open-webui.sh既存のツールサーバーとIDでマージされるため、再実行すると更新されます。そのあと、検出したツールを出力します:
==> Verifying tool discovery
9 tools: gh_whoami, gh_my_repos, gh_user_repos, ...手動で行う場合: Admin Settings → Tools → Add Other Server、タイプは MCP、URLは上のURL、Auth はシークレットを Bearer で指定します。
見落としやすい点が2つあります:
チャットのツールピッカーでツールを有効にする。 登録したサーバーが自動的に選択されるわけではありません。
モデルごとにツールを固定している場合(Workspace → Models → Tools)、そこにも追加してください。Open WebUI では
server:mcp:<id>として保存されます。あとでサーバーをidを変更すると固定参照は静かに消え、モデルはツールなしで、推測で答えます。
知っておくと良い点: tool_ids 付きで直接 /api/chat/completions を呼び出しても、ツールサーバーは接続されません。ツールの配線はフロントエンドで行われるため、UI 経由でテストしてください。
ライセンス
MIT
This server cannot be installed
Maintenance
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
- FlicenseNot gradedqualityDmaintenanceProvides comprehensive access to GitHub repositories, issues, pull requests, commits, user profiles, and statistics through 10 tools with natural language query support and advanced search capabilities.
- FlicenseNot gradedqualityNot gradedmaintenanceEnables LLMs to interact with GitHub repositories, issues, pull requests, and workflows through the Model Context Protocol. It provides a comprehensive set of tools for repository management, issue tracking, code search, and CI/CD automation.
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with GitHub repositories, issues, pull requests, code, and more through a comprehensive set of tools.
- FlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10121
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/0xBakeer/slim-github-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server