Last week I shipped a Model Context Protocol (MCP) server for my analytics SaaS. Now Claude Desktop, Cursor, and any MCP compatible client can query traffic, revenue, and funnel data directly.

This is a walkthrough of how I built it, what worked, and a couple of patterns that surprised me.

What MCP is, briefly

MCP is a protocol that lets AI clients invoke tools and read resources from external servers. Think of it as REST for LLM tool calling, with a stable schema and discovery.

Server skeleton