ai-backend-performance-mcp
ai-backend-performance-mcp
Node.js バックエンドのパフォーマンス問題のための静的解析 MCP サーバーです。AI エージェントは、コードを変更することなく、データベースクエリのアンチパターン、非同期ボトルネック、コネクションプーリングの誤り、依存関係の衛生問題をプロジェクト内で検査できます。
なぜこのプロジェクトか?
バックエンドのパフォーマンス問題は、しばしば明白な場所に隠れています。ループ内の N+1 クエリ、リクエストごとに作成されるクライアント、並列実行できるのに逐次実行されている await、package.json での依存関係の誤分類などです。この MCP サーバーは、これらのパターンを、AI コーディングアシスタントが推論できる構造化された証拠に基づく所見として公開します。
できること
JavaScript/TypeScript ソースファイルの読み取り専用静的解析
一般的なバックエンドパフォーマンスカテゴリのための 6 つの焦点を絞った MCP ツール
重大度、信頼度、コードスニペット、推奨事項を含む構造化された所見
確認済みの証拠と潜在的な問題を区別します
できないこと
アプリケーションやリポジトリのコードを実行する
ファイルの変更、パッケージのインストール、インデックスの変更
プロファイリング、ロードテスト、データベースの
EXPLAIN分析の代替
Related MCP server: DepHealth MCP
アーキテクチャ
flowchart TD
Client[MCP Client / AI Agent]
Server[MCP Server]
Tools[MCP Tools]
Engine[Analysis Engine]
Analyzers[Individual Analyzers]
Findings[Structured Findings]
Client --> Server
Server --> Tools
Tools --> Engine
Engine --> Analyzers
Analyzers --> Findings
Findings --> Tools
Tools --> Server
Server --> Clientレイヤーの詳細は docs/architecture.md を参照してください。
アナライザー
アナライザー | 検出内容 |
データベースクエリ | N+1 パターン、無制限の find/query |
MongoDB インデックス | 一致する |
非同期パターン | ループ内の |
コネクションプーリング | ハンドラやループ内でのクライアント/プール作成 |
依存関係 | 未使用の依存関係、dev/prod の誤分類、ロックファイル統計 |
MCP ツール
ツール | 説明 |
| グループ化された所見とサマリーによる完全スキャン |
| MongoDB/PostgreSQL クエリパターン |
| MongoDB インデックスカバレッジのヒューリスティック |
| 非同期/await パフォーマンスパターン |
| 接続ライフサイクルのアンチパターン |
|
|
ツールリファレンス: docs/tools.md
インストール
npm install ai-backend-performance-mcpまたは直接実行:
npx ai-backend-performance-mcpMCP 設定
MCP クライアント設定に追加します(Cursor / Claude Desktop の例):
{
"mcpServers": {
"backend-performance": {
"command": "npx",
"args": ["-y", "ai-backend-performance-mcp"],
"env": {}
}
}
}ローカル開発の場合:
{
"mcpServers": {
"backend-performance": {
"command": "node",
"args": ["/absolute/path/to/ai-backend-performance-mcp/dist/index.js"]
}
}
}使用方法
Node.js バックエンドリポジトリを指す projectPath を指定して任意のツールを呼び出します:
{
"projectPath": "/path/to/your/api"
}出力例(省略)
{
"projectPath": "/app/examples/sample-node-api",
"technologies": ["express", "mongodb"],
"metadata": {
"packageName": "sample-node-api",
"packageVersion": "1.0.0",
"sourceFileCount": 4
},
"findings": [
{
"category": "pooling",
"severity": "critical",
"title": "Connection or client created in request handler",
"evidence": {
"kind": "confirmed",
"snippet": "const client = await MongoClient.connect(...)"
},
"confidence": 0.9,
"recommendation": "Create a shared client/pool at module scope and reuse it."
}
],
"summary": {
"totalFindings": 6,
"confirmedCount": 3,
"potentialCount": 3
}
}同梱のデモプロジェクト examples/sample-node-api を試してください。
安全性
読み取り専用: 分析対象のプロジェクトに書き込むことはありません
パス検証:
projectPathの外へのトラバーサルを防ぎますコード実行なし: ソーステキストのみを解析し、リポジトリのコードを実行しません
信頼できない入力: 分析対象のリポジトリは信頼できないものとして扱います
制限事項
静的解析のみ。クラスター状態に依存する所見は
potentialのままです動的な
require()/ 実行時生成クエリは完全には追跡されませんインデックス分析はリポジトリ内の
createIndex呼び出しのみを比較します(Atlas/オペレーション管理のインデックスは対象外)。リポジトリに定義がない場合は沈黙しますArray.find、バッチ$in/ANY()、_idルックアップ、モジュールスコープの DB クライアントは問題として扱われません逐次 await は、以前のバインディングを消費しない場合にのみフラグが立てられます。
Promise.allが所見として報告されることはありません依存関係の未使用検出はインポートスキャンに基づいています
Redis 固有のルールは計画されていますが、v0.1.0 では実装されていません
開発
git clone https://github.com/robinafaruqia/ai-backend-performance-mcp.git
cd ai-backend-performance-mcp
npm install
npm run typecheck
npm run lint
npm test
npm run builddocs/development.md を参照してください。
テスト
npm testtests/fixtures/ のフィクスチャプロジェクトは、N+1 クエリ、インデックス、非同期、プーリング、依存関係について 問題のある コードと 有効な コードをペアにしており、アナライザーがすべての await、クエリ、ループ、接続に対して反応しないようにしています。
ロードマップ
Redis/キャッシュアナライザー
Prisma/TypeORM 固有のクエリルール
ProjectContext キャッシュ
SARIF/JSON レポートエクスポート
設定可能な重大度しきい値
コントリビューション
コントリビューションを歓迎します! CONTRIBUTING.md と CODE_OF_CONDUCT.md を参照してください。
ライセンス
MIT — LICENSE を参照してください。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to perform sophisticated static code analysis using Joern's Code Property Graph technology. Supports multi-language analysis, security vulnerability detection, and code quality assessment through isolated Docker environments.151GPL 3.0
- AlicenseAqualityDmaintenanceDependency security & health auditing for AI agents with no account or API key required.22MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible clients to inspect Next.js codebases, analyze App Router and Pages Router structure, discover API routes, and audit build performance through controlled tools.8MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to scan code for security and quality issues and receive machine-readable reports with suggested fixes and verification criteria.892MIT
Related MCP Connectors
Provide AI-powered real-time analysis and intelligence on NPM packages, including security, depend…
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Lints + auto-fixes how AI coding agents discover any new product. 24 rules, 6 tools, score 0-100.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/robinafaruqia/ai-backend-performance-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server