How MCPcat Works
How MCPcat tracks user intent and traces MCP server requests.
MCPcat is an analytics platform that helps MCP server developers understand how their tools are being used. It captures user intent, traces every request, and provides actionable insights—all while preserving your server’s original functionality.
Core Concepts
Session Tracking
Every interaction with your MCP server happens within a session. MCPcat automatically:
- Creates unique session IDs when a client connects
- Tracks session duration and activity patterns
- Groups related tool calls together
- Detects when sessions go inactive
Sessions help you understand complete user workflows rather than isolated tool calls.
User Intent Capture
The magic of MCPcat lies in understanding why users call your tools, not just what they call.
MCPcat automatically injects a context
parameter into your tool schemas. When AI assistants (like Claude or Cline) call your tools, they explain their reasoning:
This context is extracted and stored as user_intent
, giving you insights into:
- What users are trying to accomplish
- How tools fit into larger workflows
- Common patterns and use cases
- Missing functionality users need
Request Tracing
MCPcat intercepts all MCP protocol messages by wrapping your server’s handlers:
Every request is captured with:
- Event type (tool call, resource access, prompt execution)
- Timing data (start time, duration)
- Request parameters and response data
- Error states and messages
- Client information (which AI tool made the request)
How it works under the hood
1. Schema Enhancement
When MCPcat wraps your server, it modifies tool schemas to include the context parameter:
Before MCPcat:
After MCPcat:
2. Transparent Interception
MCPcat intercepts requests without affecting your tool’s functionality:
- Client calls tool with arguments + context
- MCPcat extracts the context parameter
- Your tool receives original arguments (without context)
- Tool executes normally
- MCPcat captures the response
- Event is queued for analytics
Your tools never see the context parameter—they work exactly as before.
3. Asynchronous Processing
Events are processed asynchronously to ensure zero performance impact:
- Thread-safe queue holds events (default: 10,000 capacity)
- Worker threads send events to MCPcat API
- Automatic retries with exponential backoff
- Graceful shutdown ensures no data loss
4. Privacy & Control
MCPcat is designed with privacy in mind:
- Redaction functions let you scrub sensitive data before sending
- All data encrypted at rest
- You control what events are tracked
- No PII required - user identification is optional
Session Lifecycle
Understanding the session lifecycle helps you interpret analytics:
- Session Start: Client connects to your MCP server
- Initialization: MCPcat captures client/server metadata
- Active Use: Tool calls, resource access, prompts executed
- Inactivity: No requests for configured timeout period
- Session End: Marked inactive after timeout
Each session provides a complete picture of user interaction, from initial connection to final tool call.
What Gets Tracked
MCPcat tracks all MCP protocol events:
- Tool Operations:
tools/list
,tools/call
- Resource Operations:
resources/list
,resources/read
- Prompt Operations:
prompts/list
,prompts/get
- Completions:
completion/complete
- Server Lifecycle:
initialize
,initialized
- Custom Events: Your own analytics events
Next Steps
Ready to add analytics to your MCP server? Check out our Quickstart Guide to get started in minutes.