Skip to main content
Glama

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"

ツールではなく検索が必要

gh_my_repos(visibility="public")

リポジトリ一覧1件

約14–280KB(完全なオブジェクト)

約2.4KB–(10個の削減済みオブジェクト)

書き込み

通常は利用可能

構造上不可能

ツール

ツール

戻り値

gh_whoami()

認証されたアカウント: ログイン、名前、公開リポジトリ数

gh_my_repos(visibility, limit, page)

自分のリポジトリ。更新が新しい順。visibility: all | public | private

gh_user_repos(username, limit, page)

任意のユーザーまたは組織の公開リポジトリ

gh_search_repos(query, limit, sort)

リポジトリ検索。sort: stars | forks | updated

gh_search_code(query, limit)

コード検索 — ヒットごとにリポジトリ、パス、URLのみで、スニペットなし

gh_issues(owner/repo, state, limit)

owner/name のIssue

gh_pulls(owner/repo, state, limit)

owner/name のプルリクエスト

gh_commits(owner/repo, limit, branch)

最近のコミット — sha、日付、作者、件名行

gh_file(owner/repo, path, ref)

1つのファイルの内容、またはディレクトリ一覧

すべてのlimitはデフォルトで 10 と、30 でクランプされます。gh_file は20k文字を超えると切り詰め、truncated フラグでその旨を知らせます。リポジトリは full_nameprivate、160文字の descriptionlanguagestarsupdatedurl — それ以外は返しません。

意図的に書き込み経路はありません。クライアントは api.github.com に対して GET を送るだけです。

Related MCP server: GitHub MCP Server

GitHubトークンを取得する

サーバーには1つのトークンが必要で、すべての呼び出しに使用します。読み取りアクセスのみが必要です。

  1. GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token に移動します。

  2. 有効期限を設定し、トークンがアクセスできるリポジトリを選択します — Public repositories only にすればプライベートデータがGitHubの外に出ることはありません。また gh_my_repos(visibility="private") を使いたい場合は All repositories を選びます。

  3. Repository permissions で、実際に必要なものへの読み取り専用アクセスを許可します:

    • Metadata: Read-only — 必須で、リポジトリ一覧と検索に十分です。

    • Contents: Read-onlygh_filegh_commits 用です。

    • Issues: Read-onlygh_issues 用です。

    • Pull requests: Read-onlygh_pulls 用です。

  4. Account permissions はすべてそのままにします。

  5. トークンをコピーします。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クライアントならどれでも使えます。

設定

変数

デフォルト

説明

GITHUB_MCP_TOKEN

すべてのAPI呼び出しに使用するGitHubトークン。必須。

GITHUB_MCP_SECRET

(空)

クライアントが Authorization: Bearer <secret> として送る共有シークレット。空だと認証無効。

GITHUB_MCP_PORT

9130

リッスンするポート。

GITHUB_MCP_PUBLIC_HOST

(空)

リバースプロキシの背後で使用する公開ホスト名。例: github-mcp.example.com

ポートが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

A
license - permissive license
Not graded
quality - not tested
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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides 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.
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables 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.
  • F
    license
    B
    quality
    D
    maintenance
    Enables 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.
    10
    121

View all related MCP servers

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.

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/0xBakeer/slim-github-mcp'

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