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.
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-democloned 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
- The two-server agent looks for the insurance MCP server at
horizon-mcp-demofully built (dbt seed && dbt runcompleted)
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。