Skip to main content
Glama

Country Explorer MCP Server

by anilsharmay
search_5_mountains.pyโ€ข1.88 kB
#!/usr/bin/env python3 """ Search for exactly 5 mountain images using the Unsplash MCP server. """ import os import sys import json from dotenv import load_dotenv # Add the parent directory to the path so we can import from server.py sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Load environment variables load_dotenv() def search_5_mountains(): """Search for exactly 5 mountain images.""" try: # Import the function from server.py from server import unsplash_search print("๐Ÿ”๏ธ Searching for 5 mountain images...") print("=" * 50) # Search for exactly 5 mountains result = unsplash_search("mountains", num_results=5) # Parse the JSON result data = json.loads(result) print(f"Found {data['total']} total mountain images available!") print(f"Showing {len(data['photos'])} mountain images:") print() for i, photo in enumerate(data['photos'], 1): print(f"{i}. {photo['alt_description'] or 'Mountain landscape'}") print(f" ๐Ÿ“ธ By: {photo['user']['name']} (@{photo['user']['username']})") print(f" โค๏ธ {photo['likes']} likes") print(f" ๐Ÿ“ {photo['width']}x{photo['height']}") print(f" ๐Ÿ”— View: {photo['links']['html']}") print(f" ๐Ÿ–ผ๏ธ Regular size: {photo['urls']['regular']}") print() print("=" * 50) print("โœ… Found 5 beautiful mountain images!") except ImportError as e: print(f"โŒ Error importing from server.py: {e}") except json.JSONDecodeError as e: print(f"โŒ Error parsing JSON response: {e}") except Exception as e: print(f"โŒ Unexpected error: {e}") if __name__ == "__main__": search_5_mountains()

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/anilsharmay/mcp-demo'

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