Token导航 LogoToken导航TokenDH.com
Eligibility Engine MCP Rs logo
运维云端stdio官方级别未说明来源级核验

Eligibility Engine MCP Rs

MCP Server

@modelcontextprotocol/inspector

一个基于ZEN Engine决策引擎的规则评估系统,用于演示复杂业务规则的评估流程,适用于教育和开发参考。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
RustClaude容器化部署Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

alpha-hack-program

提供方

alpha-hack-program

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @modelcontextprotocol/inspector

详细介绍

合格引擎MCP服务器

示例模型上下文协议(MCP)服务器演示了基于虚构法规的休假辅助评估

![CI Pipeline](https://github.com/alpha-hack-program/eligibility-engine-mcp-rs/actions/workflows/ci.yml) ![License: MIT](https://opensource.org/licenses/MIT) ![Rust](https://www.rust-lang.org/)

一个用Rust开发的模型上下文协议(MCP)服务器示例,演示了如何使用ZEN引擎决策引擎评估复杂的业务规则。该项目可作为使用基于规则的决策系统构建MCP服务器的参考实现。

⚠️ 免责声明

本示例基于虚构的Lysmark共和国的虚构法规。有关本演示中使用的虚构法律框架、福利场景和资格规则的全部详细信息,请参阅 documents/ 文件夹。

这只是一个演示/示例项目。 这里实施的规定、金额和评估逻辑是虚构的,仅用于教育和演示目的。该软件:

  • 不应用于实际的法律或行政决策
  • 不代表真正的政府法规
  • 不隶属于任何官方政府实体
  • 作为MCP服务器实现的技术示例

有关休假援助的真实法律建议或官方信息,请咨询政府官方资源和合格的法律专业人士。

🎯 特性

  • 5个示例评估场景:演示复杂规则集(A-E)的实现
  • 决策引擎集成:演示如何使用ZEN引擎进行基于规则的评估
  • 多种传输协议:STDIO和流式HTTP实现的示例
  • 稳健的输入验证:演示JSON模式验证和详细的错误处理
  • 生产就绪集装箱化:部署的Docker/Podman设置示例
  • Claude桌面集成:MCP集成的MCPB封装示例
  • 专业版本管理:与货物放行自动版本同步
  • CI/CD管道:全面的GitHub操作工作流程
  • 专业知识库结构:有组织的脚本和干净的项目布局

📚 快速参考

任务命令描述
🏗️ 构建make build-all构建所有服务器
🧪 测试make test运行所有测试
🚀 发布make release-patch创建新的补丁版本
📦 包裹make pack创建Claude桌面包
🐳 容器scripts/image.sh build构建容器映像
🔄 同步make sync-version手动同步版本
ℹ️ 帮助make help显示所有命令

📋 援助场景示例(虚构)

场景描述每月金额示例
A.一级亲属护理(疾病/事故)725欧元
B第三个或更多新生儿500欧元
C收养或寄养500欧元
D多胞胎、收养或寄养500欧元
E单亲家庭500欧元
备注:这些场景和金额完全是虚构的,仅用于演示目的。

🚀 快速开始

先决条件

  • 锈蚀1.70+(安装Rust)
  • 货物(含铁锈)
  • jq 用于JSON处理(安装jq)
  • cargo-release 对于版本管理: cargo install cargo-release

安装

# Clone the repository
git clone https://github.com/alpha-hack-program/eligibility-engine-mcp-rs.git
cd eligibility-engine-mcp-rs

# Build all servers
make build-all

# Or build individually
make build-mcp      # MCP HTTP Server
make build-stdio    # STDIO Server for Claude

跑步

# MCP HTTP Server
make test-mcp

# Or directly
RUST_LOG=debug ./target/release/mcp_server

🔧 配置

环境变量

# Server configuration
RUST_LOG=info           # Logging level (debug, info, warn, error)

# Or use BIND_ADDRESS directly
BIND_ADDRESS=127.0.0.1:8000

示例用法

此输入表示对资格引擎的请求,以根据此查询确定某人是否有资格根据Lysmark法律获得无薪休假福利。

“我妻子刚刚生下我们的第三个孩子,我想知道我是否可以申请无薪休假补助。”
{
  `situation`: `birth`,
  `relationship`: `father`,
  `is_single_parent`: false,
  `total_children_after`: 3
}

申请人简介: 一位因孩子出生而请假的父亲 非单亲家庭(双亲家庭) 出生后将有两个孩子

案例分类: 确定为“病例B:第三个或更多新生儿” 如果满足要求,可能有资格获得每月725欧元的福利

示例响应:

{
  "output": {
    "description": "Third child or more with newborn",
    "monthly_benefit": 500,
    "additional_requirements": "The number of children must be 3 or more, the ages of at least 2 of the minors must be less than 6, if there is disability greater than 33% then the limit is 9 years",
    "case": "B",
    "potentially_eligible": true,
    "errores": [],
    "warnings": []
  },
  "input": {
    "relationship": "father",
    "situation": "birth",
    "is_single_parent": false,
    "total_children_after": 3.0
  },
  "relationship_valid": true
}
重要:这只是用于演示目的的示例数据。

🐳 容器化

构建并运行

这需要 podmandocker配置是通过以下方式进行管理的 .env 文件。

# Build container image
scripts/image.sh build

# Run locally
scripts/image.sh run

# Run from remote registry
scripts/image.sh push
scripts/image.sh run-remote

# Show container information
scripts/image.sh info

容器的环境变量

# Production configuration
podman run -p 8001:8001 \
  -e BIND_ADDRESS=0.0.0.0:8001 \
  -e RUST_LOG=info \
  quay.io/atarazana/eligibility-engine-mcp-server:latest

📦 Claude桌面集成

包装

# Create MCPB package for Claude Desktop
$ make pack
cargo build --release --bin stdio_server
   Compiling eligibility-engine-mcp-server v1.0.8 (/Users/.../eligibility-engine-mcp-rs)
    Finished `release` profile [optimized] target(s) in 18.23s
Packing MCP server for Claude Desktop...
chmod +x ./target/release/stdio_server
zip -rX eligibility-engine-mcp-server.mcpb -j mcpb/manifest.json ./target/release/stdio_server
updating: manifest.json (deflated 49%)
updating: stdio_server (deflated 63%)

克劳德配置示例

拖放 MCPB 文件进入 Settings->Extensions 下降区域。

备注:这展示了MCP集成模式,不适用于实际数据的生产使用。

🧪 测试

# Run all tests
make test

🛠️ 发展

可用命令

🏗️ 构建命令

make build-all              # Build all servers
make build-mcp              # Build MCP server (streamable-http)
make build-stdio            # Build stdio server
make pack                   # Pack MCP server for Claude Desktop

🚀 放行命令(货物放行)

make release-patch          # Create patch release (1.0.6 → 1.0.7)
make release-minor          # Create minor release (1.0.6 → 1.1.0)
make release-major          # Create major release (1.0.6 → 2.0.0)
make release-dry-run        # Show what release-patch would do
make sync-version           # Manually sync version to all files

🧪 测试命令

make test                   # Run all tests
make test-mcp               # Test MCP server locally

🔧 开发命令

make clean                  # Clean build artifacts
make help                   # Show all available commands

项目结构

├── src/                                    # Source code
│   ├── common/
│   │   ├── eligibility_engine.rs         # MCP logic and decision engine
│   │   └── mod.rs
│   ├── mcp_server.rs                      # MCP HTTP Server
│   └── stdio_server.rs                    # STDIO Server
├── scripts/                               # Utility scripts
│   ├── sync-manifest-version.sh           # Version sync for cargo-release
│   └── image.sh                          # Container management script
├── mcpb/
│   └── manifest.json                      # Claude Desktop manifest
├── .github/workflows/                     # CI/CD pipelines
│   └── ci.yml                            # GitHub Actions workflow
├── docs/                                  # Documentation
├── .env                                   # Environment variables
├── Containerfile                          # Container definition
├── Cargo.toml                            # Rust package manifest
└── Makefile                              # Build commands

调试和监控

首先运行Streamable HTTP服务器:

$ make test-mcp
cargo build --release --bin mcp_server
   Compiling eligibility-engine-mcp-server v1.0.6 (/Users/cvicensa/Projects/rust/claude/eligibility-engine-mcp-rs)
    Finished `release` profile [optimized] target(s) in 18.26s
🧪 Testing Streamable HTTP server...

RUST_LOG=debug ./target/release/mcp_server
2025-09-22T16:53:01.931985Z  INFO mcp_server: Starting Streamable HTTP Eligibility Engine MCP server on 127.0.0.1:8000

其次,运行MCP检查器:

注: 必须安装NodeJS 19+
$ make inspector
npx @modelcontextprotocol/inspector
Starting MCP inspector...
⚙️ Proxy server listening on 127.0.0.1:6277
🔑 Session token: 6f0fdc22e2a9775a95d60c976b37b873bffec1816002fc702ca8ec7186a7c338
Use this token to authenticate requests or set DANGEROUSLY_OMIT_AUTH=true to disable auth

🔗 Open inspector with token pre-filled:
   http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=6f0fdc22e2a9775a95d60c976b37b873bffec1816002fc702ca8ec7186a7c338

🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀

打开浏览器,指向包含令牌的URL。

故障排除:

MCP错误-32602:参数反序列化失败:缺少字段 is_single_parent

只需点击复选框 is_single_parent 然后再试一次。

📚 api参考

主要终点

发布 /message -规则评估的示例端点

示例输入参数

字段类型必填描述
relationshipstring家庭关系(父亲、母亲、儿子、女儿、配偶、伴侣、丈夫、妻子、女人、男人)
situationstring护理原因(出生、收养、寄养、疾病、事故等)
is_single_parentboolean这是单亲家庭吗?
total_children_after编号子女人数(可选,案例B需要)

响应

字段类型描述
casestring适用场景字母(A-E)
descriptionstring场景描述
monthly_benefitnumber每月金额(欧元)
potentially_eligibleboolean是否满足基本要求?
additional_requirementsstring其他特定要求
erroresarray验证错误列表
warningsarray警告和其他信息

🔒 安全

  • 输入验证:严格的JSON模式
  • 非root用户:容器以用户身份运行 1001
  • 安全审计: cargo audit 在CI/CD中
  • 最小图像:基于UBI 9最低标准

🤝 贡献

开发流程

  1. 分叉项目
  2. 创建特征分支: git checkout -b feature/new-feature
  3. 进行更改和测试: make test
  4. 提交更改: git commit -am 'Add new feature'
  5. 推送到分支: git push origin feature/new-feature
  6. 创建拉取请求

专业发布流程

  1. 发展:进行更改,测试 make test
  2. 版本颠簸:使用 make release-patch/minor/major
  3. 构建:使用 make pack 用于Claude Desktop集成
  4. 容器:使用 scripts/image.sh build 集装箱化

指南

  • 代码质量:关注 cargo fmt 并通过 cargo clippy
  • 测试:添加新功能的测试
  • 版本管理:让货物放行处理版本控制
  • CI/CD:确保所有GitHub操作都通过
  • 文档:根据需要更新README.md
  • 专业结构:保留脚本 scripts/ 目录

⚙️ 版本管理

此项目使用 货物放行 用于跨所有配置文件自动同步的专业版本管理。

🔄 版本同步系统

  • 单一真相来源: Cargo.toml 版本控制一切
  • 自动同步:更新 mcpb/manifest.json.env 自动地
  • Git集成:自动创建提交和标记

📦 发布工作流

# 1. Make your changes and commit them
git add -A && git commit -m "feat: your changes"

# 2. Create a release (choose appropriate version bump)
make release-patch     # Bug fixes: 1.0.6 → 1.0.7
make release-minor     # New features: 1.0.6 → 1.1.0  
make release-major     # Breaking changes: 1.0.6 → 2.0.0

# 3. Build and package
make pack
scripts/image.sh build
scripts/image.sh push

# 4. Push to repository
git push && git push --tags

🔍 预览更改

# See what would happen without making changes
make release-dry-run

🛠️ 手动版本同步(开发)

# Sync version from Cargo.toml to other files manually
make sync-version

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 了解详情。

🚀 生产部署

环境配置

该项目使用 .env 环境管理:

# Version (automatically managed by cargo-release)
VERSION=1.0.6

# Container Configuration  
APP_NAME="eligibility-engine-mcp-rs"
BASE_IMAGE="registry.access.redhat.com/ubi9/ubi-minimal"
PORT=8001

# Registry Configuration
REGISTRY=quay.io/atarazana

CI/CD管道

该项目包括一个全面的GitHub Actions工作流程:

  • 自动化测试:单元测试和集成测试
  • 版本同步验证:测试货物释放功能
  • 集装箱建筑:测试集装箱化过程
  • 工件管理:构建和上传发布工件
  • 与跨平台支持:在Ubuntu上使用多容器运行时进行测试

🙋 支持

  • 问题:
  • 文档: 维基工程
  • CI/CD:通过GitHub Actions进行自动化测试和部署

🏷️ 标签

mcp model-context-protocol rust eligibility-engine unpaid-leave zen-engine claude decision-engine cargo-release professional-rust containerization ci-cd

______________________________________________________________________

与开发❤️ 通过 阿尔法黑客集团

目录标签

目录标签

RustClaude容器化部署规则引擎本地部署决策系统业务规则评估Rust开发

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@modelcontextprotocol/inspector

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP