Skip to main content
Glama

MCP Agent Tracker

by Big0290
force_refresh_modules.pyโ€ข2.13 kB
#!/usr/bin/env python3 """ ๐Ÿš€ Force Refresh All Modules - Clear Python Caching Issues """ import sys import importlib def force_refresh_modules(): """Force refresh all relevant modules to clear caching issues.""" print("=== ๐Ÿš€ FORCING MODULE REFRESH ===\n") # List of modules to refresh modules_to_refresh = [ 'local_mcp_server_simple', 'main', 'enhanced_chat_integration', 'optimized_prompt_generator', 'prompt_generator' ] refreshed_count = 0 for module_name in modules_to_refresh: try: if module_name in sys.modules: # Force reload the module module = importlib.reload(sys.modules[module_name]) print(f"โœ… REFRESHED: {module_name}") refreshed_count += 1 else: print(f"โš ๏ธ NOT LOADED: {module_name}") except Exception as e: print(f"โŒ FAILED TO REFRESH {module_name}: {e}") print(f"\n๐Ÿš€ Total modules refreshed: {refreshed_count}") # Test if the refresh worked print("\n=== ๐Ÿงช TESTING REFRESH RESULTS ===") try: from local_mcp_server_simple import enhanced_chat as local_enhanced_chat result = local_enhanced_chat("test after refresh") print(f"โœ… Local enhanced_chat: {len(result)} chars, OPTIMIZED: {'๐Ÿš€ OPTIMIZED PROMPT:' in result}") except Exception as e: print(f"โŒ Local enhanced_chat test failed: {e}") try: from main import enhanced_chat as main_enhanced_chat result = main_enhanced_chat("test after refresh") print(f"โœ… Main enhanced_chat: {len(result)} chars, OPTIMIZED: {'๐Ÿš€ OPTIMIZED PROMPT:' in result}") except Exception as e: print(f"โŒ Main enhanced_chat test failed: {e}") print("\n=== ๐ŸŽฏ NEXT STEPS ===") print("1. โœ… Modules refreshed") print("2. ๐Ÿ”„ Restart your MCP server") print("3. ๐Ÿงช Test enhanced_chat again") print("4. ๐Ÿš€ Should now see optimized prompts!") if __name__ == "__main__": force_refresh_modules()

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

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