Building an MCP server so Claude can query my SaaS analytics directly The article describes how the author built a Model Context Protocol (MCP) server for their analytics SaaS, allowing AI clients like Claude Desktop and Cursor to directly query traffic, revenue, and funnel data. MCP functions as a standardized protocol for AI tool calling, enabling atomic tools that the LLM can chain together to answer complex queries without requiring pre-built dashboards. The author emphasizes that this approach shifts the interface to the LLM itself, with the backend simply providing well-structured tools. 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 js import { Server } from '@modelcontextprotocol/sdk/server/index.js' import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js' const server = new Server { name: 'zenovay', version: '1.0.0', }, { capabilities: { tools: {}, resources: {} } } Defining tools js server.setRequestHandler 'tools/list', async = { tools: { name: 'get traffic', description: 'Get pageview and visitor counts for a site over a date range', inputSchema: { type: 'object', properties: { site: { type: 'string' }, from: { type: 'string' }, to: { type: 'string' } }, required: 'site', 'from', 'to' } } } The pattern that surprised me: structured returns Way better than raw JSON: return a short natural language summary plus the data. Claude uses the summary for its response and the JSON for follow up questions. What I did not expect Users started asking Claude to do things I had not built dashboards for: - "Compare my paid traffic conversion rate this week vs last week" - "Which 5 pages had the biggest week over week drop in pageviews" - "Summarize what changed in my funnel completion rate over the last 30 days" Claude does this by chaining multiple tool calls. I did not need to build any of those views. The tools are atomic, Claude composes. This is the part I think is genuinely new about MCP. The interface is the LLM, the backend is just well shaped tools. Install npm install -g @zenovay/mcp then add to your Claude Desktop config. Site: zenovay.com https://zenovay.com Open source MCP server work happening here too? Curious what patterns others have found. Valerio