BM

big0290/mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 0 forks 质量 54 趋势 0

A Model Context Protocol (MCP) server that automatically tracks client-agent conversations without requiring any user interaction.

概览

A Model Context Protocol (MCP) server that automatically tracks client-agent conversations without requiring any user interaction. - : All conversations are tracked automatically - : Every client prompt/request is logged - : Every agent response is captured - : Full request-response pairs are recorded - : Automatic session creation and tracking - get_current_weather(city): Get weather information for a city - agent_interaction(prompt): Interact with the agent - get_interaction_history(limit, session_id): Retrieve conversation history - get_conversation_summary(session_id): Get conversation statistics and patterns - : Continuous system monitoring every 5 minutes - : System info, process details, uptime - : Comprehensive error logging and recovery - : Execution times and system health - : Enable continuous system monitoring - : How often to run health checks (default: 300s) - : Collect system info automatically - : All configuration via environment variables - : Secure credential...

README

以下为原文 README 节选,完整内容请查看原文。

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 city
  • agent_interaction(prompt): Interact with the agent
  • get_interaction_history(limit, session_id): Retrieve conversation history
  • get_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

# Sessions are created automatically when the server starts
# No user input required
logger.get_or_create_session()

2. Client Request Tracking

# Every client request is automatically logged
logger.log_client_request(f"Get weather for {city}")

3. Agent Response Tracking

# Every agent response is automatically captured
logger.log_agent_response(response)

4. Complete Conversation Logging

# Full conversation turns are recorded
logger.log_conversation_turn(
    client_request=f"Get weather for {city}",
    agent_response=response
)

5. Background Monitoring

# System health is monitored continuously
# No user interaction needed
def background_monitoring():
    while True:
        logger.log_interaction(interaction_type='health_check', ...)
        time.sleep(Config.MONITORING_INTERVAL_SECONDS)

Configuration

Environment Variables

# Enable/disable features
ENABLE_BACKGROUND_MONITORING=true
MONITORING_INTERVAL_SECONDS=300
ENABLE_AUTOMATIC_METADATA=true

# Database and logging
DATABASE_URL=
DB_PATH=./data/agent_tracker.db
LOG_LEVEL=INFO

Configuration Options

  • ENABLE_BACKGROUND_MONITORING: Enable continuous system monitoring
  • MONITORING_INTERVAL_SECONDS: How often to run health checks (default: 300s)
  • ENABLE_AUTOMATIC_METADATA: Collect system info automatically

Database Schema

AgentInteraction Table

CREATE TABLE agent_interactions (
    id INTEGER PRIMARY KEY,
    timestamp TIMESTAMP,
    session_id VARCHAR(255),
    user_id VARCHAR(255),
    interaction_type VARCHAR(100),  -- 'client_request', 'agent_response', 'conversation_turn'
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-project": { "command": "python", "args": ["/absolute/path/to/your/project/main.py"], "env": { "PYTHONPATH": "/absolute/path/to/your/project" } } } }