Shimguard

io.github.RudrenduPaul由 GitHub 帳號 RudrenduPaul 發布v0.1.5更新於 Oct 24, 2026

Wraps the ShimGuard CLI as a single generic MCP tool for agent-shim provenance checks.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理執行 ShimGuard 命令列工具,檢查標記為已修復的 GitHub issue 是否真的引用了已合併的拉取請求。

可以做什麼
透過單一通用工具執行 ShimGuard 命令列工具,接受與 CLI 相同的參數,並回傳結束碼、標準輸出、標準錯誤以及可解析的 JSON 報告。核查 GitHub 儲存庫中標記為已修復的 issue 所引用的拉取請求是否真的已合併,給出 MATCH、MISMATCH 或 UNVERIFIED 結論。可選擇檢查被引用檔案在儲存庫最新版本中是否仍包含指定程式碼樣式,讓已合併但漏洞程式碼仍在的情況仍被標記為不符。產生穩定的 JSON 報告,方便腳本、CI 閘門或儀表板使用。
適用情境
當你希望助理稽核 GitHub issue 追蹤器,確認標記為已修復的 issue 確實有已合併的修正時使用,例如在信任安全修正之前,或在 CI 中依追蹤器聲明做閘門時。它是狹窄的機械式核查,不是通用的漏洞或金鑰掃描工具。
執行需求
以本機程序在使用者機器上執行,從 PyPI 安裝含 MCP 附加元件的套件(需要 Python 3.9 或更新版本),並以 shimguard-mcp 指令啟動。需要連線至 GitHub REST API 的網路存取。GitHub 權杖為選用:未驗證時限制為每小時 60 次請求,透過 GITHUB_TOKEN 或權杖參數可提高到每小時 5,000 次。
安裝前請注意
此伺服器提供通用 run 工具,會以助理提供的參數執行 ShimGuard 命令列,因此應留意實際執行的指令。它只發出唯讀的 GitHub API 請求,不會修改儲存庫。透過 GITHUB_TOKEN 或權杖參數傳入的 GitHub 權杖會帶來更廣的 API 存取權限,應限定範圍並妥善保管。可選的樣式檢查會編譯正規表示式並讀取目標儲存庫的檔案內容,只應對你自己撰寫或審閱過的檔案使用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Shimguard,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ShimGuard

[CI] [License: MIT] [npm] [PyPI version]

Verify that a GitHub issue closed as "fixed" actually has a merged fix, before you trust the tracker.

[Installing shimguard-cli from npm and running its first verify command against the real sybil-solutions/codex-shim repo, reporting 2 MISMATCH results]

bash
npx shimguard-cli verify sybil-solutions/codex-shim --issues 38,41,42,43,45,46

That single command against the real sybil-solutions/codex-shim repo (1,000+ stars) turns up 6 MISMATCH results: 6 security issues, each closed with a "Fixed in PR #52" comment, where PR #52 was never actually merged. The vulnerable code is still in main today. Nobody reading the closed issues would know.

Contents

Why this exists

Reading an issue tracker, you trust two signals: the issue's state (open or closed) and the maintainer's closing comment ("fixed in #N"). Neither signal is verified against reality by GitHub itself. A maintainer can close an issue citing a PR that never merged, an automated bot can close on a "fixes #N" keyword in a PR description before that PR lands, or a fix can get reverted after the issue was already closed. Any of these leaves a tracker saying "fixed" about a bug that is still live.

ShimGuard checks the one thing a human skimming issues does not: does the PR the tracker cites as the fix actually show merged: true? It is a small, mechanical, unambiguous check, not a heuristic or a guess.

Install

ShimGuard ships two independent, equally first-class packages -- pick whichever fits your toolchain, or install both. Neither is deprecated in favor of the other; both implement the same "closed issue cites Fixed in PR #N, is #N actually merged" check against the same GitHub REST API.

