Software Design

io.github.qwertymuzaffar由 GitHub 账号 qwertymuzaffar 发布v0.1.3更新于 Oct 24, 2026

SOLID/OOP/DRY, the 23 GoF patterns, pattern scaffolding, and heuristic code-smell detection.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地 MCP 服务器,为助手提供 SOLID、OOP 与 23 种 GoF 设计模式的参考资料,并支持模式脚手架与启发式代码坏味检测。

可以做什么
  • 列出并讲解设计概念:浏览原则、SOLID、OOP 四大支柱与 23 种 GoF 模式的目录,并按 slug、名称或别名获取完整说明(意图、适用场景、权衡、参与者)。
  • 生成模式脚手架:输出与语言无关的 GoF 模式伪代码骨架,可把角色重命名为你的领域名称。
  • 扫描代码坏味:对长方法、大类、长参数列表、深层嵌套、重复和大文件做启发式检查,阈值可按次调整,每条结果附带建议的重构方向。
  • 读取内置资源,了解原则、模式以及坏味检测的局限。
  • 提供评审与重构提示词,引导客户端模型评审代码片段或套用指定模式。
适用场景
适合希望助手引用一致、权威的设计原则与模式定义,在编码前先勾勒模式结构,或对代码片段获取快速结构性提示的场景。它面向设计指导与判断辅助,而非对架构做通过/不通过的评分。
运行要求
以本地 stdio 进程运行,通常通过 npx 启动 npm 包 mcp-software-design,因此需要 Node.js,首次拉取还需要网络访问。未声明任何认证、环境变量或请求头。从源码构建需要 npm install 与 npm run build。
安装前请注意
坏味检测明确只是启发式提示而非结论,设计判断交由模型完成,结果应人工复核,不宜当作 lint 规则。传给工具和提示词的代码会发送给助手的模型进行分析。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Software Design,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-software-design

[npm version] [npm downloads] [License: MIT] [MCP]

An MCP server that teaches and helps apply software-design guidance — the SOLID principles, the OOP pillars, DRY / KISS / YAGNI / meaningful naming / clean code, and the 23 Gang-of-Four design patterns — plus pattern scaffolding and heuristic code-smell detection.

It's the companion to mcp-udacity-commit: same stack (TypeScript, the MCP SDK, stdio transport), same shape (pure logic modules + thin server wiring).

Install

Register it with Claude Code — one line, nothing to clone:

bash
claude mcp add software-design -- npx -y mcp-software-design

Or in an MCP client config:

json
{  "mcpServers": {    "software-design": {      "command": "npx",      "args": ["-y", "mcp-software-design"]    }  }}

Why this exists — and its one honest caveat

The commit server can lint: "subject ≤ 50 chars" is objectively checkable. Design principles and patterns are not like that — "does this violate SRP?" or "should this be a Factory?" are judgment calls, not lint rules.

So this server does not pretend to grade your architecture pass/fail. Instead it does the parts that are genuinely reliable, and hands the judgment to the model:

CapabilityPrimitiveWhat it gives you
Referenceresources + explain_conceptAuthoritative, consistent definitions so the model cites the same thing every time.
Scaffoldingscaffold_patternA language-agnostic skeleton of a pattern's participants.
Smell heuristicscheck_smellsA few genuinely-checkable proxies (long method, deep nesting, …) — hints, never verdicts.
Explain / applyreview_design, apply_pattern promptsPrime the model to review or refactor, grounded in the tools + resources above.

Design analysis is a judgment call, so the "explain/apply helper" is exposed as MCP prompts (which drive the client's model) rather than server code pretending to understand your snippet.

Tools

  • list_catalog { kind? } — list concepts, optionally filtered (principle | solid | oop | pattern | creational | structural | behavioral). solid / oop narrow to the SOLID five / the four OOP pillars.
  • explain_concept { name } — full guidance for one principle or pattern (intent, when-to-use, trade-offs, participants). Accepts a slug, name, or alias ("SRP", "open-closed", "pubsub").
  • scaffold_pattern { pattern, names? } — pseudo-code skeleton for a GoF pattern; names optionally renames roles to your domain ({ "Product": "Notification" }).
  • check_smells { code, …thresholds? } — heuristic scan for long method, large class, long parameter list, deep nesting, duplication, and large file. Each finding names the principle it hints at plus a suggested refactor. All thresholds are overridable per call.

Resources

  • design://principles — SOLID, OOP pillars, DRY, KISS, YAGNI, meaningful naming, and more.
  • design://patterns — the 23 GoF patterns, grouped creational / structural / behavioral.
  • design://smells — what check_smells detects, its thresholds, and its caveats.

Prompts

  • review_design { code, focus? } — review a snippet against the principles/patterns, grounded in check_smells + the resources.
  • apply_pattern { pattern, code } — refactor a snippet to apply a named pattern (and first judge whether it even fits).

Build from source

For local development, or to run a local checkout instead of the published package:

bash
npm installnpm run build      # compiles src → buildnpm start          # runs the stdio servernpm test           # builds, then runs the unit testsnpm run test:client  # end-to-end check against the built server

Then register it the same way as Install above — both the claude mcp add command and the MCP-client-config form work — but point at your local build instead of npx:

bash
claude mcp add software-design -- node /absolute/path/to/mcp-software-design/build/index.js

Layout

src/  catalog.ts   # principles + 23 GoF patterns (data + lookup + markdown)  smells.ts    # pure, testable code-smell heuristics  scaffold.ts  # renders a pattern's participants into a skeleton  index.ts     # MCP wiring: resources, tools, promptstest/  catalog.test.mjs   # catalog lookup + scaffolder  smells.test.mjs    # smell detectors (incl. string/comment edge cases)

The src/*.ts logic modules are pure and side-effect-free, so they're unit tested directly against the compiled output — the server (index.ts) is only thin wiring on top.

License

MIT

来源:README.md,提交 c9d7077

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分