ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Design Pattern MCP

โดย olkรุ่น 1.0.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.olk/design-pattern-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

MCP server that provides design-pattern selection expertise to AI coding agents

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ออกแบบ ภาพ และเสียง
  • ต้องใส่ค่าเหล่านี้: DESIGN_PATTERN_GENERATOR_API_KEY, DESIGN_PATTERN_EMBEDDER_BASE_URL, DESIGN_PATTERN_EMBEDDER_API_KEY, DESIGN_PATTERN_RERANKER_BASE_URL

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

  • ผลตรวจเบื้องต้น: ผ่าน 1 จาก 1 ข้อ
  • รันในเครื่องคุณด้วยสิทธิ์ของผู้ใช้คุณ (ไฟล์ อินเทอร์เน็ต แอปต่าง ๆ)
  • ค่าที่คุณต้องใส่เอง: DESIGN_PATTERN_GENERATOR_API_KEY, DESIGN_PATTERN_GENERATOR_PROVIDER, DESIGN_PATTERN_GENERATOR_MODEL, DESIGN_PATTERN_GENERATOR_BASE_URL, DESIGN_PATTERN_PATTERN_DIRECTORY, DESIGN_PATTERN_EMBEDDER_BASE_URL, DESIGN_PATTERN_EMBEDDER_API_KEY, DESIGN_PATTERN_RERANKER_BASE_URL

ค่าที่ติดป้ายความลับคือกุญแจของบัญชีคุณ อย่าส่งให้ใคร และอย่าวางในแชต