bash
# npm -- JavaScript/TypeScript CLI + librarynpm install -g shimguard-cli# or run it once with no installnpx shimguard-cli verify <owner>/<repo> --issues <numbers>
# PyPI -- Python CLI + library (genuine port, not a wrapper around the Node binary)pip install shimguard-cli

The npm CLI requires Node.js 18 or later (uses the built-in fetch API). The Python package's CLI entry point is also shimguard (e.g. shimguard verify sybil-solutions/codex-shim --issues 45,46); see python/README.md and docs/getting-started.md for the Python-specific walkthrough, and CHANGELOG.md for each distribution's version history.

Quickstart

bash
shimguard verify sybil-solutions/codex-shim --issues 38,41,42,43,45,46
ShimGuard v0.1 -- Tracker Verification: sybil-solutions/codex-shim
[MISMATCH] Issue #45 "_resolve_api_key silently falls back to Cursor API key for any model with an empty api_key, forwarding it to arbitrary upstream URLs"  https://github.com/sybil-solutions/codex-shim/issues/45  Cited fix: PR #52 (open, not merged)  Issue is closed and cites PR #52 as the fix, but that PR is open and was never merged.
Summary: 6 MISMATCH, 0 MATCH, 0 UNVERIFIED (6 checked)

Exit code is 1 when any MISMATCH is found (useful for gating CI), 0 when every checked issue's claimed fix actually merged, 2 on a usage or network error.

ShimGuard is not just a gotcha finder: run it against a mix of issues and it correctly reports MATCH, UNVERIFIED, and MISMATCH side by side, exiting 0 whenever nothing is provably broken -- exactly the signal a CI gate needs.

[Running shimguard verify against a mix of issues in the real sybil-solutions/codex-shim repo: one MATCH (merged fix), one UNVERIFIED (no cited fix), exit code 0 since nothing is provably broken]

Optional: verify the code, not just the merge status

For an even stronger check, point ShimGuard at the specific file and pattern an issue named as the vulnerable code:

bash
cat > patterns.json <<'EOF'{  "45": { "path": "codex_shim/settings.py", "pattern": "cursor_key_fallback" }}EOF
shimguard verify sybil-solutions/codex-shim --issues 45 --patterns patterns.json

If the PR is merged but the cited pattern is still present in the file at HEAD, ShimGuard still reports MISMATCH: a merged PR does not guarantee the specific vulnerable line was actually removed.

[!WARNING] pattern is compiled as a JavaScript RegExp, and path is validated to stay within the target repo (no .. traversal to a different repo or API endpoint). Only point --patterns at files you wrote or reviewed yourself. See SECURITY.md.

CLI reference

Usage: shimguard [options] [command]
Verify that GitHub issues closed as "fixed" actually have a merged fix. Catchessecurity issues marked fixed whose PR was never merged.
Options:  -V, --version            output the version number  -h, --help               display help for command
Commands:  verify [options] <repo>  Check whether closed issues in a repo actually have                           a merged fix  help [command]           display help for command
Usage: shimguard verify [options] <repo>
Check whether closed issues in a repo actually have a merged fix
Arguments:  repo                target repo as <owner>/<repo>, e.g.                      sybil-solutions/codex-shim
Options:  --issues <numbers>  comma-separated issue numbers to check, e.g. 38,41,42  --patterns <file>   JSON file mapping issue number -> {path, pattern} for an                      optional code-pattern check  --token <token>     GitHub token for higher API rate limits (defaults to                      $GITHUB_TOKEN)  --format <format>   output format: text or json (default: "text")  -h, --help          display help for command

--format json output is stable and designed for scripts and AI agents to parse directly:

json
{  "repo": "sybil-solutions/codex-shim",  "checked": 1,  "summary": { "mismatch": 1, "match": 0, "unverified": 0 },  "results": [    {      "issue": { "number": 45, "title": "...", "state": "closed", "htmlUrl": "..." },      "citedPullRequest": { "number": 52, "state": "open", "merged": false, "htmlUrl": "..." },      "patternCheck": null,      "verdict": "MISMATCH",      "reason": "Issue is closed and cites PR #52 as the fix, but that PR is open and was never merged."    }  ]}

