Skip to main content
Glama

Titanmind WhatsApp MCP

by TitanmindAGI
MIT License
15
  • Apple
  • Linux
test.pyโ€ข2.57 kB
#!/usr/bin/env python3 """ Test script for the WhatsApp MCP server """ import asyncio import os from titan_mind.server import mcp async def test_tools(): """Test the MCP server tools directly""" print("๐Ÿงช Testing WhatsApp MCP Server Tools\n") # Set up test environment os.environ.setdefault("TITANENGAGE_API_KEY", "test-key-for-testing") try: # Test 1: List available tools print("๐Ÿ“‹ Available Tools:") tools = mcp.list_tools() for tool in tools: print(f" - {tool.name}: {tool.description}") print() # Test 2: List available prompts print("๐Ÿ’ฌ Available Prompts:") prompts = mcp.list_prompts() for prompt in prompts: print(f" - {prompt.name}: {prompt.description}") print() # Test 3: Test a prompt print("๐ŸŽฏ Testing WhatsApp Message Template Prompt:") try: prompt_result = await mcp.get_prompt( "WhatsApp Message Template", {"recipient": "John Doe", "context": "Following up on our meeting"} ) print(f"Prompt Result: {prompt_result}") except Exception as e: print(f"Prompt test failed: {e}") print() # Test 4: Test tool calling (with mock data) print("๐Ÿ”ง Testing send_whatsapp_message tool:") try: # This will fail with API call but should show the structure result = await mcp.call_tool( "send_whatsapp_message", { "phone_number": "+1234567890", "message": "Test message from MCP server" } ) print(f"Tool Result: {result}") except Exception as e: print(f"Tool test result (expected with test API key): {e}") print() print("โœ… MCP Server structure test completed!") except Exception as e: print(f"โŒ Error during testing: {e}") import traceback traceback.print_exc() def test_server_startup(): """Test if the server can start properly""" print("๐Ÿš€ Testing MCP Server Startup\n") try: # Test server initialization print("Server name:", mcp.name) print("Server initialized successfully!") # Run async tests asyncio.run(test_tools()) except Exception as e: print(f"โŒ Server startup failed: {e}") import traceback traceback.print_exc() if __name__ == "__main__": test_server_startup()

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/TitanmindAGI/titanmind-whatsapp-mcp'

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