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.
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:
- Create a free account at supabase.com
- Create a new project
- Run the table creation SQL (in
supabase/migrations/001_create_sessions_table.sql) - 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 sessionsbaby-sensory://sessions/recent- Last 7 days of sessionsbaby-sensory://sessions/{id}- Specific session detailsbaby-sensory://insights/weekly-summary- Weekly engagement reportbaby-sensory://insights/themes- Theme preference rankingsbaby-sensory://insights/colors- Color engagement statsbaby-sensory://insights/timing- Best times for playbaby-sensory://export/all- Export all data as JSON
MCP Tools
The server provides these tools:
create_session- Log a new play sessionget_session- Retrieve session by IDlist_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:
- Web app → Supabase (sessions written after play)
- MCP Server → Supabase (reads sessions for analytics)
- Claude Code → MCP Server (queries insights via MCP protocol)
Future Enhancements
- Direct Browser Integration - WebSocket bridge for real-time sync
- Dashboard UI - Visual charts and graphs in the web app
- Insights Widget - Show favorite theme on main screen
- Export Features - Download reports as PDF
- 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。