Baby Sensory Analytics MCP Server

Baby Sensory Analytics MCP Server

Cloud-powered analytics server for Baby Sensory World that tracks engagement patterns, favorite themes, colors, and provides AI-powered insights to optimize baby's sensory experience.

Category
Visit Server

README

Baby Sensory Analytics MCP Server

Cloud-powered analytics server for Baby Sensory World application. Tracks engagement patterns, favorite themes, colors, and provides AI-powered insights to optimize your baby's sensory experience.

šŸ“– Read HOW_IT_WORKS.md for a comprehensive guide with diagrams explaining the full system architecture and how the MCP server integrates with the web application.

Features

  • ā˜ļø Cloud Storage - Supabase PostgreSQL database for reliable, accessible data
  • šŸ“Š Session Tracking - Records every 20-minute play session with full engagement metrics
  • 🧠 Smart Insights - AI analyzes favorite themes, colors, objects, and best play times
  • šŸ¤– MCP Integration - Accessible via Model Context Protocol for Claude and other AI assistants
  • šŸ”’ Privacy First - Your data, your database, full control

Setup

1. Install Dependencies

cd baby-sensory-analytics
npm install
npm run build

2. Set Up Supabase Database

The MCP server uses Supabase for cloud storage. If you haven't already:

  1. Create a free account at supabase.com
  2. Create a new project
  3. Run the table creation SQL (in supabase/migrations/001_create_sessions_table.sql)
  4. Get your project URL and anon key from Project Settings > API

The database credentials are configured in src/db/supabase.config.ts or can be set via environment variables:

export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_ANON_KEY="your-anon-key-here"

3. Configure MCP Server

Add to ~/.claude/mcp_settings.json:

{
  "mcpServers": {
    "baby-sensory-analytics": {
      "command": "node",
      "args": ["/Users/your-username/path/to/baby-sensory-analytics/dist/index.js"],
      "env": {
        "SUPABASE_URL": "https://your-project.supabase.co",
        "SUPABASE_ANON_KEY": "your-anon-key"
      }
    }
  }
}

Note: The keys in env override the defaults in supabase.config.ts.

Usage

1. Web App Integration

Your Baby Sensory World web app needs to write sessions directly to Supabase. Add the Supabase client to your web app:

npm install @supabase/supabase-js

Then configure it to save sessions after each play session:

import { createClient } from '@supabase/supabase-js';

const supabase = createClient(
  'https://your-project.supabase.co',
  'your-anon-key'
);

// After a session completes
await supabase.from('sessions').insert({
  id: sessionId,
  timestamp: Date.now(),
  theme: 'Ocean',
  duration: 1200,
  touches: 156,
  color_counts: { "#4ECDC4": 45, "#0088FF": 38 },
  object_counts: { "🐟": 48, "🫧": 35 },
  nursery_rhymes_played: ["Twinkle Twinkle"],
  streaks: 12,
  milestones: [10, 25, 50, 100, 150],
  completed_full: true
});

2. Query Insights via MCP

Once data is synced, you can query insights using Claude or any MCP client:

"Show me my baby's weekly summary"
"What is my baby's favorite theme?"
"What colors does my baby interact with most?"
"When is the best time to play?"

MCP Resources

The server exposes these resources:

  • baby-sensory://sessions/list - All recorded sessions
  • baby-sensory://sessions/recent - Last 7 days of sessions
  • baby-sensory://sessions/{id} - Specific session details
  • baby-sensory://insights/weekly-summary - Weekly engagement report
  • baby-sensory://insights/themes - Theme preference rankings
  • baby-sensory://insights/colors - Color engagement stats
  • baby-sensory://insights/timing - Best times for play
  • baby-sensory://export/all - Export all data as JSON

MCP Tools

The server provides these tools:

  • create_session - Log a new play session
  • get_session - Retrieve session by ID
  • list_sessions - List sessions with optional limit

Data Schema

Session Object

{
  id: string              // UUID
  timestamp: number       // Unix timestamp (ms)
  theme: string           // "Ocean", "Space", etc.
  duration: number        // Seconds
  touches: number         // Total touches
  colorCounts: {          // Color engagement
    "#FF6B6B": 15,
    "#4ECDC4": 23
  },
  objectCounts: {         // Object type engagement
    "🐠": 8,
    "⭐": 12
  },
  nurseryRhymesPlayed: [  // Rhymes played during session
    "Twinkle Twinkle",
    "Baa Baa Black Sheep"
  ],
  streaks: number         // Longest streak
  milestones: [10, 25, 50], // Milestones achieved
  completedFull: boolean  // Finished 20 minutes?
}

Development

Run in Development Mode

npm run watch  # Auto-rebuild on changes

Test with MCP Inspector

npm run inspector

This opens the MCP Inspector tool to test resources and tools.

Debugging

Server logs to stderr for debugging:

node dist/index.js 2> debug.log

Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  Baby Sensory Web App   │
│  (React + Vite)         │
│  - Netlify hosted       │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
             │
             │ HTTP/REST API
             │ (Supabase Client)
             ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│     Supabase Cloud      │
│  - PostgreSQL Database  │
│  - Real-time sync       │
│  - Row Level Security   │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
             │
             │ Read (Supabase Client)
             ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  Baby Sensory Analytics │
│  MCP Server (Local)     │
│  (Node.js)              │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
             │
             │ MCP Protocol (stdio)
             ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  Claude Code / AI       │
│  (MCP Clients)          │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Data Flow:

  1. Web app → Supabase (sessions written after play)
  2. MCP Server → Supabase (reads sessions for analytics)
  3. Claude Code → MCP Server (queries insights via MCP protocol)

Future Enhancements

  1. Direct Browser Integration - WebSocket bridge for real-time sync
  2. Dashboard UI - Visual charts and graphs in the web app
  3. Insights Widget - Show favorite theme on main screen
  4. Export Features - Download reports as PDF
  5. Trend Analysis - Track changes in preferences over time

Privacy

  • All data stored locally on your machine
  • No network requests to external servers
  • No telemetry or analytics collection
  • You own your data, delete anytime

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured