Lightweight GitHub MCP server with minimal context and CLI-first data fetches
Project description
Lite GitHub MCP Server
Minimal, context-efficient MCP server for GitHub with a CLI-first approach.
Requirements
- Python 3.10+
- git, gh CLI installed (for later milestones)
Quickstart
# Install uv (https://github.com/astral-sh/uv)
# Then setup dev env
just setup
# Run tests
just test
# Run server
just run
# Format and lint
just fmt && just lint
Run with uvx (no local checkout required)
# One-off run of the MCP server from PyPI using uvx
uvx lite-github-mcp
# CLI client (tools introspection and tool calls)
uvx lite-github-mcp-cli tools
uvx lite-github-mcp-cli call gh.ping
Open WebUI integration (MCP)
- With an MCP orchestrator (mcpo): point mcpo at the command
uvx lite-github-mcp.
# Example mcpo config snippet
servers:
github:
command: ["uvx", "lite-github-mcp"]
- Without mcpo: if your Open WebUI supports direct MCP command configuration, set it to
uvx lite-github-mcp.
# Example: environment-driven configuration (adjust to your Open WebUI setup)
export MCP_SERVER_GITHUB_COMMAND="uvx lite-github-mcp"
Packaging and builds
- Uses uv's build backend (
uv_build) for PEP 517 builds, driven viauv build. - Dev dependencies are managed with
[dependency-groups]and installed viauv sync --group dev. - Publishing is automated in GitHub Actions on Release creation.
Docker
just docker_build
just compose_up
# ... use it ...
just compose_down
Notes
- Targets Python 3.10+;
uvloopremains optional on Linux. gh.pingandgh.whoamiare available;whoamireturns a minimal auth status.- For FastMCP concepts and up-to-date API details, see the MDX docs: https://github.com/jlowin/fastmcp/tree/main/docs
Observability (optional)
- Structured JSON logging for tool calls (opt-in):
# Enable lightweight timing logs (one line per tool call)
LGMCP_LOG_JSON=1 just run
# or
LGMCP_LOG_JSON=1 uv run python -m lite_github_mcp.server
Emitted fields: tool, arg_keys, duration_ms, optional error.
- Caching and ETag:
# Disk-backed cache using `diskcache` under XDG cache dir
# ETag-based conditional requests are enabled for GitHub REST via gh api
# Cache TTLs: lists=30s, meta=5m, blobs=1h
# Automatic rate-limit backoff with Retry-After respected (bounded retries)
- Context budget checks:
- CI enforces budgets for the tool registry (bytes and token estimates)
- Local live test (schema-aware):
# Run only the marked context test and print a brief report
just test_context
# Or with pytest directly
uv run pytest -q -m context_budget -s
You’ll see a short report like:
Context budget (tool registry):
minimal bytes: 1084 / 8192 (13.2%)
full bytes: 5628 / 32768 (17.2%)
tokens: 1407 / 4000 (35.2%)
CLI examples (paging and ranges)
# List tools
# Mono-tool by default; set multi-tool mode via env:
# LGMCP_MULTI_TOOLS=1 just cli_tools
just cli_tools
# Trees (limit, cursor)
just cli_call gh.file.tree '{"repo_path": ".", "ref": "HEAD", "limit": 3}'
# Use the returned next_cursor to fetch next page
just cli_call gh.file.tree '{"repo_path": ".", "ref": "HEAD", "limit": 3, "cursor": "<next>"}'
# Search (limit, cursor)
just cli_call gh.search.files '{"repo_path": ".", "pattern": "FastMCP", "limit": 2}'
# Restrict search to paths
just cli_call gh.search.files '{"repo_path": ".", "pattern": "TODO", "paths": ["src/", "docs/"]}'
# Blob ranges (offset, max_bytes)
just cli_call gh.file.blob '{"repo_path": ".", "blob_sha": "<sha>", "max_bytes": 128, "offset": 0}'
# PRs (ids-first, meta, timeline)
just cli_call gh.pr.list '{"repo": "gsornsen/lite-github-mcp-server", "state": "open", "limit": 10}'
just cli_call gh.pr.get '{"repo": "gsornsen/lite-github-mcp-server", "number": 3}'
just cli_call gh.pr.timeline '{"repo": "gsornsen/lite-github-mcp-server", "number": 3, "limit": 5}'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lite_github_mcp-0.4.0.tar.gz.
File metadata
- Download URL: lite_github_mcp-0.4.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ba85315129a2f794f668c5c6755057da229c4b6f93e42a3645b527eb9c6a28c
|
|
| MD5 |
51fa46c9dcf1629631c98651c4331804
|
|
| BLAKE2b-256 |
ee22212e4302c845da0647c9156cf80f153496c22f72b28e40fa5f99635ab594
|
Provenance
The following attestation bundles were made for lite_github_mcp-0.4.0.tar.gz:
Publisher:
publish.yml on gsornsen/lite-github-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lite_github_mcp-0.4.0.tar.gz -
Subject digest:
3ba85315129a2f794f668c5c6755057da229c4b6f93e42a3645b527eb9c6a28c - Sigstore transparency entry: 621817577
- Sigstore integration time:
-
Permalink:
gsornsen/lite-github-mcp-server@f6e7b2aef2a617adaf5c95da438fa6e7328f0156 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gsornsen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6e7b2aef2a617adaf5c95da438fa6e7328f0156 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file lite_github_mcp-0.4.0-py3-none-any.whl.
File metadata
- Download URL: lite_github_mcp-0.4.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f984456ec74881be9a11afe13b78ed6733e667ededa2cee8a15325d2d1799496
|
|
| MD5 |
b05965f44d500785cd02ac940d825fb0
|
|
| BLAKE2b-256 |
f670363a86281d7d05da667a6d431dc9c7f2f683a2bb6034e5c703c9f2ae9b19
|
Provenance
The following attestation bundles were made for lite_github_mcp-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on gsornsen/lite-github-mcp-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lite_github_mcp-0.4.0-py3-none-any.whl -
Subject digest:
f984456ec74881be9a11afe13b78ed6733e667ededa2cee8a15325d2d1799496 - Sigstore transparency entry: 621817580
- Sigstore integration time:
-
Permalink:
gsornsen/lite-github-mcp-server@f6e7b2aef2a617adaf5c95da438fa6e7328f0156 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gsornsen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6e7b2aef2a617adaf5c95da438fa6e7328f0156 -
Trigger Event:
workflow_dispatch
-
Statement type: