XMI MCP Server
An MCP server for querying and exploring SysML XMI models, specifically designed for MTConnect model exports. It allows users to search for packages, classes, and enumerations while providing tools for analyzing documentation and inheritance hierarchies.
README
XMI MCP Server
An MCP (Model Context Protocol) server for querying SysML XMI exports. This server parses the MTConnect SysML model and provides tools for exploring packages, classes, enumerations, and documentation.
Installation
npm install
npm run build
Loading into Claude Code on Windows
Option 1: Add to User Settings (Recommended)
-
Open your Claude Code settings file at:
%APPDATA%\Claude\claude_desktop_config.jsonOr create it if it doesn't exist.
-
Add the MCP server configuration:
{ "mcpServers": { "xmimcp": { "command": "node", "args": ["C:\\source\\vibes\\xmimcp\\dist\\index.js"] } } } -
Restart Claude Code for the changes to take effect.
Option 2: Using a Custom XMI File Path
If your XMI file is in a different location, set the XMI_FILE_PATH environment variable:
{
"mcpServers": {
"xmimcp": {
"command": "node",
"args": ["C:\\source\\vibes\\xmimcp\\dist\\index.js"],
"env": {
"XMI_FILE_PATH": "C:\\path\\to\\your\\model.xml"
}
}
}
}
Option 3: Project-Specific Configuration
Create a .mcp.json file in your project root:
{
"mcpServers": {
"xmimcp": {
"command": "node",
"args": ["C:\\source\\vibes\\xmimcp\\dist\\index.js"]
}
}
}
Verifying the Server is Loaded
After restarting Claude Code, you can verify the server is loaded by asking Claude to use one of the tools, such as:
- "Get model statistics from the XMI server"
- "List all packages in the SysML model"
Tool Reference
Package Tools
list_packages
List all packages in the SysML model with optional filtering.
Parameters:
| Parameter | Type | Description |
|---|---|---|
parentPackage |
string | Filter to children of this package (by name or xmi:id) |
recursive |
boolean | Include nested packages recursively (default: false) |
namePattern |
string | Regex pattern to filter package names |
Example:
List all packages that contain "Asset" in their name
get_package
Get detailed information about a specific package including its children.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | Yes | Package name or xmi:id |
Returns: Package details including child packages, classes, and enumerations.
Example:
Get details of the "Asset Information Model" package
Class/Block Tools
find_classes
Find classes/blocks by name, pattern, or package.
Parameters:
| Parameter | Type | Description |
|---|---|---|
name |
string | Exact class name to find |
namePattern |
string | Regex pattern for class names |
package |
string | Limit search to this package (name or id) |
recursive |
boolean | Search in nested packages (default: true) |
includeAbstract |
boolean | Include abstract classes (default: true) |
Example:
Find all classes with "Tool" in their name
Find classes in the "Cutting Tool" package
get_class_details
Get full details of a class including properties, inheritance, and documentation.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | Yes | Class name or xmi:id |
includeInherited |
boolean | No | Include inherited properties from parent classes (default: false) |
Returns: Complete class information including:
- Properties with types and multiplicity
- Parent classes (generalizations)
- Stereotypes (e.g., SysML Block)
- Documentation
Example:
Get details of the "CuttingTool" class with inherited properties
get_inheritance_hierarchy
Get the inheritance chain for a class showing ancestors and/or descendants.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | Yes | Class name or xmi:id |
direction |
string | No | One of: "ancestors", "descendants", "both" (default: "both") |
Example:
Show the inheritance hierarchy for the "Asset" class
Enumeration Tools
list_enumerations
List all enumerations with optional filtering.
Parameters:
| Parameter | Type | Description |
|---|---|---|
package |
string | Filter to a specific package |
namePattern |
string | Regex pattern for enumeration names |
Example:
List all enumerations containing "Type" in their name
get_enumeration
Get details of an enumeration including all literal values and their documentation.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier |
string | Yes | Enumeration name or xmi:id |
Returns: Enumeration details with all literals and their documentation.
Example:
Get all values of the "DataItemSubTypeEnum" enumeration
Search Tools
search_documentation
Full-text search across all documentation and comments in the model.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | Search terms (space-separated, all must match) |
elementTypes |
array | No | Limit to: "class", "enumeration", "package", "datatype" |
limit |
number | No | Maximum results (default: 50) |
Example:
Search documentation for "cutting tool life"
Search for "spindle" in class documentation only
search_by_name
Search for any element by name across the entire model.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | Name or partial name to search for |
exactMatch |
boolean | No | Require exact name match (default: false) |
elementTypes |
array | No | Limit to: "class", "enumeration", "package", "datatype" |
Example:
Search for elements named "Asset"
Find all elements containing "Observation"
Reference Tools
resolve_reference
Resolve an xmi:id reference to get element details. Useful for following cross-references in the model.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
xmiId |
string | Yes | The xmi:id to resolve |
Example:
Resolve reference "_19_0_3_68e0225_1620206731259_178927_703"
Utility Tools
get_model_statistics
Get statistics about the loaded SysML model.
Parameters: None
Returns:
{
"packageCount": 120,
"classCount": 1179,
"enumerationCount": 106,
"dataTypeCount": 30,
"propertyCount": 1924,
"associationCount": 231
}
Troubleshooting
Server not loading
- Ensure Node.js is installed and in your PATH
- Verify the paths in the configuration use double backslashes (
\\) on Windows - Check that
npm run buildcompleted successfully
XMI file not found
- Verify the XMI file exists at the expected path
- Use the
XMI_FILE_PATHenvironment variable to specify a custom location
Tools not appearing
- Restart Claude Code after updating the configuration
- Check the Claude Code logs for any error messages
Development
# Install dependencies
npm install
# Build
npm run build
# Run directly (for testing)
npm start
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。