Design Patterns MCP Server
Design Patterns MCP Server
ハイブリッド検索(セマンティック + キーワード + グラフ拡張)を使用してデザインパターンの推奨を提供するインテリジェントなMCP(Model Context Protocol)サーバーです。高度なブレンドRAGアーキテクチャを備えた自然言語インターフェースを通じて、90以上のカテゴリにわたる685以上のデザインパターンにアクセスできます。
クイックスタート
# Clone and setup
git clone https://github.com/apolosan/design_patterns_mcp.git
cd design_patterns_mcp
# Install dependencies and build (using bun)
bun install
bun run db:setup
# Or using npm (if bun is not installed)
npm install --ignore-scripts
npx tsc
node dist/src/cli/migrate.js
node dist/src/cli/seed.js
node dist/src/cli/generate-embeddings.js
node dist/src/cli/setup-relationships.jsMCPクライアント(Claude Desktop、Cursorなど)で設定し、自然言語クエリを通じてパターンの探索を開始します。
Related MCP server: Acemcp
特徴
特徴 | 説明 |
ハイブリッド検索エンジン | セマンティック、キーワード(TF-IDF)、グラフ拡張検索を組み合わせたブレンドRAG |
685以上のパターン | 12の主要カテゴリにわたる包括的なカタログ |
MCP統合 | Claude、Cursor、その他のMCPクライアントとのシームレスな統合 |
マルチレベルキャッシュ | 95%以上のヒット率を誇るL1インメモリ + L3 SQLiteキャッシュ |
イベントバスシステム | パブ/サブによる疎結合なサービス間通信 |
テレメトリとヘルスチェック | リアルタイムのパフォーマンスメトリクスとシステム監視 |
SOLIDアーキテクチャ | ベストプラクティスに従ったクリーンで保守性の高いコードベース |
本番環境対応 | 464のテストケースで100%の合格率 |
利用可能なパターンカテゴリ
カテゴリ | 数 | 例 |
Classic GoF Patterns | 34 | Factory, Builder, Observer, Strategy, Command |
Architectural Patterns | 56 | MVC, Clean Architecture, Hexagonal, DDD |
Microservices & Cloud | 39 | Circuit Breaker, Saga, Service Mesh |
Data Engineering | 54 | Repository, CQRS, Event Sourcing |
AI/ML & MLOps | 46 | RAG, Fine-Tuning, Model Compression |
React Patterns | 27 | Hooks, Server Components, Performance |
Blockchain & Web3 | 115 | DeFi, NFTs, Smart Contracts, MEV |
Concurrency & Reactive | 45 | Producer-Consumer, Actor Model |
Security | 21 | OAuth, RBAC, Zero Trust |
Functional Programming | 26 | Monads, Functors, Higher-Order Functions |
アーキテクチャ
src/
├── adapters/ # External service adapters (LLM, embeddings)
├── cli/ # CLI commands (migrate, seed, embeddings, setup-relationships)
├── core/ # DI Container, configuration builder
├── db/ # Database migrations
├── events/ # Event bus system
├── handlers/ # MCP request handlers (hybrid search, recommendations)
├── health/ # Health check services
├── repositories/ # Data access layer
├── search/ # Hybrid search engine
├── services/ # Business services (cache, telemetry, pattern service)
├── strategies/ # Strategy pattern implementations
├── types/ # TypeScript type definitions
└── mcp-server.ts # MCP server entry point
data/
├── patterns/ # 750+ JSON pattern definitions
└── design-patterns.db # SQLite database with embeddings使用方法
パターンの検索
MCPクライアントを通じて自然言語で質問します:
"I need to create complex objects with many optional configurations"
→ Builder, Abstract Factory, Factory Method
"How to handle service failures gracefully in distributed systems?"
→ Circuit Breaker, Bulkhead, Retry, Fallback
"What pattern helps with state-dependent behavior in React?"
→ State Machine, Observer, useReducer
"How to implement secure authentication and authorization?"
→ OAuth 2.0, RBAC, JWT, Zero TrustMCPツール
ツール | 説明 |
| 問題記述を使用したパターンのハイブリッド検索 |
| フィルタリング機能付きのキーワードまたはセマンティック検索 |
| コード例を含む包括的なパターン情報 |
| 利用可能なパターンに関する統計 |
| システムの健全性とサービスステータス |
インストール
前提条件
Node.js >= 18.0.0
Bun >= 1.0.0 (推奨) または npm >= 8.0.0
Bunでのセットアップ
bun install
bun run build
bun run db:setupnpmでのセットアップ
package.json の prepare スクリプトは bun を必要とします。bun がインストールされていない場合は、--ignore-scripts を使用してスキップし、手動でビルドしてください:
npm install --ignore-scripts
npx tsc
# Setup database
node dist/src/cli/migrate.js
node dist/src/cli/seed.js
node dist/src/cli/generate-embeddings.js
node dist/src/cli/setup-relationships.jsMCP設定
MCPクライアント(Claude Desktop、Cursorなど)の設定に追加します:
{
"mcpServers": {
"design-patterns": {
"command": "node",
"args": ["/absolute/path/to/design-patterns-mcp/dist/src/mcp-server.js"],
"env": {
"LOG_LEVEL": "info",
"DATABASE_PATH": "/absolute/path/to/design-patterns-mcp/data/design-patterns.db",
"ENABLE_HYBRID_SEARCH": "true",
"ENABLE_GRAPH_AUGMENTATION": "true",
"EMBEDDING_COMPRESSION": "true",
"ENABLE_FUZZY_LOGIC": "true",
"ENABLE_TELEMETRY": "true",
"ENABLE_MULTI_LEVEL_CACHE": "true"
}
}
}
}重要:
argsとDATABASE_PATHの両方に絶対パスを使用してください。CursorのようなMCPクライアントはcwdフィールドを確実にサポートしていないため、相対パスはプロジェクトディレクトリではなくユーザーのホームディレクトリを基準に解決されてしまいます。クライアント固有の設定例については QUICKSTART.md を参照してください。
環境変数
変数 | デフォルト | 説明 |
|
| ログレベル (debug, info, warn, error) |
|
| SQLiteデータベースパス |
|
| ブレンドRAG検索の有効化 |
|
| パターン関係トラバーサルの有効化 |
|
| 次元削減 |
|
| ファジーロジックによる結果の洗練 |
|
| パフォーマンスメトリクス |
|
| L1 + L3 キャッシュ |
|
| 同時リクエスト制限 |
|
| キャッシュサイズ制限 |
|
| キャッシュTTL (ミリ秒) |
|
| トランスポートモード (stdio/http) |
|
| HTTPポート (httpモード) |
|
| MCPエンドポイントパス |
|
| ヘルスチェックパス |
|
| データベースセットアップのスキップ |
Dockerデプロイメント
クイックスタート
# Build
docker build -t design-patterns-mcp .
# Run HTTP mode
docker run -p 3000:3000 -e TRANSPORT_MODE=http design-patterns-mcp
# Run stdio mode (default)
docker run design-patterns-mcpDocker Compose
docker compose up --build -d環境変数
変数 | デフォルト | 説明 |
|
| トランスポートモード (stdio/http) |
|
| HTTPポート (httpモード) |
|
| MCPエンドポイントパス |
|
| ヘルスチェックパス |
|
| SQLiteデータベースパス |
|
| ログレベル |
|
| データベースセットアップのスキップ |
エンドポイント (HTTPモード)
GET /health- ヘルスチェックPOST /mcp- MCP JSON-RPCエンドポイント
コマンド
# Development
bun run build # Compile TypeScript
bun run dev # Development with hot reload
bun run start # Build and start production server
# Database
bun run db:setup # Complete database setup
bun run migrate # Run migrations
bun run seed # Seed pattern data
bun run generate-embeddings # Generate semantic embeddings
bun run setup-relationships # Setup pattern relationships
# Quality
bun run test # Run all tests
bun run lint # Check code quality
bun run lint:fix # Auto-fix linting issues
bun run typecheck # TypeScript type checkingテスト
このプロジェクトには、100%の合格率を誇る 41のテストファイルにわたる464のテストケース が含まれています:
コントラクトテスト: MCPプロトコル準拠の検証
統合テスト: コンポーネント間の相互作用テスト
パフォーマンステスト: 検索およびベクトル化のベンチマーク
ユニットテスト: 個々のコンポーネントのテスト
# Run all tests
bun run test
# Run specific test suites
bun run test:unit -- --grep "PatternService"
bun run test:integration -- --grep "database"
bun run test:performance -- --timeout 30000アーキテクチャパターン
このプロジェクトは、ドキュメント化しているパターンを実装しています:
パターン | 実装 |
Repository |
|
Service Layer |
|
Object Pool |
|
Dependency Injection |
|
Strategy |
|
Event Bus |
|
Multi-Level Cache |
|
Builder |
|
貢献
貢献を歓迎します!プルリクエストを送信する前に、貢献ガイドラインをお読みください。
リポジトリをフォークする
フィーチャーブランチを作成する
SOLID原則に従って変更を加える
テストとリンティングを実行する
プルリクエストを送信する
ライセンス
MITライセンス - 詳細は LICENSE を参照してください。
リソース
バージョン: 0.4.4
最終更新: 2026年2月
パターン: 685以上 (750以上のJSONファイル)
テスト: 464テストケース | 100%合格
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
- Alicense-qualityDmaintenanceEnables semantic code search across projects using AI embeddings to find code by meaning rather than just text matching. Provides fast intelligent search, symbol analysis, and code similarity detection with multi-language support.MIT
- AlicenseAqualityFmaintenanceProvides code repository indexing and semantic search capabilities, allowing natural language queries to find relevant code snippets with automatic incremental indexing and multi-language support.137359ISC
- Flicense-qualityDmaintenanceEnables semantic search and knowledge management for storing and querying principles, patterns, and learnings using hybrid keyword and vector search.1
- Flicense-qualityFmaintenanceGives Claude semantic search superpowers to find and reuse existing patterns in your codebase.16
Related MCP Connectors
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Multilingual semantic SVG icon search with previews for AI coding agents. 20,000+ icons.
A design-style library for AI agents: search real styles, fetch a ready-to-apply design spec.
Appeared in Searches
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/apolosan/design_patterns_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server