Skip to main content
Glama
test_chatbot_integration.pyโ€ข2.1 kB
#!/usr/bin/env python3 """ Test chatbot integration with fixed Notion MCP server """ import os from src.utils.chatbot_agentic_v3 import Chatbot def test_chatbot_integration(): print("๐Ÿค– Testing Chatbot Integration with New Structure") print("=" * 60) # Check environment variables notion_token = os.getenv("NOTION_TOKEN") server_url = os.getenv("NOTION_MCP_SERVER_URL", "https://notion-mcp-server-5s5v.onrender.com/") print(f"๐Ÿ”ง Configuration:") print(f" Server URL: {server_url}") print(f" Token configured: {'โœ…' if notion_token else 'โŒ'}") print() try: chatbot = Chatbot() if chatbot.notion_initialized: print("โœ… Notion MCP initialized successfully") # Test page creation through chatbot user_message = "Create a new page called 'New Structure Test' with content about how our restructured MCP server is working perfectly with environment-based configuration." print(f"\n๐Ÿ’ฌ User message: {user_message}") print("\n๐Ÿ”„ Processing...") response = chatbot.chat(user_message) print("\n๐Ÿค– Chatbot Response:") print(response) if "successfully created" in response.lower() or "page" in response.lower(): print("\n๐ŸŽ‰ SUCCESS: Chatbot successfully created a page!") return True else: print("\nโš ๏ธ Response unclear - check above") return False else: print("โŒ Notion MCP not initialized in chatbot") return False except Exception as e: print(f"โŒ Error: {str(e)}") return False if __name__ == "__main__": success = test_chatbot_integration() if success: print("\nโœ… Chatbot integration test PASSED!") else: print("\nโŒ Chatbot integration test FAILED!") print("๐Ÿ’ก Make sure to set NOTION_TOKEN and NOTION_MCP_SERVER_URL environment variables")

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/ankitmalik84/Agentic_Longterm_Memory'

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