cd /news/artificial-intelligence/building-an-mcp-server-so-claude-can… · home topics artificial-intelligence article
[ARTICLE · art-11432] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

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.

read2 min views17 publishedMay 23, 2026

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 #

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 #

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

Open source MCP server work happening here too? Curious what patterns others have found.

Valerio

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @claude desktop 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-an-mcp-serv…] indexed:0 read:2min 2026-05-23 ·