JM

johannhartmann/mcpcodeanalysis

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

10 stars 3 forks Качество 57 Тренд 8MIT

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
Открыть полный README на GitHub

Установка

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" } } } }