Skip to main content
Glama

repo-guardian

MCP server exposing repo-health tools so any agent can guard repositories — detect pinned/unpinned dependencies, license compliance issues, hardcoded secrets, and dead code.

Features

  • audit_dependencies — Parse pyproject.toml, requirements*.txt, and setup.py; flag exact pins that may miss security patches and dependencies with no version constraints.

  • check_licenses — Scan declared dependency licenses for compliance issues (GPL/AGPL copyleft, unknown licenses, license incompatibilities with the project license).

  • scan_for_secrets — Search for AWS keys, GitHub tokens, Slack tokens, Google API keys, Stripe keys, private key blocks, password assignments, bearer tokens, and high-entropy strings.

  • find_dead_code — Detect unused Python imports, unused functions, and orphaned files.

All scanners are dependency-free (stdlib only) and never crash the MCP session — errors are returned as tool results.

Related MCP server: SentinelMCP

Installation

pip install repo-guardian

For development:

git clone https://github.com/prem-the-dev/repo-guardian.git
cd repo-guardian
pip install -e ".[dev]"

Quickstart (Claude Desktop / Cursor / Windsurf)

Add to your MCP client config:

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "repo-guardian": {
      "command": "python",
      "args": ["-m", "repo_guardian"]
    }
  }
}

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "repo-guardian": {
      "command": "python",
      "args": ["-m", "repo_guardian"]
    }
  }
}

Windsurf (.codeium/windsurf/mcp.json)

Same config as Cursor above.

Gemini CLI (gemini/.gemini/.mcp.json)

{
  "mcpServers": {
    "repo-guardian": {
      "command": "python",
      "args": ["-m", "repo_guardian"]
    }
  }
}

Hermes Agent

Copy the bundled mcp.json into your Hermes profile or merge it with your existing MCP server config:

cp mcp.json ~/.hermes/profiles/mcp-specialist/mcp.json
hermes profile reload
{
  "mcpServers": {
    "repo-guardian": {
      "command": "python",
      "args": ["-m", "repo_guardian"]
    }
  }
}

Usage Examples

Once configured, any agent can call the tools:

Audit Dependencies

audit_dependencies(path="/path/to/my-project")

Returns:

{
  "status": "ok",
  "scanned_files": ["pyproject.toml", "requirements.txt"],
  "total_dependencies": 4,
  "pinned_dependencies": [
    {"name": "Django", "version_spec": "==4.2.7", "classification": "pinned"}
  ],
  "potential_issues": [
    {"type": "pinned_exact", "dependency": "Django", "message": "..."}
  ]
}

Check Licenses

check_licenses(path="/path/to/my-project")

Returns:

{
  "status": "ok",
  "project_license": "MIT",
  "restricted_licenses": [],
  "unknown_licenses": [...],
  "potential_issues": []
}

Scan for Secrets

scan_for_secrets(path="/path/to/my-project", max_file_size_mb=5)

Returns:

{
  "status": "ok",
  "total_findings": 3,
  "findings": [
    {"type": "aws_access_key", "file": ".env", "line": 2, "confidence": "high"},
    {"type": "github_token", "file": "config.py", "line": 5, "confidence": "high"}
  ]
}

Find Dead Code

find_dead_code(path="/path/to/my-project")

Returns:

{
  "status": "ok",
  "unused_imports": [
    {"type": "unused_import", "file": "main.py", "line": 3, "name": "unused_module"}
  ],
  "unused_functions": [
    {"type": "unused_function", "file": "main.py", "line": 12, "name": "unused_function"}
  ],
  "orphaned_files": [...]
}

Running Tests

python -m pytest tests/ -v

Architecture

graph TD
    A[MCP Client<br/>Claude/Cursor/Windsurf/Hermes] -->|stdio JSON-RPC| B[MCP Server<br/>repo_guardian]
    B --> C[Tool Registry<br/>tools/list + tools/call]
    C --> D[audit_dependencies]
    C --> E[check_licenses]
    C --> F[scan_for_secrets]
    C --> G[find_dead_code]
    D --> D1[pyproject.toml parser]
    D --> D2[requirements.txt parser]
    D --> D3[setup.py parser]
    E --> E1[SPDX license DB<br/>offline lookup]
    E --> E2[Project license<br/>detect]
    F --> F1[Pattern matchers<br/>AWS/GH/Slack/etc]
    F --> F2[Shannon entropy<br/>high-entropy scan]
    G --> G1[AST parser<br/>imports + defs]
    G --> G2[Cross-file<br/>usage tracker]

License

MIT

Available Tools

4 tools
audit_dependenciesA

Audit Python project dependencies for outdated, missing or pinned-to-fixed-version packages. Reads pyproject.toml, requirements*.txt and setup.py/setup.cfg.

Inputs: path.

check_licensesA

Scan declared dependency licenses for potential compliance issues (e.g. GPL, AGPL, or missing license metadata).

Inputs: path.

find_dead_codeA

Detect unused Python imports, unused functions and orphaned files (e.g. files never imported or referenced).

Inputs: path.

scan_for_secretsB

Search the repository for hardcoded secrets, high-entropy tokens and other potential credential leaks.

Inputs: path, max_file_size_mb.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a clearly distinct concern: dependency hygiene, license compliance, secrets, and dead code. There is no meaningful overlap between them, so an agent can confidently select the right tool for a given task.

    Naming Consistency5/5

    All four tool names follow the same imperative verb_noun pattern: audit_dependencies, check_licenses, scan_for_secrets, find_dead_code. The naming is uniform, predictable, and easy to extend with additional checks.

    Tool Count5/5

    Four tools is a focused, well-scoped set for a repository auditing/guardian server. Each tool covers a meaningful area without redundancy or bloat.

    Completeness4/5

    The set covers the main repository health/security concerns: dependencies, licenses, secrets, and dead code. Minor gaps exist, such as no vulnerability/CVE scanning or remediation/generation tools, but the core read-only auditing surface is coherent and usable.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to scan codebases, persist and prioritize security findings against SLAs, retrieve CVE details, propose fixes, and create tickets through its tools. It also supports agent-assisted remediation drafting while enforcing human approval and preventing auto-merge.
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to run deterministic, fully local static security and compliance audits of code, configurations, and dependencies through 32 MCP tools covering 24 vulnerability categories. It also detects the project stack, generates risk reports and checklists, suggests stack-aware remediations, and re-validates fixes to confirm vulnerabilities were eliminated.
      32
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to analyze repository architecture, changed-file and diff impact, dependency and endpoint exposure, API contract compatibility, architecture boundaries, bounded capacity simulations, and security/quality evidence through MCP tools.
      3
      Apache 2.0