naru-sensei
服务介绍
MCP Server with Windows 10 and macOS Notification Features
Project Overview
This project aims to create a Model Context Protocol (MCP) server capable of displaying desktop notifications. On Windows 10, the win10toast library will be used, while on macOS, osascript will be utilized for showing notifications. This server will receive requests from MCP clients (such as VSCode Cline) and display desktop notifications based on those requests.
Requirements
Functional Requirements
-
MCP Protocol Support
- Implementation of the Model Context Protocol to establish communication with MCP clients
- Support for the latest MCP specifications (providing full compatibility with VSCode Cline)
- Handling of both synchronous and asynchronous requests
-
Notification System
- Use of the
win10toastlibrary to display desktop notifications on Windows 10 - Use of
osascriptto display notifications in the notification center on macOS - Support for customizable notification parameters:
- Title
- Message content
- Display duration
- Icon (Windows only, optional)
- Subtitle (macOS only, optional)
- Notification sound (macOS only, optional)
- Notification type (information, warning, error, success)
- Use of the
-
Client Connection
- Listening on a configurable network interface (not just
localhostat127.0.0.1, but also all interfaces at0.0.0.0) - Configurable port (default: 8000)
- Handling of multiple simultaneous client connections
- Proper error handling for connection issues
- Listening on a configurable network interface (not just
-
Command Processing
- Processing of notification commands from MCP clients
- Support for a simple API to trigger notifications
- Command validation and provision of appropriate error responses
Technical Requirements
-
Server Implementation
- Use Python 3.8 or higher for implementation
- Implement as an asynchronous server using
asyncioor similar libraries - Follow best practices for MCP server implementation
-
Dependencies
win10toastfor Windows 10 desktop notificationsosascript(built-in) for macOS notifications- Libraries necessary for MCP protocol implementation
- Minimize external dependencies
-
Configuration
- Support for configuration via command-line arguments
- Support for configuration via environment variables
- Provide reasonable default values for all settings
-
Logging and Error Handling
- Implementation of a comprehensive logging system
- Logging of all client connections, commands, and errors
- Proper exception handling with meaningful error messages
Testing Requirements
-
Test Scripts
- Include test scripts to demonstrate server functionality
- Illustrate various notification types
-
Client Compatibility
- Ensure compatibility with VSCode Cline
- Document client-specific configuration requirements
Deliverables
- Python implementation of the MCP server
- Test scripts demonstrating functionality
requirements.txtlisting all dependencies- Documentation on usage and configuration
- A troubleshooting guide for common issues
Implementation Notes
- Ensure the server binds to all interfaces (
0.0.0.0) and not justlocalhost - Use appropriate threading or asynchronous patterns to handle concurrent requests
- Include proper security measures (e.g., input validation)- Provide detailed log options for debugging connection issues
- Implement proper server shutdown
Usage Example
The completed server should be executable as follows:
bash
python mcp_server.py --port 8000 --host 0.0.0.0
And, it should allow triggering notifications through the MCP protocol from VSCode Client or other MCP clients.