mmar-mcp-server
MMAR-MCP 服务器
一个 MCP(模型上下文协议)服务器,将大型语言模型连接到 MM-AR 元建模平台,使用户能够通过自然语言交互创建完整的元模型和模型实例。
概述
MMAR-MCP 通过模型上下文协议暴露 MM-AR 平台的能力:
62 个工具,用于认证、元模型 CRUD 和实例 CRUD 操作
5 个资源,提供平台架构文档、VizRep 模板、元模型模式、属性类型和参考元模型
3 个提示,编码了元模型创建、实例创建和模型分析的引导工作流
服务器通过 STDIO 传输通信,可与任何兼容 MCP 的主机(Cursor、Claude Desktop 或任何实现 MCP 规范 的客户端)配合使用。
Related MCP server: ParaView-MCP
前提条件
要求 | 版本 | 目的 |
v18+ | 运行 MCP 服务器 | |
最新 | 运行 MM-AR 平台栈 | |
MCP 主机 | 任意 | 将 LLM 连接到服务器(例如 Cursor、Claude Desktop) |
快速开始
按照以下五个步骤从零开始完成设置。
步骤 1:启动 MM-AR 平台
选项 A:完整 Docker 部署(推荐用于首次设置)
使用 Docker 克隆并启动完整的 MM-AR 栈:
git clone https://github.com/MM-AR/mmar-docker-installation.git
cd mmar-docker-installation
docker compose --env-file .env up -d等待所有容器健康。你可以通过以下命令检查:
docker compose ps选项 B:混合部署(PostgreSQL 在 Docker 中,服务在本地)
这是论文实验期间使用的设置。它需要克隆 主 MM-AR 仓库:
# 1. Start PostgreSQL in Docker
docker run -d --name mmar_postgres \
-e POSTGRES_USER=api -e POSTGRES_PASSWORD=root -e POSTGRES_DB=api \
-p 5432:5432 postgres:16
# 2. Start the API server (requires mmar-server/.env with JWT_SECRET)
cd mmar-server
export $(cat .env | xargs)
cd ..
node dist/mmar-server/index.js
# 3. Start web clients (in separate terminals)
cd mmar-metamodeling-client && npm start # port 8070
cd mmar-modeling-client && npm start # port 8080运行后,以下服务可用:
服务 | URL | 描述 |
API 服务器 | REST API(MCP 服务器连接至此) | |
元建模客户端 | 定义建模语言 | |
建模客户端 | 创建模型实例 | |
VizRep 客户端 | 设计视觉表示 |
通过浏览器访问 http://localhost:8000/login 验证 API 是否启动。你应该会看到一个登录页面。默认凭据:admin / admin。
步骤 2:克隆并构建 MCP 服务器
git clone https://github.com/ProTech001/mmar-mcp-server.git
cd mmar-mcp-server
npm install
npm run buildnpm run build 步骤将 TypeScript 编译为 dist/ 文件夹中的 JavaScript。此步骤是服务器运行所必需的。
步骤 3:验证安装
运行端到端测试套件以确认一切正常:
npm test这会生成 MCP 服务器作为子进程,并通过 STDIO 发送 JSON-RPC 消息,就像真实的 MCP 主机一样。它测试握手、认证、工具列表、资源读取、提示检索以及完整的创建/验证/删除周期。
预期输出(所有测试应通过):
==============================================
MM-AR MCP Server — End-to-End Test
==============================================
✅ PASS Initialize (handshake)
→ Server: mmar-mcp-server
✅ PASS List Tools
→ 62 tools registered (expected 62)
✅ PASS List Resources
→ 5 resource(s) (expected 5)
✅ PASS Read Platform Info Resource
→ ...
...
==============================================
Results: 16 passed, 0 failed, 16 total
==============================================如果任何测试失败,请参阅下面的故障排除部分。
步骤 4:配置你的 MCP 主机
服务器通过 STDIO 运行。配置你的 MCP 主机以将其作为子进程启动。
Cursor IDE — 在项目根目录创建或编辑 .cursor/mcp.json:
{
"mcpServers": {
"mmar": {
"command": "node",
"args": ["/absolute/path/to/mmar-mcp-server/dist/index.js"],
"env": {
"MMAR_API_URL": "http://localhost:8000"
}
}
}
}Claude Desktop — 添加到你的 Claude Desktop 配置文件(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mmar": {
"command": "node",
"args": ["/absolute/path/to/mmar-mcp-server/dist/index.js"],
"env": {
"MMAR_API_URL": "http://localhost:8000"
}
}
}
}将 /absolute/path/to/mmar-mcp-server 替换为你克隆仓库的实际路径。
步骤 5:开始使用
配置完成后,MCP 主机可以调用 62 个工具中的任意一个。三个引导提示可用于常见工作流:
create-metamodel — 根据自然语言描述创建新的建模语言
create-model — 使用现有元模型创建模型实例
analyze-model — 检查和现有模型
示例:"使用 create-metamodel 提示创建一个 Petri 网建模语言,包含 Place 节点、Transition 节点和 Arc 连接。"
配置
服务器读取一个环境变量:
变量 | 默认值 | 描述 |
|
| MM-AR REST API 的基础 URL |
通过你的 shell、MCP 主机配置(参见步骤 4)或内联设置:
MMAR_API_URL=http://your-host:8000 node dist/index.js工具目录
所有 62 个工具都以 mmar_ 为前缀,并分为三个类别:
认证(3 个工具)
工具 | 描述 |
| 使用用户名和密码进行认证 |
| 检查会话是否活跃 |
| 结束当前会话 |
元模型操作(26 个工具)
类别 | 工具 |
场景类型 |
|
类 |
|
关系类 |
|
属性 |
|
角色 |
|
端口 |
|
实例操作(33 个工具)
类别 | 工具 |
场景 |
|
类实例 |
|
关系实例 |
|
属性实例 |
|
角色实例 |
|
端口实例 |
|
折点 |
|
所有工具名称都带有 mmar_ 前缀(例如 mmar_create_class)。上表中为便于阅读省略了前缀。
资源
URI | 描述 |
| 平台架构概述和引导工作流 |
| 用于视觉表示的 VizRep 代码模板 |
| 元模型结构的 JSON 模式 |
| 可用的属性类型(String、Float、Boolean 等) |
| 完整的 Petri 网元模型作为参考示例 |
项目结构
mmar-mcp-server/
├── src/
│ ├── index.ts # Entry point (STDIO transport)
│ ├── server.ts # MCP server setup and capability registration
│ ├── config.ts # Configuration (reads MMAR_API_URL)
│ ├── api-client.ts # MM-AR REST API client with JWT auth and retry logic
│ ├── tools/
│ │ ├── index.ts # Tool registration hub
│ │ ├── auth.tools.ts # Authentication tools (3)
│ │ ├── meta.tools.ts # Metamodel CRUD tools (26)
│ │ └── instance.tools.ts # Instance CRUD tools (33)
│ ├── resources/
│ │ └── index.ts # Resource definitions (5)
│ └── prompts/
│ └── index.ts # Prompt definitions (3)
├── test-mcp.mjs # End-to-end test suite
├── test-data/ # Example payloads for MCP Inspector testing
│ ├── README.md
│ ├── example-ER-diagram-metamodel.json
│ └── example-petri-net-metamodel.json
├── package.json
├── tsconfig.json
└── .gitignore可重现评估框架
受控试验(不是 Cursor 聊天)。从这里开始:
→ experiments/README.md — 设置、如何运行、JSON 文件位置
→ experiments/EVALUATION-PROCEDURE.md — 隔离/评分协议
→ experiments/harness-results/PRELIMINARY-RESULTS.md — Petri 网初步结果(6 次试验)
cd experiment-harness
npm install
cp .env.example .env # add ANTHROPIC_API_KEY; never commit .env
export MMAR_API_URL=http://127.0.0.1:8000
curl -s -o /dev/null -w "API %{http_code}\n" http://127.0.0.1:8000/login # must be 200
npm run one -- --phase metamodel --language petri-net --trial a
npm run one -- --phase instance --language petri-net --trial a
npm run scoreboard
open ../experiments/harness-results/scoreboard.html如果遇到连接拒绝,优先使用 127.0.0.1 而不是 localhost。新试验后重新运行 npm run scoreboard。
npm run pilot # scorer self-test
npm run pilot -- --with-api # + reset + MCP dry-run + GT seed (API must be up)使用 MCP Inspector 进行测试
对于交互式调试,你可以使用 MCP Inspector:
npm run inspect这会打开一个 Web UI,你可以在其中浏览工具、手动调用它们并检查请求/响应负载。请参阅 test-data/README.md 获取分步说明和示例负载。
故障排除
ECONNREFUSED 或 "无法连接到 MM-AR API"
MM-AR 平台未运行或无法在配置的 URL 上访问。
检查 Docker 容器是否正在运行:
docker compose ps验证 API 是否启动:
curl http://localhost:8000/login如果使用自定义 URL,请确保正确设置了
MMAR_API_URL
"端口 8000 已被占用"
另一个进程正在使用端口 8000。要么停止该进程,要么将 MM-AR 平台配置为使用不同的端口(请参阅 mmar-docker-installation 文档)。
测试在 "以 admin 身份登录" 时失败
MM-AR 数据库可能尚未完全初始化。Docker 容器在启动后需要几秒钟来完成数据库初始化。等待 docker compose up 后 10-15 秒再重试。
"找不到模块 dist/index.js"
你需要先编译 TypeScript 源代码:
npm run buildMCP 主机未检测到服务器
确保 MCP 主机配置中的路径指向
dist/index.js的绝对路径更改配置后重新启动 MCP 主机
检查是否安装了 Node.js v18+:
node --version
相关仓库
mmar — MM-AR 平台主仓库
mmar-docker-installation — 基于 Docker 的完整 MM-AR 平台安装
mmar-server — MM-AR REST API 服务器
许可证
ISC
引用
如果您在研究中使用此软件,请引用:
@inproceedings{chima2026mmar-mcp,
title={Agentic Creation of Modeling Languages: Extending the MM-AR Metamodeling Platform with MCP},
author={Chima, Prosper and Fill, Hans-Georg and Curty, Simon},
booktitle={Proceedings of the International Conference on Conceptual Modeling (ER), Demos and Posters},
year={2026}
}Maintenance
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
- AlicenseAqualityFmaintenanceEnables natural language control of AutoCAD LT through AutoLISP code generation and execution, allowing users to create engineering drawings with conversational prompts.8451MIT
- Alicense-qualityFmaintenanceIntegrates multimodal large language models with ParaView to enable the creation and manipulation of scientific visualizations using natural language and visual inputs. It features visual feedback capabilities for iterative refinement, making advanced visualization workflows accessible through intelligent automation.58BSD 3-Clause
- -license-quality-maintenanceEnables AI agents to traverse SysML v2 model graphs, query requirements, and perform impact analysis for model-based systems engineering. It allows agents to interact with plain-text models to automate documentation and refine system architectures.
- Flicense-qualityFmaintenanceEnables AI-driven graphical diagram creation and manipulation using natural language, with support for BPMN workflows, analysis, and manual editing via the Model Context Protocol.1
Related MCP Connectors
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Map text into knowledge graphs to create a structured representation of conceptual relations and t…
Create and manage AI agents that collaborate and solve problems through natural language interacti…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ProTech001/mmar-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server