[Running shimguard verify with --format json against the real sybil-solutions/codex-shim repo, printing the structured JSON verdict for issue 45]

MCP Server

ShimGuard ships a Model Context Protocol server, so an MCP-compatible agent (Claude Desktop, Claude Code, Cursor, or any other MCP client) can call it as a tool instead of shelling out to the CLI and parsing text. It's part of the Python distribution:

bash
pip install "shimguard-cli[mcp]"

Register it with an MCP client such as Claude Desktop:

json
{  "mcpServers": {    "shimguard": {      "command": "shimguard-mcp"    }  }}

It exposes a single tool, run, that takes the exact argv you'd pass to the shimguard CLI and returns a structured result ({returncode, stdout, stderr, json?} on success, {error: ...} if the command failed, timed out, or exited non-zero). Example call:

run(args=["verify", "sybil-solutions/codex-shim", "--issues", "45,46", "--format", "json"])

which returns the same --format json report shown above, as a parsed json field alongside the raw stdout. Full details are in the Python package README.

Library API

ShimGuard's verification logic is also importable directly:

typescript
import { TrackerVerifier, RestGitHubClient, RegexPatternMatcher } from "shimguard-cli";
const client = new RestGitHubClient(process.env.GITHUB_TOKEN);const verifier = new TrackerVerifier(client, new RegexPatternMatcher(client));
const result = await verifier.verify({ owner: "sybil-solutions", repo: "codex-shim", number: 45 });console.log(result.verdict); // "MISMATCH"

TrackerVerifier takes any GitHubClient and an optional PatternMatcher (see src/types.ts, src/pattern-matcher.ts), both are interfaces, so a future local-config scanner or a different code host can plug in without changing the verifier itself.

The Python package exposes the same shape:

python
from shimguard import TrackerVerifier, RestGitHubClient, RegexPatternMatcher, IssueRef
client = RestGitHubClient()  # or RestGitHubClient(token=os.environ["GITHUB_TOKEN"])verifier = TrackerVerifier(client, RegexPatternMatcher(client))
result = verifier.verify(IssueRef(owner="sybil-solutions", repo="codex-shim", number=45))print(result.verdict)  # "MISMATCH"

How it compares

No existing open-source tool checks "this issue tracker says fixed-in-PR-#N, is #N actually merged." That claim is verified by searching for issue-fix-verification tools, patch-verification tools, and security-advisory-fix tools before writing this. The closest adjacent tools solve different problems:

ToolWhat it actually checksReads issue tracker / PR merge state?
ShimGuardDoes a GitHub issue's cited "fixed in PR #N" claim match PR #N's real merge state (and, optionally, is the cited code pattern gone from HEAD)Yes, this is the entire check
gitleaks / trufflehogSecrets committed to source (API keys, tokens)No, scans file content, not tracker state
trivy / grype / osv-scannerKnown CVEs in your dependency treeNo, scans a dependency manifest/lockfile, not tracker state
Vanir (Google)Whether a known CVE's code signature is still present in a target source treeNo, works from CVE-to-code, doesn't touch a GitHub issue tracker
VFCFinder (NC State, ASIACCS 2024)Finds a likely fix commit for an advisory that has no linked fix yetOpposite direction: finds a missing citation, doesn't verify an existing one

The gap ShimGuard fills is real, not theoretical. wow-actions/auto-close-fixed-issues, a GitHub Action used by other repos, closes an issue on a PR's closed event, not its merged event: a bot can mark an issue "fixed" the moment a PR is closed, whether or not it actually merged. GitHub's own native Closes #N keyword linking only auto-closes on a real merge to the default branch, so this specific failure mode comes from manual maintainer comments and third-party automation, not GitHub's own defaults, which is exactly why nothing catches it after the fact.

What is ShimGuard, and why does it exist

