Cover image
Try Now
2024-12-05

用于综合代码分析的模型上下文协议(MCP)服务器实现。该工具与Claude Desktop集成,以通过自然语言互动提供代码分析功能。

3 years

Works with Finder

3

Github Watches

10

Github Forks

31

Github Stars

MCP Code Analyzer

The main purpose of the MCP tool is to adapt changes to the project intelligently. For instance, when a code modification or structural adjustment is needed, it aims to ensure that other related usages are also updated accordingly.

Currently, the project has a lot of bugs, and the tools are not functioning as expected sometimes. Due to work commitments, I can’t dedicate much time to it, but I’ll try to fix the issues and bring it to a working state whenever I find the time.

⚠️ WARNING: BACKUP RECOMMENDED
This tool performs file operations that could potentially modify or delete files. Always backup your codebase before using any modification features.

Overview

The Model Context Protocol (MCP) Code Analyzer is a comprehensive code analysis and management tool that integrates with Claude Desktop. It analyzes code at both project and file levels, providing insights for needed changes and project understanding.

Prerequisites

  • Python 3.10 or later
  • Windows (Linux/MacOS support not yet tested)

Installation

# Clone the repository
git clone https://github.com/[your-username]/mcp-code-analyzer.git
cd mcp-code-analyzer

# Install dependencies and package
pip install -e .

Claude Desktop Integration

Configuration

  1. Access Claude Desktop config:
    Win + R → %AppData%\Claude\
    
  2. Create/edit claude_desktop_config.json:
    {
      "globalShortcut": "Ctrl+Space",
      "mcpServers": {
        "code-analyzer": {
          "command": "python",
          "args": [
            "-m",
            "mcp_code_analyzer",
            "--analyze-paths",
            "C:\\Projects\\path1"
          ],
          "type": "module"
        }
      }
    }
    

Path Configuration

  • Multiple project paths can be specified in configuration
  • Additional paths or files can be analyzed via chat messages
  • No limit on number of analyzable paths/files

🛠️ Tools and Status

Working Tools

  • Project Analysis

    • analyze_project_structure (XML tree format)
    • analyze_project_statistics
    • analyze_project_technology
    • analyze_code_structure
  • Code Analysis

    • analyze_imports
    • analyze_file
    • find_references
  • ⚠️🔄 File Operations (Always backup before use)

    • file_operations
    • version_control (Creates dated backups)
  • ⚠️🔄 Code Modify (Always backup before use)

    • code_modifier (Performs modifying code line by line)(Currently has big issues)

Testing Phase

  • 🔄 check_syntax
  • 🔄 find_code_patterns
  • 🔄 find_pattern_usages
  • 🔄 search_content
  • 🔄 search_files
  • 🔄 validate_code

Known Issues

  1. Chat context limitations may interrupt large file modifications
  2. AI-generated documentation comments can affect code operation in large files

Demo Video

Watch demonstration of MCP tool using with building Mario game: Mario Game with Claude | MCP Code Analyzer Tool Demonstration

Note: This is a demonstration of the tool's capabilities, not a complete game tutorial. While the game isn't fully playable due to Claude's message limits, this video shows how the MCP tool works and what you can do with it.

Contributing

Contributions are welcome! Whether it's bug reports, feature requests, documentation improvements, or code contributions - every contribution helps. Simply fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Note: This project is under active development. Features and documentation may change frequently.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • chongdashu
  • 使用模型上下文协议(MCP),启用Cursor,Windsurf和Claude Desktop等AI助手客户,以通过自然语言控制虚幻引擎。

    Reviews

    5 (1)
    Avatar
    user_rThiYncI
    2025-04-17

    I've been using mcp_code_analyzer by emiryasar, and it has significantly streamlined my code review process. The tool is intuitive and covers a wide range of languages, helping me catch bugs and optimize my code efficiently. Highly recommend exploring it on GitHub: https://github.com/emiryasar/mcp_code_analyzer.