MCP Code Analyzer
An orchestrator that coordinates multiple security and quality tools like Semgrep and ESLint to provide comprehensive code analysis and scoring. It enables users to perform vulnerability scanning, architecture metrics, and impact analysis through CLI, REST, or MCP interfaces.
README
MCP Code Analyzer
MCP orchestrator for code security, quality, and architecture analysis. This tool coordinates multiple MCP servers to provide comprehensive code analysis.
Features
- Security Analysis: Vulnerability scanning via Semgrep, Trivy
- Code Quality: Linting via ESLint, SonarQube
- Dependency Analysis: Vulnerability scanning via Snyk, npm audit
- Architecture Analysis: Complexity metrics, dead code detection
- Knowledge Graph: Semantic code analysis, impact analysis
- Scoring System: 0-100 scores with A-F grades
- Historical Trends: Track improvements over time
Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ Interfaces │
├─────────────┬─────────────────────┬─────────────────────────────────┤
│ CLI │ REST API │ MCP Server (for Claude) │
└─────────────┴─────────────────────┴─────────────────────────────────┘
│
┌─────────▼─────────┐
│ MCP ORCHESTRATOR │
│ - Client Manager │
│ - Job Scheduler │
│ - Retry Logic │
│ - Normalizer │
│ - Score Engine │
└─────────┬─────────┘
│
┌─────────────────────┼─────────────────────┐
│ │ │
┌────▼────┐ ┌─────▼─────┐ ┌────▼────┐
│ Semgrep │ │ ESLint │ │ Snyk │
│ Trivy │ │ SonarQube │ │npm audit│
└─────────┘ └───────────┘ └─────────┘
Installation
npm install -g mcp-code-analyzer
Or run directly with npx:
npx mcp-code-analyzer analyze ./my-project
Usage
CLI
# Analyze a local project
mcp-analyze analyze ./my-project
# Analyze a GitHub repository
mcp-analyze analyze https://github.com/user/repo
# Specify scanners
mcp-analyze analyze ./my-project --scanners security,quality
# Generate report
mcp-analyze report <analysis-id> --format md
# View history
mcp-analyze history ./my-project
# Compare analyses
mcp-analyze compare <id1> <id2>
# Start REST API
mcp-analyze serve --port 3000
# Start MCP server (for Claude)
mcp-analyze mcp
MCP Integration (Claude Desktop)
Add to your Claude Desktop config:
{
"mcpServers": {
"code-analyzer": {
"command": "npx",
"args": ["-y", "mcp-code-analyzer", "mcp"]
}
}
}
MCP Integration (Claude Code)
Claude Code supports MCP servers at two scopes:
Project-level (single project)
Create a .mcp.json file in your project root:
{
"mcpServers": {
"mcp-security": {
"command": "node",
"args": ["/path/to/mcp_security/dist/cli/index.js", "mcp"],
"cwd": "/path/to/mcp_security"
}
}
}
This makes the MCP server available only when working in that specific project.
User-level (all projects)
Add to your ~/.claude.json file:
{
"mcpServers": {
"mcp-security": {
"command": "node",
"args": ["/path/to/mcp_security/dist/cli/index.js", "mcp"],
"cwd": "/path/to/mcp_security"
}
}
}
This makes the MCP server available globally across all your projects.
After configuration
- Restart VSCode (or start a new Claude Code conversation)
- The MCP tools will be available as
mcp__mcp-security__<tool_name>
| Claude Code Tool | Description |
|---|---|
mcp__mcp-security__analyze_project |
Run full analysis on a project |
mcp__mcp-security__get_analysis_report |
Get detailed report |
mcp__mcp-security__compare_analyses |
Compare two analyses |
mcp__mcp-security__list_project_analyses |
View analysis history |
mcp__mcp-security__get_findings |
Get filtered findings |
mcp__mcp-security__get_code_graph |
Get semantic code graph |
mcp__mcp-security__analyze_impact |
Analyze impact of changes |
MCP Tools
| Tool | Description |
|---|---|
analyze_project |
Run full analysis on a project |
get_analysis_report |
Get detailed report |
compare_analyses |
Compare two analyses |
list_project_analyses |
View analysis history |
get_findings |
Get filtered findings |
get_code_graph |
Get semantic code graph |
analyze_impact |
Analyze impact of changes |
Scoring
Each category is scored 0-100:
| Category | Weight |
|---|---|
| Security | 35% |
| Quality | 25% |
| Dependencies | 25% |
| Architecture | 15% |
Grades: A (90-100), B (80-89), C (70-79), D (60-69), F (<60)
Configuration
Create .mcp-analyzer.json in your project root:
{
"servers": {
"semgrep": { "enabled": true },
"eslint": { "enabled": true },
"snyk": { "enabled": false }
},
"scoring": {
"weights": {
"security": 0.4,
"quality": 0.3,
"dependencies": 0.2,
"architecture": 0.1
}
}
}
Development
# Install dependencies
npm install
# Build
npm run build
# Run in development
npm run dev
# Run tests
npm test
# Type check
npm run typecheck
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。