Skip to main content
Glama
screenshot_tool.py710 B
from mcp.server.fastmcp import FastMCP import os # Initialize the MCP server for managing local notes mcp = FastMCP("Screenshot") @mcp.tool() def take_screenshot() -> str: """ Take a screenshot and save it as screenshot.png. Returns: A confirmation message indicating the screenshot was taken """ try: from PIL import ImageGrab except ImportError: return "PIL module not found. Please install Pillow to use this feature." screenshot = ImageGrab.grab() screenshot.save("screenshot.png") return "Screenshot taken and saved as screenshot.png" if __name__ == "__main__": # Start the MCP server and listen for requests mcp.run()

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/sritajkumarpatel/learn_mcp_2025'

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