ต้องเตรียมก่อน

  • Dockerติดตั้ง Docker ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "design-pattern": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DESIGN_PATTERN_GENERATOR_API_KEY",
        "-e",
        "DESIGN_PATTERN_GENERATOR_PROVIDER",
        "-e",
        "DESIGN_PATTERN_GENERATOR_MODEL",
        "-e",
        "DESIGN_PATTERN_GENERATOR_BASE_URL",
        "-e",
        "DESIGN_PATTERN_PATTERN_DIRECTORY",
        "-e",
        "DESIGN_PATTERN_EMBEDDER_BASE_URL",
        "-e",
        "DESIGN_PATTERN_EMBEDDER_API_KEY",
        "-e",
        "DESIGN_PATTERN_RERANKER_BASE_URL",
        "docker.io/olkowa/design-pattern-mcp:1.0.1",
        "--transport",
        "stdio"
      ],
      "env": {
        "DESIGN_PATTERN_GENERATOR_API_KEY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_PROVIDER": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_MODEL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_BASE_URL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_PATTERN_DIRECTORY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_EMBEDDER_BASE_URL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_EMBEDDER_API_KEY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_RERANKER_BASE_URL": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add design-pattern --env DESIGN_PATTERN_GENERATOR_API_KEY='ใส่ค่าของคุณ' --env DESIGN_PATTERN_GENERATOR_PROVIDER='ใส่ค่าของคุณ' --env DESIGN_PATTERN_GENERATOR_MODEL='ใส่ค่าของคุณ' --env DESIGN_PATTERN_GENERATOR_BASE_URL='ใส่ค่าของคุณ' --env DESIGN_PATTERN_PATTERN_DIRECTORY='ใส่ค่าของคุณ' --env DESIGN_PATTERN_EMBEDDER_BASE_URL='ใส่ค่าของคุณ' --env DESIGN_PATTERN_EMBEDDER_API_KEY='ใส่ค่าของคุณ' --env DESIGN_PATTERN_RERANKER_BASE_URL='ใส่ค่าของคุณ' -- docker run -i --rm -e DESIGN_PATTERN_GENERATOR_API_KEY -e DESIGN_PATTERN_GENERATOR_PROVIDER -e DESIGN_PATTERN_GENERATOR_MODEL -e DESIGN_PATTERN_GENERATOR_BASE_URL -e DESIGN_PATTERN_PATTERN_DIRECTORY -e DESIGN_PATTERN_EMBEDDER_BASE_URL -e DESIGN_PATTERN_EMBEDDER_API_KEY -e DESIGN_PATTERN_RERANKER_BASE_URL docker.io/olkowa/design-pattern-mcp:1.0.1 --transport stdio

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "design-pattern": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DESIGN_PATTERN_GENERATOR_API_KEY",
        "-e",
        "DESIGN_PATTERN_GENERATOR_PROVIDER",
        "-e",
        "DESIGN_PATTERN_GENERATOR_MODEL",
        "-e",
        "DESIGN_PATTERN_GENERATOR_BASE_URL",
        "-e",
        "DESIGN_PATTERN_PATTERN_DIRECTORY",
        "-e",
        "DESIGN_PATTERN_EMBEDDER_BASE_URL",
        "-e",
        "DESIGN_PATTERN_EMBEDDER_API_KEY",
        "-e",
        "DESIGN_PATTERN_RERANKER_BASE_URL",
        "docker.io/olkowa/design-pattern-mcp:1.0.1",
        "--transport",
        "stdio"
      ],
      "env": {
        "DESIGN_PATTERN_GENERATOR_API_KEY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_PROVIDER": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_MODEL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_BASE_URL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_PATTERN_DIRECTORY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_EMBEDDER_BASE_URL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_EMBEDDER_API_KEY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_RERANKER_BASE_URL": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "design-pattern": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DESIGN_PATTERN_GENERATOR_API_KEY",
        "-e",
        "DESIGN_PATTERN_GENERATOR_PROVIDER",
        "-e",
        "DESIGN_PATTERN_GENERATOR_MODEL",
        "-e",
        "DESIGN_PATTERN_GENERATOR_BASE_URL",
        "-e",
        "DESIGN_PATTERN_PATTERN_DIRECTORY",
        "-e",
        "DESIGN_PATTERN_EMBEDDER_BASE_URL",
        "-e",
        "DESIGN_PATTERN_EMBEDDER_API_KEY",
        "-e",
        "DESIGN_PATTERN_RERANKER_BASE_URL",
        "docker.io/olkowa/design-pattern-mcp:1.0.1",
        "--transport",
        "stdio"
      ],
      "env": {
        "DESIGN_PATTERN_GENERATOR_API_KEY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_PROVIDER": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_MODEL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_GENERATOR_BASE_URL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_PATTERN_DIRECTORY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_EMBEDDER_BASE_URL": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_EMBEDDER_API_KEY": "ใส่ค่าของคุณ",
        "DESIGN_PATTERN_RERANKER_BASE_URL": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • DESIGN_PATTERN_GENERATOR_API_KEY ความลับ จำเป็น env
    API key for the generator LLM (LiteLLM provider).
  • DESIGN_PATTERN_GENERATOR_PROVIDER env
    LiteLLM provider prefix, e.g. openai, anthropic, openrouter.
  • DESIGN_PATTERN_GENERATOR_MODEL env
    Model name, combined as / via LiteLLM.
  • DESIGN_PATTERN_GENERATOR_BASE_URL env
    OpenAI-compatible base URL (LiteLLM api_base).
  • DESIGN_PATTERN_PATTERN_DIRECTORY env
    Directory with the catalog records (*.json main records plus per-language files). The image bakes the 438-record catalogue at /app/pattern.
  • DESIGN_PATTERN_EMBEDDER_BASE_URL จำเป็น env
    Required: the dense retrieval leg embeds the 438-record catalogue during startup warmup and the server refuses to start when the endpoint is unreachable. TEI embeddings endpoint: on the Docker host u…
  • DESIGN_PATTERN_EMBEDDER_API_KEY ความลับ env
    API key for the embedder. Keyless TEI accepts any non-empty value; use 'not-needed' there.
  • DESIGN_PATTERN_RERANKER_BASE_URL จำเป็น env
    Required: retrieval runs a mandatory TEI cross-encoder rerank whenever the fused pool has more than one candidate. On the Docker host use http://host.docker.internal:8080; on a shared Docker network…

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub olk ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ออกแบบ ภาพ และเสียงi

  • ดาวมากกว่า 0% ของอีก 2172 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 51% ของอีก 2172 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 2172 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Design Pattern MCP ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: DESIGN_PATTERN_GENERATOR_API_KEY, DESIGN_PATTERN_EMBEDDER_BASE_URL, DESIGN_PATTERN_EMBEDDER_API_KEY, DESIGN_PATTERN_RERANKER_BASE_URL

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (1.0.1) เข้า registry 27 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Docker ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Figma Context MCP, Claude Real Video, Figma MCP Server

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Figma Context MCP

โดย GLips

Give your coding agent access to your Figma data. Implement designs in any framework in one-shot.

รันบนเครื่อง★ 16,165MITอัปเดต 5 เดือนที่ผ่านมา
ติดตั้ง

Claude Real Video

โดย HUANGCHIHHUNGLeo

Let any LLM watch a video locally — and search everything it has ever watched.

รันบนเครื่อง★ 2,284MITอัปเดต 2 เดือนที่ผ่านมา
ติดตั้ง

Figma MCP Server

โดย figma

server ทางการของ Figma ส่งข้อมูลงานออกแบบให้ AI อ่าน เพื่อเปลี่ยนแบบเป็นโค้ดหรืออธิบายแบบได้ตรงขึ้น ต่อผ่านคลาวด์ของ Figma

รันบนคลาวด์★ 2,152อัปเดต 13 เดือนที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

design-pattern-mcp

An MCP (Model Context Protocol) server that provides design-pattern selection expertise to AI coding agents. Given a free-text description of a system, it analyses the problem, retrieves matching design patterns (from 486 built-in patterns, each realized in 13 concrete languages plus a generic binding), generates a concrete design with a primary pattern, supporting patterns, participants, interactions, implementation steps, and language-bound variants, and evaluates it against eight design-level quality axes (testability, extensibility, maintainability, simplicity, performance, reliability, security, scalability). The pipeline (analyze → weights ∥ retrieval → generate → evaluate → bounded refine) and its wire contract are specified in docs/implementation-guide.md.


Table of Contents

  • ⚡ Quickstart
  • Install via AI Agent
  • 🔌 Connect Your Agent
  • Claude Code
  • OpenCode
  • Codex CLI
  • 🧑🏫 SKILL for AI Agents
  • 🧪 Use the Tools
  • 🛠️ Tools at a Glance
  • 💬 Prompts
  • 📖 Pattern Catalog
  • Working Together with architecture-pattern-mcp
  • Install Alternatives
  • Docker (manual)
  • Local Development (uv)
  • Configuration
  • Structured Reasoning
  • Long-running tools & timeouts
  • Benchmarks & Verification
  • Troubleshooting
  • Building & Development
  • Publishing
  • systemd Service (Linux)
  • License

⚡ Quickstart

# 1. Clone

git clone https://git.odvlh.xyz/olli/design-pattern-mcp.git && cd design-pattern-mcp

2. Add your API key

export MINIMAXAI_API_KEY=your_key_here

3. Build + start (three images: MCP server + TEI embed + TEI rerank)

make docker-build-all make docker-up

4. Demo (analyze-only: fast. For the full design: make client-design)

make client-analyze make client-async # full design via the background job trio

Server starts on streamable-http at http://localhost:8822/mcp (dev compose maps host 8822 → container 8050). make client-analyze / make client-design target http://localhost:8822/mcp; override with CLIENT_URL.


Install via AI Agent

To have an AI coding agent install the Docker stack from prebuilt images (no local build), point it at [INSTALL.md](INSTALL.md) — the non-interactive agent runbook (copy-paste commands, expected outputs, verification probes).

Clone this repo, then follow INSTALL.md Path A (compose stack, port 8822).

My generator API key is: sk-...

Pick one path in INSTALL.md:

  • Path A — Compose stack (:8822): evaluating / developing, no sudo needed. Own TEI sidecar copies.
  • Path B — systemd stack (:8812): persistent host service, starts at boot, needs sudo. Uses the shared pattern-tei-infra TEI stack.

The agent needs a repo clone, Docker ≥ v2.20 with group membership, ~8 GB free, a MINIMAXAI_API_KEY (or another provider per INSTALL.md#switching-the-generator-llm), and linux/amd64 (on arm64 it builds locally via make docker-build-all). Dev and systemd stacks run concurrently on their default host ports (8822 vs 8812). After install, continue with Connect Your Agent below.


🔌 Connect Your Agent

Claude Code
# Install (one-time)

uv pip install -e .

Run as stdio subprocess — pass the API key via env

claude mcp add design-patterns \ -e GENERATOR_PROVIDER=minimax \ -e GENERATOR_MODEL=minimax/MiniMax-M2.7 \ -e GENERATOR_BASE_URL=https://api.minimax.io/v1 \ -e GENERATOR_API_KEY=your_key \ -- design-pattern-mcp --transport stdio

Stdio mode needs the TEI endpoints reachable (default http://design-pattern-tei-embed:8080 and the reranker URL from config/config.json) — either run the compose stack's sidecars or set EMBEDDER_BASE_URL / RERANKER_BASE_URL to your own. For a no-network smoke run, start with --offline (deterministic lexical-only retrieval instead of TEI).

OpenCode

OpenCode uses HTTP transport. Start the server first, then configure opencode:

# Terminal 1: start the server

make docker-up

or locally:

uv run design-pattern-mcp --transport streamable-http --port 8050

Terminal 2: add to ~/.config/opencode/opencode.json

{

"$schema": "https://opencode.ai/config.json", "mcp": { "design-patterns": { "type": "remote", "url": "http://localhost:8822/mcp" } } }

Note: the generator API key is read by the server from its config file (config/config.json, {env:...} placeholders), not from opencode's environment.

Codex CLI
# Install (one-time)

uv pip install -e .

Add to ~/.codex/config.toml:

[mcp_servers.design-patterns]

command = "design-pattern-mcp" args = ["--transport", "stdio"]

[mcp_servers.design-patterns.env] GENERATOR_PROVIDER = "minimax" GENERATOR_MODEL = "minimax/MiniMax-M2.7" GENERATOR_BASE_URL = "https://api.minimax.io/v1" GENERATOR_API_KEY = "your_key"

Or via CLI:

codex mcp add design-patterns \

-e GENERATOR_API_KEY=your_key \ -- design-pattern-mcp --transport stdio


🧑🏫 SKILL for AI Agents

The SKILL in skills/design-pattern-mcp/ is written for Oh My Pi (OMP), where this server's tools are reached as xd://mcp__design_pattern_local_* devices and every MCP request is bounded by a deadline (OMP_MCP_TIMEOUT_MS → per-server timeout → 30 s). It teaches the agent which entry point fits that deadline, how to read the results, and the full workflow recipes.

skills/design-pattern-mcp/

├── SKILL.md # OMP constraints, entry-point decision guide, device quick reference └── references/ ├── tools.md # 9 tool signatures, arg shapes, status codes └── workflows.md # workflow recipes, result interpretation, troubleshooting

Install for OMP — copy the skill directory into OMP's user skills root:

cp -r skills/design-pattern-mcp ~/.omp/agent/skills/

The skill then tells the agent:

  • Which entry point fits OMP's 30 s deadline: the async job trio by default; select_design_patterns (full pipeline) takes 2–10 min
  • Which path fits the job: analyze_design when the agent writes the code itself (decisions and rationale, no generated design), the full pipeline when the caller wants the design
  • That job_id is the only durable handle — persist it (SQLite job store, JOBS_DB)
  • How to phrase description (component names + responsibilities + constraints), and language, paradigm, focus as separate structured arguments
  • How to interpret overview.score (0–100), findings[], and per-part selections

The tool schemas in references/ are client-agnostic; only the deadline/device guidance is OMP-specific.


🧪 Use the Tools

All pipeline tools take a free-text description as the primary argument. The examples below show the exact tool call shape so you can use them in any MCP client or API consumer.

Design your first selection

In Claude Code (or any MCP client), paste the natural-language instruction:

We're building the ingestion path of an IoT platform: a Kafka consumer

service parses 10k events/sec, an enricher adds geolocation from Redis, and a writer persists to InfluxDB and S3. Components: consumer, parser, enricher, sink. Constraints: at-least-once delivery, backpressure, Python.

Your agent calls select_design_patterns internally. The server returns the DesignResult: overview (primary pattern, supporting patterns, principles, score, reasoning), applications[] (participants, interactions, implementation_steps, code_sketch, language_binding with the bound variant), interactions[], quality_attributes, test_strategy, and risks[].

Coding agents that write the code themselves should call `analyze_design` instead. It runs the same ANALYZE phase (§1–§8: brief repair → decision parts → per-part retrieval → quality weights → selection) and stops there: you get the repaired brief, the decision parts and one selection per part (primary, supporting patterns, ranked alternatives, veto ledger, weights) with no generated applications and no evaluation. The selection names *what* to apply per part, not *how* — participants, implementation steps, code sketches and language bindings are materialized by generate_design from that payload (or read via get_design_pattern per pattern); implement from the applications, never from the bare pattern names. select_design_patterns remains the design path — it continues through GENERATE → EVALUATE, where the bulk of a full run's wall clock goes. Either way, the decisions come from the same ANALYZE stage — a fresh LLM analysis per call, so neither path is idempotent; pass the analyze_design payload to generate_design if you later want the materialized applications.

Or call tools directly from your agent:

Call select_design_patterns with:

description: "IoT ingestion path: Kafka consumer (10k events/sec) → JSON parse → Redis geo-enrich → InfluxDB + S3 sink. At-least-once, backpressure." language: "python"

Call list_design_patterns() # all 486 patterns Call list_design_patterns(category="workflow-messaging") Call get_design_pattern(name="process-manager")

Async job pattern: submit_design_job + get_design_status

For clients with short request timeouts. submit_design_job returns a job_id immediately; poll get_design_status until done:

# Step 1: start the job

Call submit_design_job with: description: "IoT ingestion path: Kafka consumer → parse → Redis enrich → InfluxDB + S3"

Step 2: poll every 10-30 seconds

Call get_design_status with: job_id: " "

→ status is "pending" | "running" | "completed" | "failed" | "cancelled"

When status is "completed", the full DesignResult is in result

When status is "failed", the error is in error

In Python (via the MCP client API — see examples/design_pattern_client_async.py):

import asyncio

from fastmcp import Client

SERVER = "http://localhost:8822/mcp" POLL_EVERY = 15 # seconds

async def main(): client = Client(SERVER) async with client:

Step 1: start the job

result = await client.call_tool( "submit_design_job", {"description": "IoT ingestion: Kafka → parse → enrich → sink"}, ) job_id = result.data["job_id"] print(f"Job started: {job_id}")

Step 2: poll until terminal state

while True: await asyncio.sleep(POLL_EVERY) status = await client.call_tool("get_design_status", {"job_id": job_id}) data = status.data print(f" status={data['status']}") if data["status"] in ("completed", "failed", "cancelled"): break

print(data.get("result", data)) # full DesignResult when completed

asyncio.run(main())

See examples/design_pattern_client_async.py for the complete runnable example. Run it with:

make docker-up          # Termina

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx