Skip to main content
Glama
demo_standalone_agent.pyโ€ข4.48 kB
#!/usr/bin/env python3 """ Demo script for the Standalone Firebase Agent in firebase_admin_mcp Django app. This script demonstrates how to use the standalone Firebase agent that includes all necessary components without external dependencies on the main django_firebase_mcp system. """ import os import sys # Add the project root to path project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(project_root) def demo_standalone_firebase_agent(): """Demo the standalone Firebase agent functionality.""" print("๐Ÿ”ฅ Standalone Firebase Agent Demo") print("=" * 50) print("This demo shows the capabilities of the standalone Firebase agent.") print("The agent includes all components in a single file:\n") print("๐Ÿ“ฆ Components included:") print(" โœ“ Firebase MCP Client") print(" โœ“ Agent Configuration (FA1)") print(" โœ“ Firebase Prompt Definition") print(" โœ“ State Management") print(" โœ“ All Firebase Tools (14 tools)") print(" โœ“ Comprehensive Logging") print(" โœ“ Interactive Chat Interface") print("\n๐Ÿ› ๏ธ Available Firebase Tools:") print(" Authentication:") print(" - firebase_verify_token") print(" - firebase_create_custom_token") print(" - firebase_get_user") print(" Firestore Database:") print(" - firestore_list_collections") print(" - firestore_create_document") print(" - firestore_get_document") print(" - firestore_update_document") print(" - firestore_delete_document") print(" - firestore_query_collection") print(" Cloud Storage:") print(" - storage_list_files") print(" - storage_upload_file") print(" - storage_download_file") print(" - storage_delete_file") print(" System:") print(" - firebase_health_check") print("\n๐Ÿš€ Usage Options:") print("1. Run directly:") print(" python firebase_admin_mcp/standalone_firebase_agent.py") print("\n2. Run via Django management command:") print(" python manage.py run_standalone_agent") print("\n3. Import and use programmatically:") print(" from firebase_admin_mcp.standalone_firebase_agent import create_standalone_firebase_agent") print(" agent = create_standalone_firebase_agent()") print("\n4. Run with custom MCP server URL:") print(" python manage.py run_standalone_agent --server-url http://localhost:8002/mcp/") print("\n๐Ÿ“‹ Features:") print(" ๐Ÿ” Comprehensive logging to 'standalone_firebase_agent.log'") print(" ๐Ÿ›ก๏ธ Error handling and recovery") print(" โšก Performance timing measurements") print(" ๐ŸŽฏ Tool call tracking") print(" ๐Ÿ’พ State management with Firebase context") print(" ๐Ÿ”„ Interactive chat loop") print(" ๐ŸŒ MCP protocol compliance") print("\nโœจ Try these example queries:") examples = [ "List all Firestore collections", "Check Firebase health status", "Create a new document in the 'users' collection", "List all files in Firebase Storage", "Get user information for a specific UID", "Query documents in a collection with filters" ] for i, example in enumerate(examples, 1): print(f" {i}. {example}") print("\n" + "=" * 50) print("๐ŸŽฏ The standalone agent is completely self-contained!") print(" All dependencies are included in the single file.") print(" Perfect for deployment, testing, or standalone use.") print("=" * 50) # Ask if user wants to run the agent print("\n๐Ÿ’ก Would you like to start the interactive agent now? (y/n)") choice = input("> ").lower().strip() if choice in ['y', 'yes']: print("\n๐Ÿš€ Starting Standalone Firebase Agent...") print("(Use Ctrl+C to exit)") try: from firebase_admin_mcp.standalone_firebase_agent import run_standalone_firebase_agent run_standalone_firebase_agent() except KeyboardInterrupt: print("\n๐Ÿ‘‹ Demo completed!") except ImportError as e: print(f"โŒ Import error: {e}") print("Make sure you're running this from the Django project root.") except Exception as e: print(f"โŒ Error: {e}") else: print("๐Ÿ‘‹ Demo completed! Run the agent anytime using the methods above.") if __name__ == "__main__": demo_standalone_firebase_agent()

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/Highpolar-Softwares/django-firebase-mcp'

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