Enterprise Architect MCP Server
Enterprise Architect MCP Server
一个只读的 Model Context Protocol (MCP) 服务器,用于 Sparx Enterprise Architect 的 .qea 导出。让 AI 代理能够访问 EA 分析模型——搜索元素、导航包、读取用例场景、遍历连接器——而无需运行中的 EA 实例。
适用于任何 MCP 客户端(VS Code / GitHub Copilot、Claude Desktop、Cursor、Windsurf)。直接读取 .qea SQLite 导出,从不写入,并且每个响应都携带完整性元数据,使代理能够区分截断的答案和完整的答案。
关键词: MCP 服务器 · Sparx Enterprise Architect · .qea · UML · 用例场景 · 包树 · 连接器 · 图 · 模型搜索 · AI 代理工具
前提条件
Node.js 22+(使用内置的
node:sqlite模块)从 Sparx Enterprise Architect 导出的
.qea文件
Related MCP server: jgs-sysmlv2-api-mcp
安装
VS Code / GitHub Copilot
最快的途径是页面顶部的 Install in VS Code 徽章。无需填写任何内容:服务器会在代理首次查询模型时询问你的 .qea 路径,并记住答案以供下次使用。
如果想改为从终端注册(更适合脚本或共享设置),只需一次 CLI 调用:
code --add-mcp '{\"name\":\"enterprise-architect\",\"command\":\"npx\",\"args\":[\"-y\",\"enterprise-architect-mcp\"]}'\" 序列是用于 code shim 的,它会在 PowerShell 已经传递参数后重新解析参数——使用 PowerShell 自己的反引号转义,或使用 --%,仍然会以引号被剥离的方式到达。单引号可阻止 PowerShell 触碰该字符串。在 bash 或 zsh 上,普通形式即可:
code --add-mcp '{"name":"enterprise-architect","command":"npx","args":["-y","enterprise-architect-mcp"]}'如果想手动配置,请添加到项目的 .vscode/mcp.json 中:
{
"servers": {
"enterprise-architect": {
"type": "stdio",
"command": "npx",
"args": ["-y", "enterprise-architect-mcp"]
}
}
}该文件中不包含任何个人信息,因此可以原样提交,每位开发者在自己的机器上只需回答一次提示。如果你完全不想被询问,可以预先指定路径——作为尾随参数、在 env 块中,或在工作区根目录的 gitignored .env 文件中:
EA_QEA_PATH=C:\EA\exports\model.qeaClaude Desktop
相同的无路径配置放在 claude_desktop_config.json 中(Windows 上为 %APPDATA%\Claude\,macOS 上为 ~/Library/Application Support/Claude/):
{
"mcpServers": {
"enterprise-architect": {
"command": "npx",
"args": ["-y", "enterprise-architect-mcp"]
}
}
}Claude Desktop 不会从工作区文件夹运行服务器,因此那里的 .env 不可靠。如果客户端根本无法显示路径提示,服务器会明确说明而不是静默失败,你可以在 env 块中指定路径:
"env": { "EA_QEA_PATH": "C:\\EA\\exports\\model.qea" }要从源代码而不是 npm 直接运行,请使用 "args": ["-y", "github:mm6502/enterprise-architect-mcp"]。
配置
服务器启动时不需要路径。当代理首次查询模型时,它会查找路径,并采用第一个实际能打开的来源:
CLI 参数 —
mcp-server-ea C:\path\to\model.qea环境变量 —
EA_QEA_PATH(在env块或系统环境中设置).env文件 — 工作目录中.env文件里的EA_QEA_PATH=...记住的答案 — 你上次告诉提示的内容
提示 — 客户端询问,有效的答案会被记住以供下次使用
指定了无法打开的路径的来源会被跳过而不是致命错误,因此下一个来源会获得机会。原因会记录到服务器日志中,一旦后续某个来源打开,ea_get_model_info 会将其列在 ignored 下。这是有意为之——否则 env 块中遗留的示例值会凌驾于你能给出的所有答案之上,回答提示也永远不会起作用。代价是真正的拼写错误会被静默降级,因此如果服务器打开的是与你预期不同的模型,请检查 ea_get_model_info。
只有当某个答案能够取代被跳过的来源时,跳过才有意义,因此有两种情况保持致命:你在命令行上传递的路径(这是本次运行的明确指令,不是过时的默认值),以及客户端无法显示提示时的任何损坏来源——在这种情况下继续下去会静默打开其他模型,而不是告诉你。
答案按机器记住,Windows 上位于 %APPDATA%\enterprise-architect-mcp\,macOS 上位于 ~/Library/Application Support/enterprise-architect-mcp/,其他系统位于 $XDG_CONFIG_HOME(或 ~/.config);设置 EA_MCP_CONFIG_DIR 可将该文件放在其他位置。无法打开的路径永远不会被记住,因此再次询问即可纠正输错的答案。
如果路径指向目录,服务器会自动按修改时间选择最新的 .qea 文件。指向你的导出文件夹意味着无需重新配置即可获取新的导出。
预先指定路径
如果你完全不想看到提示——CI 作业、共享镜像,或仅仅是个人偏好——请将路径放在工作目录中 gitignored 的 .env 文件中。复制模板:
Copy-Item .env.example .env然后在 .env 中设置你的本地路径:
EA_QEA_PATH=C:\EA\exports\model.qea目录也可以——将使用其中最新的 .qea 文件:
EA_QEA_PATH=C:\EA\exports\.env 文件是 gitignored 的——每位开发者设置自己的路径,不影响共享配置。它也永远不会被提交,这就是为什么它是每个新用户都必须手动设置的一条途径;回答一次提示即可使其变得不必要。
可用工具
工具 | 描述 |
| 跨元素、属性、操作和约束进行全文搜索。不区分大小写,覆盖斯洛伐克字母表,解码实体编码文本。 |
| 完整的元素详情——属性、操作、出现的图、约束(前置/后置/不变量/过程)。标记属性多重性是否具有对比性。 |
| 列出包中的元素,可选按类型过滤。报告总数并支持分页。 |
| 元素的关系——包括特性链接解析(每个端点连接到哪个属性/操作)。 |
| 图上的元素和连接器,包括隐含连接器和特性链接。 |
| 用例场景步骤,包含所有属性(触发器、使用、结果、链接、状态)和场景注释。 |
| 以递归深度导航包层次结构。 |
| 按名称和包搜索图。 |
| 将分析师引用(花括号 GUID 或纯名称)解析为带有完整包路径的模型候选。对于分析师代码回退到名称前缀匹配;每个候选都带有 |
| 检查模型的数据库模式——表、列、索引、rowid 别名。 |
| 打开的导出的身份信息——文件名、大小、修改日期、服务器版本,以及路径来自哪个配置来源。 |
响应约定
每个工具都返回结构化 JSON,包含:
_meta.sourceTables— 查询了哪些数据库表totalMatched/returned/truncated— 每个集合的完整性元数据continuation— 截断时用于检索完整集合的确切调用isError: true+{ error: "not_found" }用于不存在的主题(与空结果不同)
存在两个字段以防止不精确的答案被误读为已确认的答案:
ea_resolve—match始终存在;只有prefix是不精确匹配ea_get_element—_meta.attributes.multiplicityIsUniform: true表示元素的属性没有显示多重性对比,因此1..1不是必需性的证据
示例提示
连接后,可以尝试如下提示:
"搜索与 'legal entity' 相关的元素"
"显示根目录下的包结构"
"UC_SUBMIT_APPLICATION 的用例场景是什么?"
"图 0103 Application Processing 上有哪些元素和连接器?"
"解析引用 {3F2A7C10-5B4D-4e8a-9C1F-27D6E8B0A4F3}"
"t_connector 有哪些列?"
"元素 a7680 出现在哪些图上?"
许可证
版权所有 (c) 2026 Michal Mracka
根据 EUPL 许可——完整文本见 LICENSE。
Available Tools
12 toolsea_get_connectorsARead-only
Get all relationships (connectors) for a given element. connectors lists what the element is connected to and how (Realisation, Dependency, Association, etc.), each entry naming its source and dest ends. For Generalization connectors, source is always the specific (child) type and dest the general (parent) type — each end also carries a role making this explicit without needing to reason about direction. Filter by connectorType and direction to list an element's direct children (incoming Generalization) or direct parent(s) (outgoing Generalization) without a diagram. Feature links show which specific attribute or operation each end attaches to.
Inputs: elementId (required), direction, connectorType.
ea_get_diagram_elementsARead-only
Get all elements and connectors placed on a specific diagram: the diagram itself, plus elements and connectors. elements already includes free-text Note diagram objects, which often carry a legend or abbreviation definitions an agent would otherwise miss. Connectors include feature-link resolution showing which attribute or operation each end attaches to. The connector list is the union of explicit t_diagramlinks rows and implied connectors (both ends on the diagram).
Inputs: diagramId (required).
ea_get_elementARead-only
Get full details of an Enterprise Architect element by its ID, including its Note, attributes, operations, the diagrams it appears on, and its constraints. Attribute multiplicity supports a requiredness inference only when the element uses multiplicities contrastively; read _meta.attributes.multiplicityIsUniform before making that inference — when it is true the element's attributes carry no multiplicity contrast, so a value like 1..1 is not evidence of requiredness. Attributes and operations are capped inline: attributesTruncated/operationsTruncated say whether the returned list is partial, and attributesTotal/operationsTotal give the full counts, so never infer a count from the inline list alone.
Inputs: elementId (required).
ea_get_model_infoARead-only
Report which .qea export file the server has open: fileName is the citable identity, alongside fileSizeBytes, lastModified, and the serverVersion that produced the answer. The full local path is also returned as resolvedPath, with resolvedPathNote explaining why it is environment detail rather than something to cite. configuration says where that path came from — source in words, sourceId as one of argument/environment/dotenv/remembered/prompt, and the configured value behind it — plus any skipped settings, each with the reason it could not be opened, and shadowed ones a higher-priority source outranked; configurationNote says how much of that is safe to repeat.
Inputs: no named parameters.
ea_get_package_treeARead-only
Navigate the package hierarchy. Without parameters, returns top-level packages. With a packageId, returns that package's children up to the specified depth. Each node carries id, name, parentId, and elementCount.
Inputs: depth, packageId.
ea_get_scenariosARead-only
Get use case scenario flows for an element. scenarios holds the parsed flows; each has name, type, notes, and steps, and each step carries stepNumber plus its attributes (trigger, uses, result, state, link). Steps are numbered within each scenario. Scenarios ordered by type: Basic Path first, then Alternate, then Exception. A step's uses may name a business rule or constraint by code; that code is not independently searchable or resolvable — look it up among this same elementId's own constraints via ea_get_element, not by a separate lookup.
Inputs: elementId (required).
ea_get_schemaARead-only
List the model's database tables in tables, or pass a tableName to get that table's columns and indexes instead. That form echoes the table name and adds rowidAlias — the INTEGER PRIMARY KEY aliasing SQLite's rowid, so the fastest lookup path, or null when the table has none — with rowidNote saying which case applies. Use this to discover what data the model holds beyond what the typed ea_* tools return. See ea_get_model_info for the export's identity.
Inputs: tableName.
ea_list_diagramsARead-only
List diagrams in the model, optionally filtered by package, diagram type, and/or name substring. Each entry in results carries diagramId, name, type, packagePath, and eaGuid. Diagrams are ordered by the model's internal identity — stable but artificial, neither alphabetical nor the analyst's tree order — so adjacency carries no meaning. Walk a large result set with offset rather than a larger limit; while rows remain, continuation names the next call. When far more diagrams match than one window can hold, breakdown reports how many each type holds, so the next call can narrow by diagramType instead of paging.
Inputs: limit, offset, packageId, diagramType, +1 more.
ea_list_elementsARead-only
List elements within a package, optionally filtered by object type. elements is a lightweight list (ID, type, name, alias, stereotype), grouped by element type and then ordered by the model's internal identity. That order is stable but artificial — neither alphabetical nor the analyst's tree order — so adjacency carries no meaning. Walk a large package with offset rather than a larger limit; while rows remain, continuation names the next call. When far more elements match than one window can hold, breakdown reports how many each type holds, so the next call can narrow by objectType instead of paging.
Inputs: packageId (required), limit, offset, objectType.
ea_resolveARead-only
Resolve an analyst reference (braced GUID or plain name) to model candidates: the input is echoed as reference and the hits are in candidates. A braced GUID is matched exactly. A plain name is matched against the full name first; only if nothing matches exactly is the reference retried as a name prefix, which resolves analyst codes like UC_ABC_2079 or OA_ABC_2280 to elements named 'CODE: description'. An exact hit is returned alone and is never diluted by prefix hits. Each candidate reports its type (element, diagram, package), id, name, fullPackagePath, eaGuid, and a match field that is always present with value "guid", "exact", or "prefix" — a "prefix" candidate is an inexact match and must not be treated as a confirmed identity. Use the optional kind filter to narrow results.
Inputs: reference (required), kind.
ea_searchARead-only
Search Enterprise Architect model elements by name, alias, notes, attribute names/notes, operation names/notes, or constraint notes. Matching is case- and diacritic-insensitive across European Latin alphabets and sees through entity-encoded text. requiredTerms is a list of terms every one of which must occur somewhere in an element's searchable text (conjunction) — terms need not share a field, but sharing one ranks higher; each term is matched as a contiguous substring exactly as a single term is, so a term carrying whitespace is a phrase and is never split. A one-entry list behaves exactly as a single search term always has. boostAnyOf is an optional list of further terms: a result also matching at least one of them ranks ahead of one that does not, but nothing is ever excluded on that basis — for narrowing to only elements matching an alternative too, use ea_search_and_any_of instead. When no element matches, termMatches reports, per supplied term, whether that term matched anywhere in the corpus at all — so a caller can tell which term emptied the result rather than re-guessing the whole call. Matching elements are returned in results, strongest match first, each with a decoded note preview and a truncation flag; equally strong matches fall back to the model's internal identity, a stable but artificial order. Each result also carries matches, the evidence for why it was returned: the field that matched, the id and name of the attribute, operation or constraint it came from, and a snippet of the author's own text around the match. Evidence is strongest-first and capped, and _meta.matches on the result reports how many matches were found and how many were withheld. The note preview centres on the match when the element's own note is what matched. packageScope restricts results to a package (given as its id or its name) and its descendants. Walk a large result set with offset rather than a larger limit; while rows remain, continuation names the next call. When far more elements match than one window can hold, breakdown reports how they distribute — by objectType, stereotype, or, unless already scoped, by packageScope (reported as the matching package's id, which the next call can pass straight back) — so the next call can narrow instead of paging.
Inputs: requiredTerms (required), limit, offset, boostAnyOf, +3 more.
ea_search_and_any_ofARead-only
Search Enterprise Architect model elements the same way ea_search does, plus andAnyOf: a required-and-alternative filter. requiredTerms still works exactly as it does on ea_search (conjunction, contiguous substring, terms need not share a field). andAnyOf is an optional list of further terms; when supplied, a result must contain requiredTerms AND at least one andAnyOf term, so it can only ever narrow — it never returns a result requiredTerms alone would not. An empty andAnyOf array applies no filter. For promoting rather than narrowing, use ea_search instead, which offers the same alternatives idea as a rank boost. When no element matches the required terms at all, termMatches reports, per supplied term, whether it matched anywhere in the corpus. Matching elements are returned in results, strongest first, each with a decoded note preview, a truncation flag, and matches — the evidence for why it was returned, capped and strongest-first, with _meta.matches reporting how many were found and withheld. packageScope restricts results to a package and its descendants. Walk a large result set with offset; while rows remain, continuation names the next call. When far more elements match than one window can hold, breakdown reports how they distribute by objectType, stereotype, or packageScope.
Inputs: requiredTerms (required), limit, offset, andAnyOf, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools target clearly distinct resources (packages, elements, connectors, diagrams, scenarios, schema), but `ea_search` and `ea_search_and_any_of` are effectively the same operation with one extra filter, and their descriptions spend most of their length explaining how they differ from each other. That is a parameter variation surfaced as a separate tool, which invites misselection. `ea_get_element` vs `ea_list_elements` is distinguishable, but the search pair drags the set down.
All names share the `ea_` prefix and follow a verb_noun pattern (`ea_get_element`, `ea_list_diagrams`, `ea_get_connectors`), which is highly predictable. Minor deviations: `ea_resolve` has no object noun, and `ea_search_and_any_of` encodes a parameter in the tool name rather than following the resource+action convention.
Twelve tools is a well-scoped surface for a read-only model browser, and each maps to a real artifact type in the .qea model. The count would be a clean 5 if the two near-duplicate search tools were merged into one with an optional filter.
The surface covers the main exploration paths: package hierarchy, element search and detail, element listing, connectors, diagram listing and contents, scenario flows, raw schema access, reference resolution, and export identity. Gaps remain around tagged values, standalone constraint/attribute/operation lookups, and any write capability, though a read-only inspector scope makes the latter a defensible design choice.
Maintenance
Related MCP Connectors
- ORANO MCP ServerDeprecatedio.github.infotik
Read-only MCP server exposing a user ORANO library to their own AI agent.
Free, source-checked directory of AI agent tools, MCP servers and skills, with read-only search.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseBqualityDmaintenanceA read-only MCP server connecting AI assistants to Azure DevOps Server (on-premises) for browsing projects, repos, builds, work items, releases, pipelines, and test results.391MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that gives an AI agent read and write access to a live SysML v2 model through the vendor-neutral OMG SysML v2 REST API.3-
- FlicenseAqualityDmaintenanceA read-only MCP server that enables AI clients to search a knowledge base and retrieve complete source documents via narrow search and fetch tools.2-
- FlicenseAqualityBmaintenanceA read-only MCP server that gives AI coding agents structured access to a project's source code, architecture, documentation, and Git context through 16 tools for searching, reading, and comparing evidence without modifying files.16-