Skip to main content
Glama

O'RLY MCP Server

test_image_conversion.pyโ€ข2.37 kB
#!/usr/bin/env python3 """ Comprehensive test for the ORLY MCP server showing image conversion to ImageContent """ import sys import os # Add the current directory to the path sys.path.append(os.path.dirname(os.path.abspath(__file__))) from orly_mcp.server import generate_orly_cover from mcp.types import ImageContent def test_image_conversion(): """Test that the tool properly converts to ImageContent for MCP""" print("๐Ÿงช Testing ORLY MCP tool image conversion...") try: # Generate a cover with lower scale (1.0 = 500x700px instead of 1500x2100px) image_result = generate_orly_cover( title="Windows WPF", author="Microsoft Corp", subtitle="Super Future Technology!!!", guide_text="The 'F' Stands for 'Forever'", guide_text_placement="bottom_right", scale=1.0 # Much smaller resolution for testing ) print(f"โœ… Generated Image object: {type(image_result)}") # Convert to ImageContent (this is what MCP does internally) image_content = image_result.to_image_content() print(f"๐Ÿ–ผ๏ธ Converted to ImageContent: {type(image_content)}") print(f"๐Ÿ“‹ MIME Type: {image_content.mimeType}") print(f"๐Ÿ“Š Base64 data length: {len(image_content.data)} characters") print(f"๐Ÿท๏ธ Content type: {image_content.type}") # Verify it's proper ImageContent assert isinstance(image_content, ImageContent) assert image_content.type == "image" assert image_content.mimeType == "image/png" assert len(image_content.data) > 0 # Test base64 decoding import base64 decoded_data = base64.b64decode(image_content.data) print(f"๐Ÿ”ข Decoded image size: {len(decoded_data)} bytes") # Verify PNG header if decoded_data.startswith(b'\x89PNG\r\n\x1a\n'): print("โœ… Valid PNG file detected!") else: print("โš ๏ธ Warning: PNG header not detected") print("\n๐ŸŽ‰ All tests passed! The MCP server will display images directly in chat.") except Exception as e: print(f"โŒ Test failed: {e}") import traceback traceback.print_exc() if __name__ == "__main__": test_image_conversion()

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/princefishthrower/orly-mcp'

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