safe-fix-mcp
safe-fix-mcp
Python 저장소에서 데드 코드를 찾고, 실제로 안전하게 자동 제거할 수 있는 한 가지 유형(단일 이름 가져오기 줄의 사용되지 않는 import)에 대해 브랜치 + PR을 제안하는 실제 MCP 서버입니다. 그 외에 찾은 것들(사용되지 않는 함수, 클래스, 사용되지 않는 의존성)은 보고만 합니다. 병합은 항상 사람이 합니다. 이 도구는 스스로 아무것도 병합하지 않습니다.
왜 이게 필요한가
대부분의 "데드 코드" 도구는 보고에서 멈춥니다. 더 나아가는 도구들도 대개 안전장치 없이 삭제합니다. 이 도구는 둘 다 아닙니다: 제거 후 대상 저장소의 전체 테스트 스위트가 실제로 통과하는지 확인한 뒤에만, 실제적이고 최소한의 검토 가능한 PR을 초안으로 작성합니다. 휴리스틱이 아니라 실제 pytest 실행입니다. 스위트가 실패하면 아무것도 커밋하거나 푸시하지 않으며, 저장소는 처음과 똑같이 남습니다.
Related MCP server: code-review-mcp-server
도구
scan_dead_code(repo_path=".", min_confidence=60)
읽기 전용입니다. vulture(데드 코드)와 deptry(의존성 문제)를 실행하고 사람이 읽을 수 있는 결과 목록을 반환합니다. 아무것도 수정하지 않습니다.
propose_removal_pr(repo_path=".")
작업 트리가 더티하면 거부합니다. 커밋되지 않은 작업 위에서 절대 편집하지 않습니다.
단일 이름 가져오기 줄에서만 vulture 신뢰도 ≥90%인 사용되지 않는 import로 필터링합니다(
from x import y, z는 건너뜁니다. 전체 줄을 제거하면z도 조용히 제거되기 때문입니다).실제 브랜치를 만들고, 해당하는 import를 제거하고, 저장소의 실제 전체 테스트 스위트를 실행합니다.
실제 통과 시에만: 커밋, 푸시,
gh pr create로 PR 열기를 시도합니다.gh가 설치/인증되지 않은 경우에도 브랜치는 실제로 커밋되고 푸시됩니다. PR 생성만 실패하며, 실제 오류가 반환되므로 수동으로 열 수 있습니다.
설치
pip install -e .MCP 클라이언트 구성에 추가합니다(예: Claude Code):
claude mcp add safe-fix-mcp -- safe-fix-mcp또는 로컬 테스트를 위해 직접 실행:
python -m safe_fix_mcp.server요구 사항
Python ≥ 3.10
PATH에
gitpropose_removal_pr가 실제로 PR을 열려면 PATH에gh(GitHub CLI)가 설치·인증되어 있어야 합니다. 없어도 브랜치는 실제로 푸시되며, 도구가 수동으로 PR을 열라고 안내합니다.
개발
pip install -e ".[dev]"
pytest알려진 제한 사항
vulture는 scan_dead_code/propose_removal_pr 자체를 "사용되지 않음"으로 표시합니다. 알려진 오탐 클래스이지 실제 버그가 아닙니다. 이들은 런타임에 @mcp.tool() 데코레이터로 디스패치되며 소스 어디에서도 직접 호출되지 않으므로 정적 호출 그래프 분석으로는 실제 호출자(MCP 프레임워크 자체)를 볼 수 없습니다.
실제 검증
scripts/verify_real_client.py는 패키징된 서버를 실제 하위 프로세스로 실행하고 실제 mcp.client.ClientSession으로 통신합니다. 실제 MCP 클라이언트가 사용하는 것과 동일한 경로입니다. 변경 후 스모크 테스트로 유용합니다:
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
- Alicense-qualityAmaintenanceEnables automated code review and GitHub PR commenting through MCP integration.439MIT
- Alicense-qualityDmaintenanceEnables AI-powered code review and improvement, including analysis, refactoring suggestions, and automatic test generation, with an optional agentic loop for iterative refinement.MIT
- Alicense-qualityCmaintenanceEnables 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