JM

johannhartmann/mcpcodeanalysis

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

10 stars 3 forks 品質 57 トレンド 18MIT

A code understanding MCP server. Let's see if we can use it to refactor code.

概要

An intelligent MCP (Model Context Protocol) server that provides advanced code analysis and search capabilities for large codebases. Built with pure FastMCP implementation, it uses TreeSitter for parsing, PostgreSQL with pgvector for vector storage, and OpenAI embeddings for semantic search. - 🔍 : Natural language queries to find relevant code - 🏛️ : Extract business entities and bounded contexts using LLM - 📊 : Hierarchical understanding of modules, classes, and functions - 🔄 : Git-based change tracking for efficient re-indexing - 🎯 : AI-powered explanations with context aggregation - 🔗 : Understand code relationships and dependencies - 🌐 : Build semantic graphs with community detection (Leiden algorithm) - 💡 : Domain-Driven Design suggestions and improvements - 🚀 : Handles codebases with millions of lines of code - 🐍 : Full support for Python with more languages coming - search_code - Search for code using natural language queries with semantic understanding -...

README

以下は原文 README の抜粋です。原文を見る。

MCP Code Analysis Server

An intelligent MCP (Model Context Protocol) server that provides advanced code analysis and search capabilities for large codebases. Built with pure FastMCP implementation, it uses TreeSitter for parsing, PostgreSQL with pgvector for vector storage, and OpenAI embeddings for semantic search.

Features

  • 🔍 Semantic Code Search: Natural language queries to find relevant code
  • 🏛️ Domain-Driven Analysis: Extract business entities and bounded contexts using LLM
  • 📊 Code Structure Analysis: Hierarchical understanding of modules, classes, and functions
  • 🔄 Incremental Updates: Git-based change tracking for efficient re-indexing
  • 🎯 Smart Code Explanations: AI-powered explanations with context aggregation
  • 🔗 Dependency Analysis: Understand code relationships and dependencies
  • 🌐 Knowledge Graph: Build semantic graphs with community detection (Leiden algorithm)
  • 💡 DDD Refactoring: Domain-Driven Design suggestions and improvements
  • 🚀 High Performance: Handles codebases with millions of lines of code
  • 🐍 Python Support: Full support for Python with more languages coming

MCP Tools Available

Core Search Tools

  • search_code - Search for code using natural language queries with semantic understanding
  • find_definition - Find where symbols (functions, classes, modules) are defined
  • find_similar_code - Find code patterns similar to a given snippet using vector similarity
  • get_code_structure - Get the hierarchical structure of a code file

Code Analysis Tools

  • explain_code - Get hierarchical explanations of code elements (modules, classes, functions)
  • suggest_refactoring - Get AI-powered refactoring suggestions for code improvements
  • analyze_dependencies - Analyze dependencies and relationships between code entities

Repository Management Tools

  • sync_repository - Manually trigger synchronization for a specific repository

Domain-Driven Design Analysis Tools

  • extract_domain_model - Extract domain entities and relationships using LLM analysis
  • find_aggregate_roots - Find aggregate roots in the codebase using domain analysis
  • analyze_bounded_context - Analyze a bounded context and its relationships
  • suggest_ddd_refactoring - Suggest Domain-Driven Design refactoring improvements
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "code-analysis": { "command": "python", "args": ["-m", "src.mcp_server"], "cwd": "/path/to/mcp-code-analysis-server", "env": { "OPENAI_API_KEY": "your-api-key" } } } }