Skip to main content
Glama
notifications.py940 B
import asyncio from fastmcp import FastMCP from mcp_windows.appid import APP_ID from winrt.windows.ui.notifications import ToastNotificationManager, ToastNotification from winrt.windows.data.xml.dom import XmlDocument mcp: FastMCP = FastMCP( name="notifications", ) @mcp.tool("send_toast") async def send_toast(title: str, message: str) -> str: """Send a windows toast notification to the user.""" toast_xml_string = f""" <toast> <visual> <binding template="ToastGeneric"> <text>{title}</text> <text>{message}</text> </binding> </visual> </toast> """ xml_doc = XmlDocument() xml_doc.load_xml(toast_xml_string) toast = ToastNotification(xml_doc) notifier = ToastNotificationManager.create_toast_notifier_with_id(APP_ID) notifier.show(toast) return "Toast notification sent"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SecretiveShell/mcp-windows'

If you have feedback or need assistance with the MCP directory API, please join our Discord server