github-binary-mcp
Enables pushing, retrieving, and deleting binary files in allowlisted GitHub repositories via the GitHub Contents API and Git Data API, including multi-file commits, with path/repo allowlists and safety checks.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@github-binary-mcp push this base64 PNG to TanNhatCMS/dia-nguc-live at assets/logo.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
github-binary-mcp
MCP server riêng (stdio, Node zero-dependency) để push file nhị phân lên
GitHub — vá đúng chỗ tool GitHub chính thức thiếu: tool gốc chỉ nhận text
và tự base64, nên ảnh gửi qua đó thành chuỗi base64 chứ không phải ảnh.
Server này nhận content_base64 và chuyển nguyên văn cho GitHub API.
Tools
push_binary_file— 1 file nhị phân (Contents API).push_binary_files— tối đa 20 file trong 1 commit (Git Data API).get_binary_file— đọc file về dạng base64.delete_file— xoá file trong phạm vi cho phép.
Related MCP server: @brycepelletier/github-app-mcp
Cơ chế bảo mật (fail-closed)
Token GitHub chỉ lấy từ env
GITHUB_TOKEN. Không log, không trả về trong kết quả tool, không xuất hiện trong thông báo lỗi.Allowlist repo
GITHUB_BINARY_ALLOWED_REPOS(dạngowner/repo, cách nhau bằng dấu phẩy). Không đặt biến này = từ chối mọi push.Allowlist đường dẫn
GITHUB_BINARY_ALLOWED_PATHS(mặc định:assets/,public/,docs/,static/,images/). File ngoài các tiền tố này bị từ chối.Denylist luôn thắng:
.github/workflows/,.git/,*.env*,*.pem,*.key, tên chứacredentialshoặcsecret. Chặn leo thư mục...Chặn file thực thi: exe, dll, so, dylib, bat, com, scr, msi, appimage, deb, rpm.
Base64 phải hợp lệ và round-trip đúng, nếu không từ chối trước khi gọi API.
Audit log: 1 dòng JSON mỗi lần gọi (tool, repo, path, size, sha, ok/error), ra stderr. Không ghi content, không ghi token.
Giới hạn
10 MB mỗi file (sau giải mã), 50 MB mỗi commit nhiều file, tối đa 20 file/commit.
30 lần ghi/xoá mỗi giờ (rolling window, theo process). Đọc không giới hạn.
Không bypass branch protection: nếu nhánh bị bảo vệ, GitHub API tự từ chối.
Chạy và kiểm thử
GITHUB_BINARY_MOCK=1 node test.mjs # 14/14 pass, không chạm mạng
GITHUB_TOKEN=... GITHUB_BINARY_ALLOWED_REPOS=TanNhatCMS/dia-nguc-live node server.mjsMock mode (GITHUB_BINARY_MOCK=1) luôn thắng và mọi kết quả đều gắn
mock:true, không bao giờ nhầm thành push thật.
Triển khai lên gateway (chưa làm — cần chốt)
Tạo token GitHub cho server này (fine-grained, chỉ các repo trong allowlist, quyền Contents: Read and write).
Đặt server lên flex (STDIO) hoặc đóng gói chạy HTTP, đăng ký vào MetaMCP gateway, gắn vào namespace Public với tool policy allowlist.
Kiểm thử push thật lên 1 repo thử trước khi mở allowlist cho repo chính.
Trạng thái hiện tại: code + test mock xong, đã push lên GitHub tại https://github.com/TanNhatCMS/github-binary-mcp. Chưa triển khai lên flex, chưa có token thật, chưa kiểm thử push thật.
Available Tools
4 toolsdelete_fileB
Delete a file under the allowed path prefixes (same allowlist/denylist as push). Rate-limited like pushes.
Inputs: path (required), repo (required), owner (required), branch, +1 more.
get_binary_fileA
Read a file from a repo and return it as base64 (max 10 MB). Denied paths still apply; reads are not rate-limited.
Inputs: path (required), repo (required), owner (required), branch.
push_binary_fileA
Push one binary file (image, audio, PDF, zip, ...) to a GitHub repo. content_base64 is forwarded verbatim to the GitHub API — unlike the official GitHub MCP tool, which treats content as plain text. Repo must be in GITHUB_BINARY_ALLOWED_REPOS, path must be under GITHUB_BINARY_ALLOWED_PATHS, max 10 MB.
Inputs: path (required), repo (required), owner (required), content_base64 (required), +2 more.
push_binary_filesC
Push up to 20 binary files in a single commit via the Git Data API. Same allowlist, denylist and size limits (50 MB total).
Inputs: repo (required), files (required), owner (required), branch, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct action (push single, push batch, read, delete) and the descriptions clearly separate the single-file path (verbatim base64) from the multi-file commit path. The only mild overlap is push_binary_file vs push_binary_files, since a single file could plausibly go through either, but the cardinality and API mechanism differences are stated explicitly.
All four names are snake_case verb_noun and follow the same shape (push_binary_file(s), get_binary_file, delete_file). The only deviation is that delete_file and get_binary_file drop the 'push_' prefix while delete_file also omits 'binary', but the pattern remains predictable and readable.
Four tools is a tight, purposeful surface for a narrowly scoped binary-file server, and each one maps to a real operation. The single vs batch push pair is arguably a slight over-split of one capability, keeping it just under a perfect score.
Create/overwrite, read, and delete are covered, but there is no listing or path-discovery tool, so an agent must already know exact repo paths. GitHub's content API also requires a blob SHA to delete or update an existing file, and nothing states that get_binary_file returns one, leaving a likely dead end for delete/overwrite workflows.
Maintenance
Related MCP Connectors
Unofficial GitHub MCP — wraps the GitHub public REST API (no auth required for public endpoints)
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables managing GitHub repositories, files, and user information through MCP, with support for creating, updating, and deleting repository contents, as well as fetching user profiles.1-
- AlicenseNot gradedqualityCmaintenanceEnables secure GitHub App authenticated Git operations and GitHub API workflows through MCP, using ephemeral containers and a private key broker to protect credentials.14 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables self-hosted, read-only remote interaction with GitHub repositories, allowing listing repositories, searching code, and inspecting commits, pull requests, issues, and diffs via authenticated MCP clients.MIT
- FlicenseNot gradedqualityCmaintenanceEnables users to read and manage GitHub repositories through MCP, with destructive operations gated behind explicit confirmation and dry-run previews.1-