Skip to content

Advanced Code Analysis MCP Server with Knowledge Graph and AI Insights - TypeScript implementation with Neo4j backend

Notifications You must be signed in to change notification settings

kakawaa/advanced-code-analysis-mcp

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Advanced Code Analysis MCP Server

πŸš€ Advanced code analysis system with knowledge graph and AI insights

A sophisticated MCP Server that combines Neo4j knowledge graphs, AI-powered analysis, and advanced static analysis for large-scale code projects.

✨ Key Features

  • 🧠 AI-Powered Analysis with GPT-4/Claude for advanced insights
  • πŸ“Š Advanced Knowledge Graph with Neo4j for complex relationships
  • πŸ” Natural Language Queries with no learning curve
  • πŸ—οΈ Deep Architectural Analysis
  • ⚑ Parallel Processing for large projects
  • πŸ›‘οΈ Automated Security Analysis
  • πŸ“ˆ Comprehensive Quality Metrics

🎯 Performance Targets

  • Up to 10M lines of code in under 30 minutes
  • 10+ concurrent analyses
  • Query response time < 1 second for most queries
  • 95%+ accuracy in entity and relationship detection

πŸš€ Quick Setup

System Requirements

  • Node.js 18+
  • Docker & Docker Compose
  • 8GB+ RAM
  • 100GB+ disk space

Setup with Docker

# Clone the project
git clone https://github.com/ItamarZand88/advanced-code-analysis-mcp.git
cd advanced-code-analysis-mcp

# Setup environment configuration
cp .env.example .env
# Edit .env with your settings

# Run the system
docker-compose up -d

# Check status
curl http://localhost:3000/health

Local Installation

# Install dependencies
npm install

# Build the project
npm run build

# Run in development
npm run dev

# Run in production
npm start

πŸ“– Basic Usage

Repository Analysis

import { MCPServer } from './dist/index.js';

const server = new MCPServer();

// Start analysis
const result = await server.analyzeRepository(
  'https://github.com/microsoft/vscode',
  'main',
  {
    includeTests: true,
    enableAIInsights: true,
    parallelWorkers: 8
  }
);

console.log(`Job ID: ${result.jobId}`);

Natural Language Queries

// Example queries
const queries = [
  'Show me the most complex functions in the system',
  'Find circular dependencies',
  'Which files are missing tests?',
  'Show me potential security vulnerabilities',
  'What are the main architectural patterns?'
];

for (const query of queries) {
  const result = await server.queryGraph(query, graphId);
  console.log(result.interpretation);
}

Advanced API

// Complexity analysis
const complexity = await server.getComplexityAnalysis(graphId);

// Dependency analysis
const dependencies = await server.getDependencyAnalysis(graphId);

// Quality assessment
const quality = await server.getQualityMetrics(graphId);

// Security analysis
const security = await server.getSecurityAnalysis(graphId);

πŸ”§ Advanced Configuration

Analysis Settings

// .env
MAX_CONCURRENT_ANALYSES=10
PARALLEL_WORKERS=16
MAX_FILE_SIZE=50485760  // 50MB
INCLUDE_TESTS=true
ENABLE_AI_INSIGHTS=true

AI Configuration

AI_PROVIDER=openai
AI_MODEL=gpt-4
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here

Neo4j Configuration

NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=secure_password
NEO4J_DATABASE=codeanalysis

πŸ“Š Monitoring and Metrics

🎨 Usage Examples

1. Enterprise Code Audit

Analyze our main system for security issues and code smells

2. Developer Onboarding

Show me the core components and how they interact

3. Refactoring Planning

Find the most tightly coupled components and suggest where to break dependencies

4. Performance Analysis

Find bottlenecks and inefficient algorithms

πŸ› οΈ Development

Running Tests

npm test
npm run test:watch
npm run test:coverage

Code Quality and Linting

npm run lint
npm run lint:fix
npm run format

Production Build

npm run build
npm run docker:build

πŸ“š Additional Documentation

🀝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.

πŸ™‹β€β™‚οΈ Support


⭐ Don't forget to star the project if it helps you!

About

Advanced Code Analysis MCP Server with Knowledge Graph and AI Insights - TypeScript implementation with Neo4j backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.1%
  • JavaScript 10.1%
  • Dockerfile 0.8%