horizon-predictive-model-mcp

horizon-predictive-model-mcp

Exposes a professional services pipeline prediction model with tools to score opportunities, validate inputs, and retrieve model metadata such as win probability, fees, and margin.

Category
Visit Server

README

horizon-mcp-demo-extended

Extends the horizon-mcp-demo with a second MCP server wrapping the Horizon Data Predictive Model, demonstrating the Claudeception pattern — a single Claude agent connecting to two governed data systems simultaneously.

Built as research and reference material for the Horizon Data Partners white paper: The Governed Data Layer: Why AI Agents Fail Without One, and How to Build It.


What this demonstrates

The core pattern: Two governed data systems, one agent, reasoning across both simultaneously.

System Transport What it exposes Tools
Insurance Data (from horizon-mcp-demo) MCP via stdio P&C insurance semantic layer — loss ratio, claim frequency, earned premium by segment list_models, get_model_details, get_metric_definitions, query_data
Predictive Model (this repo) Direct Python calls Professional services pipeline prediction model — win probability, fees, margin, milestone timing describe_inputs, describe_outputs, validate_payload, score_opportunity

The agent connects to both servers simultaneously, discovers what each one exposes, and reasons about how to bridge them — including explicitly surfacing the schema mismatch between the two systems and the governance risks of any mapping it proposes.


The schema mapping problem (Option C)

The two systems use completely different schemas:

Insurance data: product_type (auto/homeowners), state (TX/CA/FL/NY)

Predictive model: ServiceLine (Audit/Tax/Advisory), ClientType (Business/Individual), Industry (Healthcare/Financial Services/Technology/Manufacturing), NewVsExisting (Existing/New), LeadSource (Referral/Competitive)

These fields do not map cleanly to each other. The demo provides a pre-specified mapping for some questions, but Question 3 deliberately asks the agent to reason about the mapping problem before applying it — surfacing the governance risks of cross-system field mapping in a way that documents rather than hides the assumption.

This is the real-world use case: someone has a predictive model and a data source with different schemas, and needs an agent to connect them intelligently.


Project structure

horizon-mcp-demo-extended/
├── data/
│   └── seed_predictive_model.py    # Generates predictive_model.duckdb from scratch
├── mcp_server/
│   └── predictive_model_mcp_server.py  # Model-side MCP server (4 tools)
├── scripts/
│   └── run_two_server_agent.py     # Claudeception demo — two servers, one agent
├── logs/                           # Created at runtime — token logs per run
├── docs/                           # Additional documentation
├── requirements.txt
├── .gitignore
└── README.md

Prerequisites

  • Python 3.12
  • horizon-mcp-demo cloned at the same directory level as this repo
    • The two-server agent looks for the insurance MCP server at ../horizon-mcp-demo/mcp_server/horizon_mcp_server.py
  • horizon-mcp-demo fully built (dbt seed && dbt run completed)

Setup (Windows)

1. Clone this repo

git clone https://github.com/christianashworth/horizon-mcp-demo-extended.git
cd horizon-mcp-demo-extended

2. Create and activate virtual environment

py -3.12 -m venv .venv
.venv\Scripts\activate

3. Install dependencies

python -m pip install --upgrade pip
pip install -r requirements.txt

4. Generate the predictive model database

python data/seed_predictive_model.py

This generates data/predictive_model.duckdb — a DuckDB replica of the SQL Server model's trained segment estimates. Takes about 30 seconds.

5. Run the two-server demo

$env:ANTHROPIC_API_KEY = "your-api-key-here"
python scripts/run_two_server_agent.py

Demo questions

# Question type Servers used
1 Model understanding — what does the predictive model need? Predictive Model only
2 Governed data query — insurance loss ratios by segment Insurance Data only
3 Schema mapping surfaced — reason about mapping insurance fields to model inputs before scoring Both
4 Cross-server analysis — score all homeowners segments and combine with loss ratio data Both
5 Governance reflection — what decisions need to be made before using this mapping in production? Both

Predictive model input contract

Field Type Allowed values Notes
ServiceLine string Audit, Tax, Advisory Required. Highest priority — dropped last.
ClientType string Business, Individual Required
Industry string Healthcare, Financial Services, Technology, Manufacturing Optional (nullable for Individuals)
NewVsExisting string Existing, New Required
LeadSource string Referral, Competitive Required. Lowest priority — dropped first.

Predictive model outputs

Output Description
WinPct Probability of winning (0.0–1.0)
NetFees Estimated net fees in USD if won
MarginPct Estimated margin percentage
DaysSellToStart Estimated days from contract signing to work start
DaysStartTo50Pct Estimated days from work start to 50% completion
DaysStartTo100Pct Estimated days from work start to 100% completion

Notes

  • The predictive model database (data/predictive_model.duckdb) is excluded from version control — generated locally by the seed script.
  • The predictive model tools run as direct Python function calls — this avoids a Windows asyncio/anyio compatibility issue with nested stdio MCP clients while preserving the same agent behavior.
  • Token usage is logged per question per server in logs/two_server_run_<timestamp>.json.
  • The Claudeception pattern works with any MCP-compatible agent, not just Claude — the two servers are independent and do not communicate with each other directly.

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