DEV Community

phuongrealmax
phuongrealmax

Posted on

Building Code Guardian Studio: An MCP Server for AI-Powered Code Refactoring

Managing large codebases is challenging. Finding what to refactor first, tracking technical debt, and maintaining context across long coding sessions can be overwhelming.

I built Code Guardian Studio to solve these problems using the Model Context Protocol (MCP).

What is Code Guardian Studio?

It's an MCP server that provides 80+ tools for:

1. Code Analysis

  • Scan repositories for complexity metrics
  • Detect "hotspots" - files that need attention
  • Calculate Technical Debt Index (TDI)

2. Persistent Memory

  • Remember decisions across sessions
  • Store code patterns and conventions
  • Recall similar errors and their fixes

3. Code Guards

  • Validate code before commits
  • Catch fake tests, empty catch blocks
  • Security-focused rules

4. Workflow Management

  • Task tracking with priorities
  • Checkpoint system for progress
  • Process management for dev servers

Quick Start

# Install
npm install -g codeguardian-studio

# Add to Claude Code settings
ccg init
Enter fullscreen mode Exit fullscreen mode

Example: Finding Refactoring Priorities

Claude: Use code_quick_analysis to scan the codebase

Result:
- Top hotspot: src/legacy/parser.ts (score: 8.5)
  - 500+ lines, deep nesting, high complexity
- Suggested: Split into smaller modules
Enter fullscreen mode Exit fullscreen mode

Links


What features would you find most useful for your workflow? Let me know in the comments!

Top comments (0)