safe-fix-mcp
Allows to propose removal pull requests for dead code (unused imports) on GitHub, after verifying the test suite passes.
Click on "Install 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., "@safe-fix-mcpscan repo for dead code and propose safe PR for unused imports"
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.
safe-fix-mcp
A real MCP server that finds dead code in a Python repository and proposes a branch + PR for the one class of finding that's actually safe to auto-remove: unused imports on a single-name import line. Everything else it finds — unused functions, classes, unused dependencies — stays report-only. A human always merges. This tool never merges anything itself.
Why this exists
Most "dead code" tools stop at reporting. The ones that go further usually delete with no safety net. This does neither: it drafts a real, minimal, reviewable PR, gated on the target repo's own full test suite actually passing after the removal — not a heuristic, a real pytest run. If the suite fails, nothing is committed or pushed; the repo is left exactly as it started.
Related MCP server: code-review-mcp-server
Tools
scan_dead_code(repo_path=".", min_confidence=60)
Read-only. Runs vulture (dead code) and deptry (dependency issues) and returns a human-readable list of findings. Never modifies anything.
propose_removal_pr(repo_path=".")
Refuses on a dirty working tree — never edits on top of uncommitted work.
Filters to unused imports at ≥90% vulture confidence, on single-name import lines only (
from x import y, zis skipped — removing the whole line would silently removeztoo).Creates a real branch, removes the qualifying imports, runs the repo's real full test suite.
Only on a real pass: commits, pushes, and tries to open a PR via
gh pr create.If
ghisn't installed/authenticated, the branch is still committed and pushed for real — only PR creation degrades, with the real error returned so you can open it manually.
Install
pip install safe-fix-mcpAdd to your MCP client config (e.g. Claude Code):
claude mcp add safe-fix-mcp -- safe-fix-mcpOr run directly for local testing:
python -m safe_fix_mcp.serverInstalling from source instead of PyPI:
pip install -e .Requirements
Python ≥ 3.10
giton PATHgh(GitHub CLI) on PATH and authenticated, if you wantpropose_removal_prto actually open the PR — without it, the branch still gets pushed for real, and the tool tells you to open the PR by hand.
Development
pip install -e ".[dev]"
pytestKnown limitation
vulture flags scan_dead_code/propose_removal_pr themselves as "unused" — a known false-positive class, not a real bug: they're dispatched by the @mcp.tool() decorator at runtime, not called directly anywhere in the source, so static call-graph analysis can't see the real caller (the MCP framework itself).
Verifying it for real
scripts/verify_real_client.py launches the packaged server as a real subprocess and talks to it with the real mcp.client.ClientSession — the same path a real MCP client uses. Useful as a smoke test after any change:
python scripts/verify_real_client.pyThis server cannot be installed
Maintenance
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
- FlicenseBqualityCmaintenanceEnables comprehensive security vulnerability scanning and code quality analysis for Python applications. Provides detailed reports with scoring, actionable suggestions, and comparison tracking specifically designed for backend developers working with frameworks like Django, Flask, and FastAPI.51
- AlicenseNot gradedqualityAmaintenanceEnables automated code review and GitHub PR commenting through MCP integration.439MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered code review and improvement, including analysis, refactoring suggestions, and automatic test generation, with an optional agentic loop for iterative refinement.MIT
- AlicenseNot gradedqualityCmaintenanceEnables automated Python code quality checks including linting, complexity analysis, typo detection, structure validation, duplicate detection, and test coverage, with integration into Cursor IDE and CLI.MIT
Related MCP Connectors
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Autonomous dev team steered from chat: plain-English requests in, tested merged PRs out.
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/pamela-0/safe-fix-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server