MCP Agent Tracker
A Model Context Protocol (MCP) server that automatically tracks client-agent conversations without requiring any user interaction.
Features
🗣️ Automatic Conversation Tracking
Zero User Interaction Required: All conversations are tracked automatically
Client Request Logging: Every client prompt/request is logged
Agent Response Logging: Every agent response is captured
Complete Conversation Turns: Full request-response pairs are recorded
Session Management: Automatic session creation and tracking
🔧 MCP Tools Available
get_current_weather(city)
: Get weather information for a cityagent_interaction(prompt)
: Interact with the agentget_interaction_history(limit, session_id)
: Retrieve conversation historyget_conversation_summary(session_id)
: Get conversation statistics and patterns
📊 Automatic Monitoring
Background Health Checks: Continuous system monitoring every 5 minutes
Automatic Metadata Collection: System info, process details, uptime
Error Tracking: Comprehensive error logging and recovery
Performance Metrics: Execution times and system health
How It Works
1. Automatic Session Creation
2. Client Request Tracking
3. Agent Response Tracking
4. Complete Conversation Logging
5. Background Monitoring
Configuration
Environment Variables
Configuration Options
ENABLE_BACKGROUND_MONITORING
: Enable continuous system monitoringMONITORING_INTERVAL_SECONDS
: How often to run health checks (default: 300s)ENABLE_AUTOMATIC_METADATA
: Collect system info automatically
Database Schema
AgentInteraction Table
Session Table
Usage Examples
Basic Conversation Tracking
Getting Conversation History
Security Features
Environment Variables: All configuration via environment variables
No Hardcoded Secrets: Secure credential management
Isolated Database Schema: Separate schema for tracking data
Error Isolation: Logging failures don't break main functionality
Getting Started
Copy environment file:
Configure your environment:
Run the server:
Monitor conversations:
🚀 Using in Cursor
Prerequisites
Cursor IDE installed on your system
Python 3.8+ with pip/uv package management
Git for cloning the repository
Step 1: Setup MCP Server
Clone and navigate to your project:
Install dependencies:
Configure environment:
Step 2: Configure Cursor for MCP
Open Cursor Settings:
Press
Cmd+,
(Mac) orCtrl+,
(Windows/Linux)Or go to
Cursor → Preferences → Settings
Add MCP Configuration:
Alternative: Use relative paths (if Cursor is opened in project directory):
Step 3: Test MCP Integration
Restart Cursor after adding MCP configuration
Open Command Palette (
Cmd+Shift+P
orCtrl+Shift+P
)Type "MCP" to see available MCP commands
Test a tool:
Use
get_current_weather("New York")
to test weather functionalityUse
agent_interaction("Hello, how are you?")
to test conversation trackingUse
get_system_status()
to check system health
Step 4: Use MCP Tools in Cursor
Available Tools
get_current_weather(city)
: Get weather for any cityagent_interaction(prompt)
: Interact with the agent and track conversationsget_interaction_history(limit, session_id)
: View conversation historyget_conversation_summary(session_id)
: Get conversation analyticsget_system_status()
: Check system health and configurationtest_conversation_tracking(message)
: Test the tracking system
Example Usage in Cursor
Open Command Palette (
Cmd+Shift+P
)Type MCP command:
Enter parameters when prompted:
View results in the output panel
Step 5: Monitor and Debug
View Conversation History
Check System Status
Test Conversation Tracking
Troubleshooting
Common Issues
"MCP server not found":
Check the absolute path in your Cursor settings
Ensure the Python path is correct
Verify the server is running
"Import errors":
Check
PYTHONPATH
in MCP configurationEnsure all dependencies are installed
Verify you're in the correct directory
"Permission denied":
Make sure
main.py
is executableCheck file permissions
Try running with
python3
instead ofpython
Debug Commands
Advanced Configuration
Custom MCP Server Names
Multiple MCP Servers
Benefits in Cursor
✅ Seamless Integration: Use MCP tools directly in your IDE
✅ Real-time Monitoring: Track conversations as you work
✅ Debugging Tools: Built-in testing and monitoring functions
✅ Performance Insights: Monitor system health and usage
✅ Conversation Analytics: Analyze interaction patterns
✅ Zero Configuration: Automatic setup and tracking
Your MCP server will now be fully integrated with Cursor, providing powerful conversation tracking and monitoring capabilities right in your development environment!
What Gets Tracked Automatically
✅ Client Requests: Every prompt, question, or request
✅ Agent Responses: Every response, answer, or action
✅ Conversation Flow: Complete request-response pairs
✅ System Health: Background monitoring and metrics
✅ Error Handling: All errors and exceptions
✅ Session Data: User sessions and activity
✅ Metadata: System info, timestamps, environment
❌ Tool Usage: Internal MCP tool executions are not tracked
❌ User Input: No manual logging required
❌ Configuration: Automatic setup and management
The system is designed to be completely hands-off - once started, it will track all client-agent conversations automatically without any intervention needed.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Automatically tracks and logs all client-agent conversations in real-time without user intervention. Provides conversation history, analytics, weather tools, and continuous system health monitoring with complete request-response pair recording.
Related MCP Servers
- -securityFlicense-qualityA centralized server that tracks and manages connected agents, providing a web interface to monitor their status while enabling agent communication through a central point.Last updated -
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI tools to automatically log their activities with detailed metrics like timestamps, token usage, and costs into daily markdown worklog files.Last updated -11MIT License
- AsecurityFlicenseAqualityEnables AI assistants to automatically log and manage conversation history with developers in structured markdown format. Provides powerful search and context suggestions to help AI understand project history and maintain continuity across sessions.Last updated -41
- -securityFlicense-qualityEnables AI-powered analytics for OpenReplay user sessions through natural language queries. Supports session search, user journey analysis, error tracking, performance metrics, and funnel analysis to understand user behavior patterns.Last updated -11