A step-by-step guide to building a personal financial assistant using the Model Context Protocol (MCP) with EODHD's MCP server for market data. The key design pattern is the 'narrator' approach: Python deterministically fetches prices and fundamentals via MCP tool calls, computes metrics (returns, volatility, max drawdown, trend slope, regime labels), and only then passes a structured facts object to an LLM for narrative generation. This prevents hallucinated numbers. The guide covers building an MCP client wrapper, request parsing, metric computation, watchlist correlation/ranking utilities, and an orchestration function. Two demos are shown: a single-ticker market brief for AAPL and a multi-ticker watchlist snapshot comparing TSLA, NVDA, and AMZN. The structured response includes the narrative, raw computed metrics, tool call audit trail, and a trace ID.
Table of contents
Table of ContentsPrerequisitesWhat is MCP, and How Does it Change the Integration Story?Architecture: The “Narrator” PatternStep 1: MCP Client Wrapper ( client.py )Step 2: The Assistant Core ( core.py )Demo 1: Market Brief for One TickerDemo 2: Watchlist SnapshotWhat Makes this Shippable, and What Can Be Improved?ConclusionSort: