Skip to main content
Glama
apolosan

Design Patterns MCP Server

by apolosan

Design Patterns MCP Server

Version License: MIT Test Status Patterns TypeScript

ハイブリッド検索(セマンティック + キーワード + グラフ拡張)を使用してデザインパターンの推奨を提供するインテリジェントな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.js

MCPクライアント(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 Trust

MCPツール

ツール

説明

find_patterns

問題記述を使用したパターンのハイブリッド検索

search_patterns

フィルタリング機能付きのキーワードまたはセマンティック検索

get_pattern_details

コード例を含む包括的なパターン情報

count_patterns

利用可能なパターンに関する統計

get_health_status

システムの健全性とサービスステータス

インストール

前提条件

  • Node.js >= 18.0.0

  • Bun >= 1.0.0 (推奨) または npm >= 8.0.0

Bunでのセットアップ

bun install
bun run build
bun run db:setup

npmでのセットアップ

package.jsonprepare スクリプトは 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.js

MCP設定

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"
      }
    }
  }
}

重要: argsDATABASE_PATH の両方に絶対パスを使用してください。CursorのようなMCPクライアントは cwd フィールドを確実にサポートしていないため、相対パスはプロジェクトディレクトリではなくユーザーのホームディレクトリを基準に解決されてしまいます。クライアント固有の設定例については QUICKSTART.md を参照してください。

環境変数

変数

デフォルト

説明

LOG_LEVEL

info

ログレベル (debug, info, warn, error)

DATABASE_PATH

./data/design-patterns.db

SQLiteデータベースパス

ENABLE_HYBRID_SEARCH

true

ブレンドRAG検索の有効化

ENABLE_GRAPH_AUGMENTATION

true

パターン関係トラバーサルの有効化

EMBEDDING_COMPRESSION

true

次元削減

ENABLE_FUZZY_LOGIC

true

ファジーロジックによる結果の洗練

ENABLE_TELEMETRY

true

パフォーマンスメトリクス

ENABLE_MULTI_LEVEL_CACHE

true

L1 + L3 キャッシュ

MAX_CONCURRENT_REQUESTS

10

同時リクエスト制限

CACHE_MAX_SIZE

1000

キャッシュサイズ制限

CACHE_TTL

3600000

キャッシュTTL (ミリ秒)

TRANSPORT_MODE

stdio

トランスポートモード (stdio/http)

HTTP_PORT

3000

HTTPポート (httpモード)

MCP_ENDPOINT

/mcp

MCPエンドポイントパス

HEALTH_CHECK_PATH

/health

ヘルスチェックパス

SKIP_DB_SETUP

false

データベースセットアップのスキップ

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-mcp

Docker Compose

docker compose up --build -d

環境変数

変数

デフォルト

説明

TRANSPORT_MODE

stdio

トランスポートモード (stdio/http)

HTTP_PORT

3000

HTTPポート (httpモード)

MCP_ENDPOINT

/mcp

MCPエンドポイントパス

HEALTH_CHECK_PATH

/health

ヘルスチェックパス

DATABASE_PATH

/app/data/design-patterns.db

SQLiteデータベースパス

LOG_LEVEL

info

ログレベル

SKIP_DB_SETUP

false

データベースセットアップのスキップ

エンドポイント (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

repositories/pattern-repository.ts

Service Layer

services/pattern-service.ts

Object Pool

services/statement-pool.ts

Dependency Injection

core/container.ts

Strategy

strategies/search-strategy.ts

Event Bus

events/event-bus.ts

Multi-Level Cache

services/multi-level-cache.ts

Builder

core/config-builder.ts

貢献

貢献を歓迎します!プルリクエストを送信する前に、貢献ガイドラインをお読みください。

  1. リポジトリをフォークする

  2. フィーチャーブランチを作成する

  3. SOLID原則に従って変更を加える

  4. テストとリンティングを実行する

  5. プルリクエストを送信する

ライセンス

MITライセンス - 詳細は LICENSE を参照してください。

リソース


バージョン: 0.4.4
最終更新: 2026年2月
パターン: 685以上 (750以上のJSONファイル)
テスト: 464テストケース | 100%合格

Install Server
A
license - permissive license
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity
Issues opened vs closed

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

  • A
    license
    -
    quality
    D
    maintenance
    Enables 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
  • A
    license
    A
    quality
    F
    maintenance
    Provides code repository indexing and semantic search capabilities, allowing natural language queries to find relevant code snippets with automatic incremental indexing and multi-language support.
    1
    37
    359
    ISC
  • F
    license
    -
    quality
    D
    maintenance
    Enables semantic search and knowledge management for storing and querying principles, patterns, and learnings using hybrid keyword and vector search.
    1

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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