Skip to main content

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.

Metadata

Release files for iflow-mcp_emiryasar-mcp-code-analyzer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_emiryasar-mcp-code-analyzer 0.1.1
File Size Uploaded
iflow_mcp_emiryasar_mcp_code_analyzer-0.1.1.tar.gz 64.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_emiryasar-mcp-code-analyzer 0.1.1
File Interpreter ABI Platform
iflow_mcp_emiryasar_mcp_code_analyzer-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 126.0 kB

Release files / iflow_mcp_emiryasar_mcp_code_analyzer-0.1.1.tar.gz

Download URL iflow_mcp_emiryasar_mcp_code_analyzer-0.1.1.tar.gz
Size 64.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7bba1ecfe7902412e4118852cc3d3608b9cde2155a0277ff19880a3c67cc913e
BLAKE2b-256 checksum
How to use checksums
ba5803c1168136241a145aadffae701f27af997fa9e50d29e0478dbcb0c1bd7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_emiryasar_mcp_code_analyzer-0.1.1-py3-none-any.whl

Download URL iflow_mcp_emiryasar_mcp_code_analyzer-0.1.1-py3-none-any.whl
Size 61.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a06b9c6f5db7cb78b2912ae63164b1d5debc15c6592d402c3f577629a2b8e5cf
BLAKE2b-256 checksum
How to use checksums
8d143a6b14943b2f3e9356a20937f0c7cced7bc26b0b56da20190d9567b0c04a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page