ShimGuard is a CLI and library, shipped as both an npm package and a PyPI package, that checks whether a GitHub issue's claimed fix ("Fixed in PR #N") is actually true, by checking the real merge state of that PR (and, optionally, whether the vulnerable code pattern is still present at HEAD). It exists because closing an issue with a citation to an unmerged PR is a real, observed failure mode, not a hypothetical one: sybil-solutions/codex-shim, a 1,000+-star project, has 6 security issues closed this way as of this writing, each citing the same unmerged PR #52. ShimGuard does not scan for secrets in source code (see gitleaks, trufflehog for that) and does not do general vulnerability scanning against dependencies (see osv-scanner, trivy, grype). It verifies one specific, narrow claim: does a tracker's "fixed" status match reality.

FAQ

Does ShimGuard modify my repo or the target repo? No. It only makes read-only GitHub API requests (issues, comments, pull requests, and optionally file contents). It never writes, comments, or mutates anything.

Does it need a GitHub token? No for occasional use. Unauthenticated requests work, subject to GitHub's standard rate limit (60 requests/hour). Set GITHUB_TOKEN or pass --token for the higher authenticated limit (5,000 requests/hour), useful in CI.

What counts as a "cited fix"? ShimGuard looks for phrases like "Fixed in PR #52", "fixed by #101", or "resolved in #20" in the issue body and its comments, and extracts the referenced PR number. If no such phrase is found, the result is UNVERIFIED, not MATCH or MISMATCH: ShimGuard never guesses.

Can I use this in CI? Yes. shimguard verify exits 1 when any MISMATCH is found, so a CI step can gate on it directly. --format json gives a stable, parseable report for a bot or dashboard.

Why "ShimGuard" if it doesn't scan BYOK shim configs? An earlier framing of this idea was a broader local-config security scanner for BYOK (bring-your-own-key) model shims. That scope was narrowed to the sharper, more defensible wedge: verifying tracker claims against actual merged code, which is what shipped in v0.1. The name reflects the project's origin case (sybil-solutions/codex-shim, a BYOK model shim), not a scope this version doesn't have.

Does ShimGuard work on Windows, macOS, and Linux? The npm CLI requires Node.js 18 or later (for the built-in fetch API) and runs anywhere Node runs, including Windows, macOS, and Linux. The PyPI package requires Python 3.9 or later and lists itself as OS Independent in its own classifiers. Neither package has a native or compiled dependency.

How is ShimGuard different from gitleaks or trufflehog? Gitleaks and trufflehog scan file content for secrets accidentally committed to a repo, things like API keys and tokens. ShimGuard does not scan file content for secrets at all -- it checks GitHub's issue and pull-request API for one specific mismatch: an issue closed as "fixed in PR #N" where PR #N never actually merged. The two tool categories catch different failure modes and can run in the same pipeline without overlapping; see "How it compares" above for the full list of adjacent tools this project checked before writing a line of code.

Why might shimguard --version print a different number than the installed package? In some past releases, running shimguard --version reported a version string that lagged behind the installed package's actual version -- the version string passed to commander in src/cli.ts was not always bumped in the same release as a package.json version bump. It is a display-only mismatch and does not affect verify behavior. To check the actual installed version, read the package's own package.json or run npm view shimguard-cli version.

Does ShimGuard scan every closed issue in a repo automatically? No. You pass the specific issue numbers to check with --issues 38,41,42; ShimGuard does not currently walk a repo's full closed-issue history looking for cited-fix claims on its own. For a large repo, pick the issues you care about, for example the ones tagged security or tied to a release milestone.

Can I use ShimGuard in a commercial product or a paid CI pipeline? Yes. ShimGuard is MIT licensed (see LICENSE), which permits commercial use, modification, and redistribution, including inside a paid product or internal tool, with no royalty and no requirement to open-source your own code. Keeping the MIT notice is the only condition.

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT, see LICENSE.

來源:README.md,提交 15983bf

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.5最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分