Custom MCP servers
Three MCP servers, 72 tools, that let AI agents work in Microsoft 365, pull sourced market data, and turn a script into a finished video.
- Role
- Sole developer
- When
- 2026
The problem
The AI agents I use every day were only as useful as what they could reach. I needed them to read and act on Outlook mail, calendar and To Do. I needed market data that comes with its source and date attached, so I can check every number. And I needed a way to produce marketing videos without a video editor. Off-the-shelf connectors either didn't exist or didn't expose what I needed.
What I built
Three Model Context Protocol servers that Claude connects to over stdio. Each one wraps a different backend and gives the agent typed, validated tools instead of raw API access.
How it works
- Microsoft 365 (Python, FastMCP). 23 tools: 13 for To Do, 5 for mail, 5 for calendar, all through Microsoft Graph. Auth is MSAL device-code flow with a local token cache. Every input is a Pydantic model with
extra="forbid", so a hallucinated parameter fails instead of being silently ignored. Graph errors (400, 401, 403, 404, 429) come back as readable messages the agent can act on. - Task triage built in.
ms_todo_open_worksorts open tasks into overdue, due today, due soon, flagged, this week and backlog. A verb heuristic labels each title as a single action, a project, or a notification that was never really a task. - Market data (Python, uv, Docker). 14 read-only tools over SEC EDGAR (XBRL facts, Form 4, 13F), FINRA, FRED, Tiingo and Finnhub. Every response carries
source_url,as_ofandwarnings, so the agent cites its numbers instead of asserting them. Each host has its own rate limit (SEC at 8 req/s, FINRA at 2) and each source its own cache lifetime in SQLite (30 days for filings, 60 seconds for quotes). - Tested offline. 102 tests run against recorded API responses, plus a live smoke test. GitHub Actions runs ruff, mypy and pytest, then publishes the Docker image.
- Explainer engine (Node, MCP SDK). 35 tools take a JSON script through brand-rule checks, voice generation, a Remotion render and a loudness pass to a vertical MP4 with captions. The narration is hashed, so re-rendering a video for a visual fix doesn't spend voice credits again.

A finished card from the explainer engine. The script check refuses any number that doesn't list its source, so the source line is never missing.

A contact sheet: stills from each part of a Spanish video, for checking layout without watching the whole render.
What broke and how I caught it
Videos that opened with a spliced hook were clipping the start of the next line. The cause was upstream: ElevenLabs' word timestamps ran about 0.14 seconds late, so the cut point landed inside the following word. The pipeline's frame review caught it.
I corrected for the offset and added a regression test to the server's test suite. The old cut fails it. The same week, a loudness check caught a Spanish render at −15.5 LUFS against a −14 target: single-pass normalization was undershooting. I fixed the normalization and gave it its own test, which caught my first attempt still coming in at −14.8.
Result
- 72 tools across three servers. I use the Microsoft 365 server every day for mail, calendar and To Do, and the market data server and the explainer engine every week for research and marketing videos.
- The market data server has 102 tests and a CI pipeline that publishes its image on every push.
- The explainer engine went from first commit to a working pipeline in 53 commits over 7 days.
Built with
Built with MCP, Python, FastMCP, TypeScript, Microsoft Graph, MSAL, SQLite, Remotion, ElevenLabs, Docker