Skip to main content
Glama

MCP Code Analyzer

by emiryasar

MCP代码分析器

MCP 工具的主要目的是智能地适应项目变化。例如,当需要修改代码或调整结构时,它旨在确保其他相关用法也得到相应更新。

目前,该项目存在很多错误,工具有时无法正常运行。由于工作安排,我无法投入太多时间,但只要有时间,我就会尽力修复这些问题,使其恢复正常运行状态。

⚠️警告:建议备份
此工具执行的文件操作可能会修改或删除文件。使用任何修改功能前,请务必备份您的代码库。

概述

模型上下文协议 (MCP) 代码分析器是一款全面的代码分析和管理工具,可与 Claude Desktop 集成。它可以在项目和文件级别分析代码,从而提供所需更改的洞察并加深对项目的理解。

先决条件

  • Python 3.10 或更高版本
  • Windows(Linux/MacOS 支持尚未测试)

安装

# 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 桌面集成

配置

  1. 访问 Claude 桌面配置:
    Win + R → %AppData%\Claude\
  2. 创建/编辑claude_desktop_config.json
    { "globalShortcut": "Ctrl+Space", "mcpServers": { "code-analyzer": { "command": "python", "args": [ "-m", "mcp_code_analyzer", "--analyze-paths", "C:\\Projects\\path1" ], "type": "module" } } }

路径配置

  • 可以在配置中指定多个项目路径
  • 可以通过聊天消息分析其他路径或文件
  • 可分析路径/文件的数量没有限制

🛠️ 工具和状态

工作工具

  • 项目分析
    • analyze_project_structure(XML 树格式)
    • 分析项目统计数据
    • 分析项目技术
    • 分析代码结构
  • 代码分析
    • 分析导入
    • 分析文件
    • 查找引用
  • ⚠️🔄文件操作(使用前请务必备份)
    • 文件操作
    • version_control(创建日期备份)
  • ⚠️🔄代码修改(使用前请务必备份)
    • code_modifier(执行逐行修改代码)(目前存在较大问题)

测试阶段

  • 🔄 check_syntax
  • 🔄 find_code_patterns
  • 🔄 find_pattern_usages
  • 🔄 search_content
  • 🔄 search_files
  • 🔄 验证代码

已知问题

  1. 聊天上下文限制可能会中断大型文件修改
  2. AI生成的文档注释可能会影响大文件中的代码操作

演示视频

观看使用 MCP 工具构建马里奥游戏的演示:

注意:本视频仅演示该工具的功能,而非完整的游戏教程。由于 Claude 的消息限制,游戏无法完全运行,但本视频展示了 MCP 工具的工作原理以及您可以使用它进行的操作。

贡献

欢迎贡献!无论是错误报告、功能请求、文档改进还是代码贡献,每一份贡献都意义非凡。只需 fork 代码库并提交拉取请求即可。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。


注意:该项目正在积极开发中。功能和文档可能会经常更改。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

全面的代码分析和管理工具,与 Claude Desktop 集成,在项目和文件级别分析代码,帮助智能地适应项目变化。

  1. 概述
    1. 先决条件
      1. 安装
        1. Claude 桌面集成
          1. 配置
          2. 路径配置
        2. 🛠️ 工具和状态
          1. 工作工具
          2. 测试阶段
          3. 已知问题
        3. 演示视频
          1. 贡献
            1. 执照

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                Provides tools for collecting and documenting code from directories.
                Last updated -
                4
                81
                12
                TypeScript
                MIT License
                • Apple
                • Linux
              • A
                security
                A
                license
                A
                quality
                Enables intelligent code analysis and debugging through the Perplexity AI's API, offering detailed error analysis, pattern detection, and comprehensive solutions, with integration support for the Claude desktop client.
                Last updated -
                1
                10
                JavaScript
                MIT License
                • Apple
              • -
                security
                A
                license
                -
                quality
                Facilitates integration with the Cursor code editor by enabling real-time code indexing, analysis, and bi-directional communication with Claude, supporting concurrent sessions and automatic reconnection.
                Last updated -
                2
                21
                31
                TypeScript
                MIT License
              • A
                security
                A
                license
                A
                quality
                Analyzes source code dependencies across multiple programming languages in the specified directory to identify file relationships, assisting in dependency management and project structure understanding.
                Last updated -
                1
                Python
                MIT License

              View all related MCP servers

              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/emiryasar/mcp_code_analyzer'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server