Skip to main content
Glama

MCP Memory Server

by hannesnortje
test_minimal.py•3.15 kB
#!/usr/bin/env python3 """ Ultra-minimal test MCP server - just logs connections """ import json import sys import time import logging logging.basicConfig(level=logging.INFO, format="%(asctime)s - TEST-MCP - %(message)s") logger = logging.getLogger("test-mcp") logger.info("šŸš€ TEST MCP SERVER STARTED - Waiting for any input...") try: line_count = 0 for line in sys.stdin: line_count += 1 logger.info(f"šŸ“„ Received line {line_count}: {line.strip()}") try: data = json.loads(line.strip()) logger.info(f"šŸ“‹ Parsed JSON: {data}") method = data.get("method") request_id = data.get("id") if method == "initialize": logger.info("šŸŽÆ INITIALIZATION REQUEST RECEIVED!") response = { "jsonrpc": "2024-11-05", "id": request_id, "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": { "tools": [ { "name": "test_tool", "description": "A simple test tool", "inputSchema": { "type": "object", "properties": {}, "required": [] } } ] } }, "serverInfo": { "name": "test-server", "version": "1.0.0" } } } print(json.dumps(response), flush=True) logger.info("āœ… Sent initialization response") elif method == "tools/call": logger.info("šŸ› ļø TOOL CALL RECEIVED!") response = { "jsonrpc": "2024-11-05", "id": request_id, "result": { "content": [{"type": "text", "text": "Test tool executed successfully!"}] } } print(json.dumps(response), flush=True) logger.info("āœ… Sent tool response") else: logger.info(f"ā“ Unknown method: {method}") except json.JSONDecodeError: logger.info(f"āŒ Invalid JSON received") except Exception as e: logger.info(f"āŒ Error processing: {e}") except EOFError: logger.info("šŸ“” Client disconnected (EOF)") except KeyboardInterrupt: logger.info("ā¹ļø Server stopped by user") except Exception as e: logger.info(f"šŸ’„ Server error: {e}") logger.info(f"šŸ TEST MCP SERVER ENDED - Received {line_count} lines total")

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/hannesnortje/MCP'

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