Skip to main content
Glama

asset-health-mcp

一个 AI 代理,负责决定是否派遣现场技术人员——并且拒绝基于它无法信任的数据采取行动。

基于 Salesforce Data Cloud 的 Agentforce 代理,调用自定义的 MCP 服务器,用于数据质量验证(Great Expectations)和异常评分(Databricks),并通过受保护的 Apex 写回操作来创建 WorkOrder。

🎥 2 分钟演示视频 —— 观看代理如何验证、评分、创建工单,然后拒绝损坏的数据批次。

为什么会有这个项目

大多数代理演示都会让 LLM 对它拿到的任何数据直接行动。而在现场服务场景中,基于一条损坏的仪表读数去行动,意味着为了一次毫无意义的派工——甚至更糟,漏掉一个正出故障的资产。这个项目在每个代理决策之前加了一道数据信任闸门

readings ──▶ Ingestion API ──▶ Data Cloud (zero-copy grounding)
                                     │
                                     ▼
                          Agentforce agent
                          │ 1. check_reading_quality   MCP / Great Expectations
                          │ 2. score_asset_anomaly     MCP / Databricks
                          │ 3. create work order       Apex (guarded write-back)
                                     │
                                     ▼
                            Salesforce WorkOrder

Related MCP server: qc-validator-mcp

设计决策

  • 两个精细挑选的 MCP 工具,而不是一次大量数据倾泻。 代理得到的是判断结果(信任 + 严重性);原始历史记录通过 Data Cloud 零拷贝(zero-copy)单独供其使用。这远未触及 Agentforce 的工具预算上限。

  • 防护逻辑放在服务端。 即使代理主动请求,Apex action 也会拒绝不信任的数据和常规严重级别请求——代理指令不是安全边界(OWASP LLM07)。

  • 写回操作幂等。 代理会重试;重复的现场派工花费的是真金白银。每个资源只对应一个未完成的 Asset Health WorkOrder,由 Apex 强制保证。

  • 无需任何凭据即可运行。 确定性的 Databricks 模拟器 + GX 临时测试上下文,意味着在全新克隆的环境下无需任何外部服务,pytest 即可全部通过。

技术栈

Python 3.11 · FastMCP(mcp 1.x) · Great Expectations 1.18 · Databricks (Unity Catalog) · Salesforce Data Cloud(Ingestion API、DMO grounding) · Agentforce · Apex

仓库结构

src/asset_health_mcp/    FastMCP server: tools, GX validation, Databricks client
pipeline/                Ingestion API pipeline → Meter Reading DMO (fallback path)
force-app/               Apex write-back action + tests
databricks/              PySpark scoring job → Unity Catalog Delta table with
                         UniForm (Iceberg) — zero-copy File Federation ready
snowflake/               readings warehouse DDL + least-privilege key-pair
                         integration user for Query Federation
datacloud/               ZERO_COPY.md — federation-mode decisions and setup
docs/                    AGENT_BUILD.md (Agentforce wiring), demo script
tests/                   smoke suite, green with zero external services

所有零拷贝设计都落实为一句话: 读数保留在 Snowflake(Query Federation,将 JDBC 下推到隔离的 XS 数据仓库),评分保留在 Databricks(使用 UniForm/Iceberg 的文件联合,零外部计算)——模式按成本、按数据表来选择, 而不是按默认配置。详见:datacloud/ZERO_COPY.md

运行

pip install -e ".[dev]" && pytest          # zero-credential smoke suite
python -m asset_health_mcp.server          # stdio, for Claude Desktop
MCP_TRANSPORT=streamable-http \
  python -m asset_health_mcp.server        # HTTP, for Agentforce registry
sf project deploy start                    # Apex action + tests

完整的构建手册:docs/SETUP.md(step-by-step,围绕抵御 license 约束的顺序编排)· 代理对接: docs/AGENT_BUILD.md · 哪些版本运行在哪个版本上、哪些 内容有文档但没有演示: docs/ENVIRONMENTS.md

已知局限

Demo 级别认证(PAT,而非 OAuth service principal)、预计算评分(而非 实时模型服务)、单 org(single-org)。这个局限是刻意留下的——这个项目 关注的是方案架构 而不是生产环境加固。


作者:Yamyle —— Salesforce 高级架构师 & 数据/AI 工程师。 20+ Salesforce 认证 · 曾为公用事业和金融服务领域构建集成框架。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

Related MCP Connectors

  • Deterministic validation for AI-generated artifacts: JSON Schema, OpenAPI response, SQL syntax.

  • Responsible-AI guardrails for agents: scoring with policy, injection & PII detection, DPDP.

  • Build, validate, and deploy multi-agent AI solutions from any AI environment.

View all MCP Connectors

Latest Blog Posts

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/yamylemerleremond/asset-health-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server