Skip to main content
Glama
Magento Spec MCP
by thanhle74

Magento 规范与标准(SSOT 和 MCP 服务器)

此仓库是 中央知识库(单一事实来源 - SSOT),涵盖 Magento 2.4.8-p5 / PHP 8.3 标准,并内置了 MCP Server Stdio。

此仓库 不包含流程或任务/功能管理。您可以将此 MCP 服务器连接到任何 Magento 项目,以便该项目的 AI 代理参考技术标准。


📌 结构

  • config/ — 事实来源:

    • constitution.md — PHP 8.3 和 Magento 核心的技术标准。

    • checklist.md — 审查门禁和完成定义(DoD)的标准。

    • magento-patterns.md — 设计地图(插件、事件、GraphQL、REST、Admin 等)。

    • references/ — 各组件的详细代码示例指南。

    • glossary.md — Magento 核心术语。

  • examples/ — 按主题分类的代码蓝图(进入 examples/INDEX.md 选择)。

  • src/index.js — MCP 服务器(stdio)。


Related MCP server: Magector

⚡ MCP 服务器连接配置

Claude Code(建议使用 user 范围,以便在所有项目中可用):

claude mcp add magento-spec -s user -- node /path/to/spec/src/index.js

Cursor(~/.cursor/mcp.json)、Antigravity(~/.gemini/antigravity/mcp_config.json)和其他客户端:

{
  "mcpServers": {
    "magento-spec": {
      "command": "node",
      "args": ["/path/to/spec/src/index.js"]
    }
  }
}

SPEC_ROOT(环境变量)为可选 — 默认情况下服务器会自取仓库的根目录。仅当您将仓库放在其他位置并希望覆盖时才设置。


🛠️ 提供给 AI 的 MCP 工具

工具

描述

get_team_standards

快速加载宪法、检查清单和模式索引。

get_pattern_reference

根据名称获取详细代码模式(例如:core/plugin-patterns.md)。不传路径则列出所有引用。

search_standards

在 config/ + examples/ 中按关键词搜索标准/规则/蓝图。

get_review_gate

加载完成前代码质量检查清单。

read_spec_file

读取仓库中任何文档文件(config/、examples/ 等)。


🔄 给 AI 代理的建议流程

  1. 在编码前: get_team_standards → 加载宪法 + 检查清单 + 模式索引。

  2. 在实现时: 使用 get_pattern_reference / search_standards / read_spec_file 查询模式 — 不要凭记忆猜测。

  3. 在报告完成前: get_review_gate → 通过 checklist.md 中的第 12 节“审查门禁”。

Available Tools

5 tools
get_pattern_referenceA

Get specific Magento pattern reference doc from config/references/ (e.g. core/plugin-patterns.md, core/declarative-schema.md). Call without path to list all available references.

Inputs: path.

get_review_gateA

Load code review gate checklist and DoD criteria for Magento code before marking done.

Inputs: no named parameters.

get_team_standardsA

Load Magento 2.4.8-p5 / PHP 8.3 team standards, constitution, checklist, and pattern index (Single Source of Truth - SSOT).

Inputs: no named parameters.

read_spec_fileA

Read any markdown documentation file in this spec repository — config/, examples/, README.md, etc.

Inputs: path (required).

search_standardsA

Search for Magento standards, rules, patterns, and example blueprints by keyword (scans config/ and examples/).

Inputs: query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation4/5

    The tools are mostly distinct: get_team_standards, get_review_gate, get_pattern_reference, search_standards, and read_spec_file each target different types of content. However, get_team_standards and get_review_gate could be confused as both relate to standards/checklists, and read_spec_file overlaps with get_pattern_reference since pattern references are spec files.

    Naming Consistency4/5

    Tool names follow a consistent verb_noun pattern with 'get_' and 'search_' prefixes, and all use snake_case. The mix of 'get_' (4 tools) and 'search_' (1 tool) is slightly unbalanced but still predictable.

    Tool Count5/5

    With 5 tools, the server is well-scoped for its purpose of providing Magento documentation access. Each tool serves a distinct retrieval function without unnecessary duplication.

    Completeness3/5

    The tool set covers core retrieval operations (load standards, search, read files) but lacks any write or update capabilities. Since the server seems focused on reading spec content, this may be intentional, but the absence of logging or progress-tracking tools is a minor gap.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides AI assistants with comprehensive Magento 2 coding standards, security rules, and theme-specific guidelines to ensure generated code is compliant. It enables real-time code validation, pattern lookup, and security auditing tailored to different Magento frontend stacks.
      7
      16
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Technology-aware MCP server for Magento 2 and Adobe Commerce with intelligent indexing and search, enabling AI assistants to search, navigate, and understand codebases via semantic search and domain-specific pattern detection.
      47
      494 npm
      20
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to manage Magento 2 / Adobe Commerce products, stock, orders, and customers through 12 read/write MCP tools with secure, audited access.
      AGPL 3.0