关于 Advanced Code Analysis MCP Server
这是一个分析大型代码项目的 MCP 服务,结合静态分析、Neo4j 知识图谱和 AI 洞察。它面向希望通过自然语言查询研究架构、依赖、安全性和代码质量的开发者与团队。
主要功能
- 01使用 Neo4j 构建代码关系图
- 02通过自然语言查询代码
- 03分析架构和依赖关系
- 04执行安全分析
- 05衡量代码质量和复杂度
- 06并行处理分析任务
适用场景
- 01查找循环依赖
- 02识别潜在安全问题
- 03为新成员梳理核心组件
- 04重构前定位耦合紧密的区域
MCP 相关
向 MCP 客户端提供代码分析能力,包括仓库分析以及对项目结构的自然语言查询。README 提及架构、依赖、安全性、复杂度和质量分析。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
暂未收录安装方式
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
还没有获取到工具列表
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
高级代码分析 MCP 服务
🚀 结合知识图谱与 AI 洞察的高级代码分析系统
一款复杂的 MCP 服务,结合 Neo4j 知识图谱、AI 驱动的分析和高级静态分析,适用于大型代码项目。
✨ 主要功能
- 🧠 AI 驱动的分析,借助 GPT-4/Claude 提供高级洞察
- 📊 高级知识图谱,借助 Neo4j 建立复杂关系
- 🔍 自然语言查询,无需学习
- 🏗️ 深度架构分析
- ⚡ 并行处理,适用于大型项目
- 🛡️ 自动化安全分析
- 📈 全面的质量指标
🎯 性能目标
- 在 30 分钟内处理最多 1,000 万行代码
- 10 个以上并发分析任务
- 大多数查询的响应时间 < 1 秒
- 实体和关系检测的准确率超过 95%
🚀 快速设置
系统要求
- Node.js 18+
- Docker 和 Docker Compose
- 8GB+ RAM
- 100GB+ 磁盘空间
使用 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
本地安装
# Install dependencies
npm install
# Build the project
npm run build
# Run in development
npm run dev
# Run in production
npm start
📖 基本用法
仓库分析
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}`);
自然语言查询
// 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);
}
高级 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);
🔧 高级配置
分析设置
// .env
MAX_CONCURRENT_ANALYSES=10
PARALLEL_WORKERS=16
MAX_FILE_SIZE=50485760 // 50MB
INCLUDE_TESTS=true
ENABLE_AI_INSIGHTS=true
AI 配置
AI_PROVIDER=openai
AI_MODEL=gpt-4
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here
Neo4j 配置
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=secure_password
NEO4J_DATABASE=codeanalysis
📊 监控与指标
- Neo4j 浏览器:http://localhost:7474
- Grafana 仪表板:http://localhost:3001 (admin/admin)
- Prometheus 指标:http://localhost:9091
- 健康检查:http://localhost:3000/health
🎨 使用示例
1. 企业代码审计
Analyze our main system for security issues and code smells
2. 开发者入职
Show me the core components and how they interact
3. 重构规划
Find the most tightly coupled components and suggest where to break dependencies
4. 性能分析
Find bottlenecks and inefficient algorithms
🛠️ 开发
运行测试
npm test
npm run test:watch
npm run test:coverage
代码质量与 Lint 检查
npm run lint
npm run lint:fix
npm run format
生产构建
npm run build
npm run docker:build
📚 更多文档
🤝 参与贡献
- Fork 项目
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交更改(
git commit -m 'Add amazing feature') - 推送到分支(
git push origin feature/amazing-feature) - 发起 Pull Request
📄 许可证
本项目根据 MIT License 发布。详情请参阅 LICENSE。
🙋♂️ 支持
- 📧 邮箱:[email protected]
- 💬 Discord:社区服务器
- 🐛 问题:GitHub Issues
- 📖 文档:完整文档
⭐ 如果这个项目对你有帮助,别忘了给它点星!
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。