ArasMcpServer 0.2.4


                    
dotnet tool install --global ArasMcpServer --version 0.2.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ArasMcpServer --version 0.2.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ArasMcpServer&version=0.2.4
                    
nuke :add-package ArasMcpServer --version 0.2.4
                    

Aras PLM MCP Server

这是一个用于连接 Aras PLM 系统的 MCP (Model Context Protocol) 服务器。通过 stdio 传输协议,为 AI 助手提供访问 Aras PLM 数据的能力。

功能特性

  • 🔗 Aras PLM 连接: 支持通过 HTTP 连接 Aras PLM 服务器
  • 🔍 灵活查询: 支持多种查询方式(ID查询、键名查询、条件查询、AML查询)
  • 📊 元数据管理: 自动获取和管理对象类型、属性、关系信息
  • ⚙️ 参数化配置: 支持命令行参数和环境变量配置
  • 🛡️ 安全验证: 内置SQL注入防护和操作限制

快速开始

1. 构建项目

dotnet build

2. 配置连接参数

方式一:命令行参数
ArasMcpServer.exe --url "http://your-server:6789/plm" --database "YOUR_DATABASE" --username "admin" --password "your_password"
方式二:环境变量
set ARAS_SERVER_URL=http://your-server:6789/plm
set ARAS_DATABASE=YOUR_DATABASE
set ARAS_USERNAME=admin
set ARAS_PASSWORD=your_password
ArasMcpServer.exe

3. 配置 MCP 客户端

Claude Desktop 配置

将以下内容添加到 %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "aras-plm": {
      "command": "E:\\TDT\\InternalTools\\aras_mcp\\ArasMcpServer\\bin\\Debug\\net8.0\\ArasMcpServer.exe",
      "args": [
        "--url",
        "http://your-server:6789/plm",
        "--database",
        "YOUR_DATABASE",
        "--username",
        "admin",
        "--password",
        "your_password"
      ]
    }
  }
}
其他 MCP 客户端配置

参考 .mcp/server.json 文件中的配置示例。

可用工具

🔍 查询工具

  • GetItemById: 根据对象类名称和ID获取对象信息
  • GetItemByKeyedName: 根据对象类型和键名获取对象信息
  • ExecuteItemQuery: 高级查询工具,支持复杂条件和分页
  • ExecuteAMLQuery: 执行自定义AML查询语句

📊 元数据工具

  • GetItemTypesBasic: 获取所有对象类型的基本信息
  • GetItemTypeProperties: 获取指定对象类型的属性信息
  • GetItemTypeRelationships: 获取指定对象类型的关系信息

使用示例

查询零件信息

查询ID为"A12345"的Part对象

条件查询

查询名称包含"齿轮"的零件,按创建时间降序排列

获取元数据

获取Part对象类型的所有属性信息

开发和测试

本地开发

# 使用源码运行
dotnet run -- --url "http://your-server:6789/plm" --database "YOUR_DATABASE" --username "admin" --password "your_password"

测试连接

# 查看帮助信息
ArasMcpServer.exe --help

# 测试基本连接
ArasMcpServer.exe -u "http://your-server:6789/plm" -d "YOUR_DATABASE" -user "admin" -p "your_password"

安全注意事项

  • 🔒 只读操作: 仅支持查询操作,不支持数据修改
  • 🛡️ SQL注入防护: 自动验证和过滤SQL语句
  • ⚠️ 权限控制: 建议使用只读用户账户连接
  • 📝 日志记录: 所有操作都会记录日志便于审计

故障排除

常见问题

连接失败
  • 检查服务器URL是否正确
  • 验证数据库凭据
  • 确认网络连接正常
配置错误
  • 使用 --help 查看参数说明
  • 检查环境变量设置
  • 验证JSON格式是否正确
查询失败
  • 确认对象类型名称正确
  • 检查查询条件格式
  • 查看错误日志获取详细信息

日志和调试

  • 日志输出到stderr,stdout用于MCP协议通信
  • 使用详细日志模式排查问题
  • 检查Aras PLM服务器日志

技术要求

  • .NET 8.0 Runtime
  • Aras PLM 服务器访问权限
  • PLM.ArasUtils 库依赖
  • 支持stdio传输的MCP客户端

许可证

本项目基于 MIT 许可证开源。

贡献

欢迎提交 Issue 和 Pull Request 来改进这个项目。

更多信息


项目文件说明

配置文件

  • .mcp/server.json: 通用MCP客户端配置模板
  • .mcp/claude_desktop_config.json: Claude Desktop专用配置模板
  • Configuration/ArasPLMConfiguration.cs: 连接参数配置类

核心文件

  • Program.cs: MCP服务器启动程序
  • Tools/ArasPLMTools.cs: Aras PLM工具实现
  • ArasMcpServer.csproj: 项目配置和依赖

元数据模型

  • MetaData/ItemType.cs: 对象类型数据模型
  • ContractResolver/IgnoreNullEmptyStringContractResolver.cs: JSON序列化配置

版本历史

  • v0.1.0-beta: 初始版本,支持基本的Aras PLM查询功能
    • stdio传输协议支持
    • 参数化连接配置
    • 安全查询验证
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.4 262 12/22/2025
0.2.3 168 12/22/2025
0.2.2 379 11/3/2025
0.2.1 576 11/1/2025
0.2.0 304 11/1/2025
0.1.0-beta 123 11/1/2025