asset-health-mcp

asset-health-mcp

Provides data-quality validation and anomaly scoring tools so an AI agent can decide whether to dispatch a field technician, while refusing to act on untrusted data.

Category
Visit Server

README

asset-health-mcp

An AI agent that decides whether to dispatch a field technician — and refuses to act on data it can't trust.

Agentforce agent grounded on Salesforce Data Cloud, calling a custom MCP server for data-quality validation (Great Expectations) and anomaly scoring (Databricks), with a guarded Apex write-back that creates the WorkOrder.

šŸŽ„ 2-minute demo video — watch the agent validate, score, create a work order, then refuse a corrupted batch.

Why this exists

Most agent demos let the LLM act on whatever data it retrieves. In field service, acting on a corrupted meter reading means dispatching a technician for nothing — or worse, missing a failing asset. This project puts a data-trust gate in front of every agent decision:

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

Design decisions

  • Two curated MCP tools, not a data dump. The agent gets judgment (trust + severity); raw history reaches it separately through Data Cloud zero-copy grounding. Stays far inside Agentforce's tool budget.
  • Guards live server-side. The Apex action refuses untrusted data and normal-severity requests even if the agent asks — agent instructions are not a security boundary (OWASP LLM07).
  • Idempotent write-back. Agents retry; duplicate field dispatches cost real money. One open Asset Health WorkOrder per asset, enforced in Apex.
  • Runs with zero credentials. Deterministic Databricks mock + GX ephemeral context mean pytest is green on a fresh clone with no external services.

Stack

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

Repository layout

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

Zero-copy design in one line: readings stay in Snowflake (Query Federation, JDBC pushdown to an isolated XS warehouse), scores stay in Databricks (File Federation via UniForm/Iceberg, zero external compute) — mode chosen per table on cost, not by default. Details: datacloud/ZERO_COPY.md.

Run it

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

Full build runbook: docs/SETUP.md (step by step, ordered around trial-licence constraints) Ā· agent wiring: docs/AGENT_BUILD.md Ā· what runs on which edition and what is documented rather than demonstrated: docs/ENVIRONMENTS.md.

Known limits

Demo-grade auth (PAT, not OAuth service principal), precomputed scores rather than real-time model serving, single-org. Listed deliberately — the point of the project is the architecture, not production hardening.


Built by Yamyle — Senior Salesforce Architect & Data/AI Engineer. 20+ Salesforce certifications Ā· integration frameworks for utilities and financial services.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured