# CursorMCPMonitor

> MCP Server

This .NET console application monitors Cursor AI editor's Model Context Protocol (MCP) interactions by parsing and color-coding log files in real-time, providing developers with debugging and analysis capabilities.

## Overview

- **Category:** Developer Tools
- **Language:** C#
- **Stars:** 12
- **Forks:** 1
- **Owner:** willibrandon
- **GitHub:** https://github.com/willibrandon/CursorMCPMonitor
- **Created:** 2025-03-03T05:22:43+00:00
- **Updated:** 2025-03-23T13:13:49+00:00
- **Source:** https://model-context-protocol.com/servers/cursor-ai-mcp-interaction-monitor

## Setup

## Setup

1.  Install the tool globally using the .NET CLI:

    ```bash
    # Install from NuGet.org
    dotnet tool install --global CursorMCPMonitor

    # Or install from GitHub Packages
    dotnet nuget add source --name github "https://nuget.pkg.github.com/willibrandon/index.json"
    dotnet tool install --global CursorMCPMonitor --add-source github
    ```

2.  Run the tool from anywhere using:

    ```bash
    cursor-mcp --help
    ```

3.  Update to the latest version:

    ```bash
    dotnet tool update --global CursorMCPMonitor
    ```

4.  Uninstall:

    ```bash
    dotnet tool uninstall --global CursorMCPMonitor
    ```

5. Configure the application through `appsettings.json` or override settings using environment variables.

6. Build the application using `dotnet build` after installing the .NET 9.0 SDK or later.

7. Run the application using `dotnet run`.

8. For Docker support, build the image using `docker build -t cursor-mcp-monitor -f src/CursorMCPMonitor/Dockerfile .` from the repository root directory.

9. Run the Docker container with volume mapping for logs and set the `LogsRoot` environment variable.

## Tools

## Available Tools

1.  Real-time monitoring of MCP client-server interactions in Cursor (monitors client creation, server offerings, protocol errors, and client lifecycle).
2.  Monitors the Cursor logs directory for new MCP log files.
3.  Parses and color-codes different message types (green for client creation, yellow for server offerings, red for errors, gray for general information).
4.  Supports log rotation and file truncation.
5.  Cross-platform support (Windows, macOS, Linux).
6.  Smart error handling with exponential backoff and retry logic.
7.  Configurable polling interval and log file patterns.
8.  Command-line interface for easy customization.
9.  Structured logging with Serilog for improved observability (console logging, file logging, contextual properties, log level filtering).
10. Interactive web-based dashboard (real-time event streaming, automatic reconnection, event rate monitoring).
11. Terminal display with timestamps and color-coded messages.
12. Advanced search functionality with highlighting and keyboard shortcuts.
13. Command palette for quick access to actions (clear logs, copy entries, toggle auto-scroll, focus search).
14. Status indicators for WebSocket connection, client count, and events per second.
15. Dark and light themes with system theme detection.
