qlexpress-mcp

DQinYuan/qlexpress-mcp

3.1

If you are the rightful owner of qlexpress-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

QLExpress MCP Server is a Model Context Protocol (MCP) based server for executing and analyzing QLExpress expressions.

QLExpress MCP Server

QLExpress MCP Server 是一个基于 Model Context Protocol (MCP) 的 QLExpress 表达式执行和分析服务器实现。

项目介绍

本项目提供了一个完整的 MCP 服务器,支持 QLExpress 表达式的执行和分析。

服务器支持两种运行模式:stdio 模式 和 SSE 模式。

快速开始

环境要求

  • Java 17 或更高版本
  • Maven 3.6 或更高版本

构建项目

mvn clean package

构建完成后,可执行 JAR 文件将位于 target/qlexpress-mcp-server-1.0.0.jar

启动方法

stdio 模式

stdio 模式通过标准输入输出进行通信,适合与本地工具集成:

java -jar -Dspring.ai.mcp.server.stdio=true -Dspring.main.web-application-type=none target/qlexpress-mcp-server-1.0.0.jar

SSE 模式

SSE 模式通过 HTTP Server-Sent Events 进行通信,适合 Web 应用和远程调用:

java -jar target/qlexpress-mcp-server-1.0.0.jar

使用案例

以下是一个典型的使用案例,展示了如何通过 MCP 客户端调用 QLExpress 服务器分析导致表达式结果为 false 的原因:

使用案例

Prompt:

qlexpress脚本:`isVip(userId) && (未登录天数(userId) > 10 || 购物车(userId).isEmpty())`,脚本上下文:`{"userId": 1234}`,
解释导致脚本执行结果的原因。回答请尽量精简且通俗

开发指南

项目结构

基于 Spring AI 实现

qlexpress-mcp/
├── src/main/java/com/example/qlexpressmcp/
│   ├── QLExpressMcpServerApplication.java  # 主应用类
│   └── QLExpressExecuteService.java        # 表达式执行服务
├── src/main/resources/
│   └── application.yml                     # 配置文件
└── src/test/                               # 测试代码

修改自定义函数

com.example.qlexpressmcp.QLExpressExecuteService 中的自定义函数修改成业务中实际的自定义函数。