What is the Surfa MCP Server?
The Surfa MCP Server lets you query your analytics data using natural language through Claude Desktop or any MCP-compatible client. Instead of dashboards, just ask:- “What’s my success rate this week?”
- “Find all errors from yesterday”
- “Which tools are slowest?”
How It Works
Features
Natural Language Queries
Ask questions in plain English. No SQL, no dashboards.
8 Analytics Tools
Core analytics + V2 cost optimization tools with multi-model estimates.
JSON Responses
Structured data optimized for AI agent consumption.
Multi-Query Workflows
Chain queries together for complex analysis.
Remote vs Local MCP
Local MCP (STDIO)
- Runs on your machine
- Fast, low latency
- Claude Desktop only
- No deployment needed
Remote MCP (HTTP/SSE)
- Deployed to cloud (Fly.io, Railway, etc.)
- Accessible from anywhere
- Web applications supported
- Requires deployment
Remote MCP Deployment Guide
Learn how to deploy your MCP to production with HTTP/SSE transport
Available Tools
Core Analytics (4 tools)
1. get_analytics
Get high-level metrics about your MCP server.
Example queries:
- “Show me my analytics overview”
- “What’s my success rate?”
- “How many sessions do I have?”
2. query_events
Filter and search through your events.
Example queries:
- “Show me all errors from the last 24 hours”
- “Find tool calls with latency over 1000ms”
- “Get all session events from yesterday”
tool_name- Filter by tool namemin_latency/max_latency- Latency range in msstart_date/end_date- ISO 8601 timestampskind- Event kind (tool, session, runtime)status- Event status (success, error)limit- Max results (default: 100)
3. find_highest_latency
Find your slowest queries.
Example queries:
- “What were the slowest queries this week?”
- “Show me the top 5 slowest tool calls today”
time_range- hour, day, week, or monthtool_name- Optional: filter by specific toollimit- Number of results (default: 10)
4. get_session
Deep-dive into a specific session.
Example queries:
- “Show me details for session abc123”
- “What happened in session xyz789?”
session_id- The session ID to retrieve
V2 Analytics - Cost Optimization (4 tools)
5. find_redundant_executions
Find executions with redundant tool calls that waste tokens and costs.
Example queries:
- “Which sessions have redundant tool calls?”
- “Show me executions wasting the most money on duplicate calls”
- “Find redundancy from the last month”
time_range- hour, day, week, or month (default: week)min_redundancy- Minimum redundancy score 0.0-1.0 (default: 0.3)limit- Max results (default: 20)
6. find_batch_opportunities
Find tools called multiple times per session that could benefit from batch endpoints.
Example queries:
- “Which tools should I add batch endpoints for?”
- “What’s my biggest batching opportunity?”
- “Show me tools that could be batched”
time_range- hour, day, week, or month (default: week)min_call_count- Minimum calls per execution (default: 3)limit- Max results (default: 20)
7. get_tool_insights
Get comprehensive performance insights for a specific tool.
Example queries:
- “How is get_user performing?”
- “Analyze the search_database tool”
- “Show me insights for my slowest tool”
tool_name- Name of the tool to analyze (required)time_range- hour, day, week, or month (default: week)
8. get_execution_metrics
Get detailed V2 metrics for a specific execution (enhanced version of get_session).
Example queries:
- “Show me everything about execution abc123”
- “Debug execution xyz789 with full metrics”
- “Get V2 metrics for the worst redundancy offender”
execution_id- The execution ID to retrieve (required)
Multi-Query Workflows
The real power comes from chaining queries together. Claude can:- Get analytics → sees low success rate
- Query events → finds error patterns
- Analyze → provides recommendations
Use Cases
Product Managers
Product Managers
Track product metrics without SQL:
- “What’s my weekly active users trend?”
- “Which features are most used?”
- “What’s causing the drop in success rate?”
Developers
Developers
Debug faster:
- “Show me all errors in the last hour”
- “Which tool is failing most often?”
- “What happened in session abc123?”
DevOps Teams
DevOps Teams
Monitor performance:
- “What were the slowest queries today?”
- “Show me latency trends this week”
- “Are there any performance regressions?”
AI Agents
AI Agents
Autonomous analytics:
Build PM agents that automatically:
- Monitor metrics
- Detect anomalies
- Investigate issues
- Generate reports
Why Use the MCP Server?
No Context Switching
Query analytics without leaving Claude. No switching to dashboards.
Natural Language
Ask questions like you would a teammate. No learning query languages.
AI-Powered Insights
Claude analyzes the data and provides recommendations automatically.
Agent-Ready
JSON responses perfect for building autonomous PM agents.
Getting Started
Set Up Claude Desktop
Follow our step-by-step guide to install and configure the Surfa MCP Server.
Example Queries
Architecture
- API key stored locally in Claude Desktop config
- Never exposed to Claude
- Workspace-scoped (you only see your data)
Next Steps
Claude Desktop Setup
Install and configure the MCP server
API Reference
Complete API documentation with examples
Quickstart Guide
Start tracking events in 5 minutes
GitHub Repository
View source code and contribute