Get the FREE Ultimate OpenClaw Setup Guide →

django-firebase

A production-ready Django app implementing Firebase Model Context Protocol (MCP) server with 14 Firebase tools for AI agents. Features standalone agent, HTTP/stdio transport, LangChain integration, and complete Firebase service coverage (Auth, Firestore, Storage).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio raghavdasila-django-firebase-mcp python manage.py runserver 8001 \
  --env DEBUG="True" \
  --env MCP_HOST="127.0.0.1" \
  --env MCP_PORT="8001" \
  --env REDIS_URL="redis://localhost:6379" \
  --env USE_REDIS="true" \
  --env SECRET_KEY="your-secret-key-here" \
  --env MCP_TRANSPORT="http" \
  --env FIREBASE_STORAGE_BUCKET="your-project-id.appspot.com" \
  --env SERVICE_ACCOUNT_KEY_PATH="Path to your credentials.json (e.g., credentials.json)"

How to use

This Django-based Firebase MCP server exposes Firebase operations through the Model Context Protocol (MCP). It combines Django with Firebase Admin SDK to allow AI agents to interact with Firebase Authentication, Firestore, and Cloud Storage using a standardized MCP toolset. The server runs Django under port 8001 and exposes the MCP endpoint at /mcp/. Clients can send JSON-RPC requests to call specific tools such as firebase_verify_token, firestore_list_collections, or storage_upload_file. Use the provided tools list to understand available capabilities and craft requests that pass the required arguments. For testing, you can use the standalone agent or the Django server directly via HTTP; examples are included in the README under Quick Testing and the Tools sections. When integrated with an agent (e.g., LangChain), import ALL_FIREBASE_TOOLS and construct an agent that can discover and invoke these Firebase tools, enabling automated workflows against your Firebase project.

How to install

Prerequisites:\n- Python 3.11+\n- Firebase project with Admin SDK and credentials.json\n- Git (optional)\n- Redis (optional, for persistence)\n\n1) Clone the repository:\nbash\ngit clone https://github.com/your-repo/django-firebase-mcp.git\ncd django-firebase-mcp\n\n2) Create a virtual environment and install dependencies:\nbash\npython -m venv venv\nsource venv/bin/activate # On Windows use: venv\Scripts\activate\npip install -r requirements.txt\n\n3) Prepare Firebase credentials:\n- Enable Firebase services (Authentication, Firestore, Cloud Storage) in the Firebase Console.\n- Generate a service account key and save it as credentials.json at the project root.\nbash\n# credentials.json should be placed at project root or any path you reference in SERVICE_ACCOUNT_KEY_PATH\n\n4) Configure environment variables:\nCreate a .env file with essential settings:\nenv\n# Firebase Configuration\nSERVICE_ACCOUNT_KEY_PATH=credentials.json\nFIREBASE_STORAGE_BUCKET=your-project-id.appspot.com\n\n# MCP Configuration\nMCP_TRANSPORT=http\nMCP_HOST=127.0.0.1\nMCP_PORT=8001\n\n# Django Settings\nDEBUG=True\nSECRET_KEY=your-secret-key-here\n\n5) Optional Redis setup for state persistence (recommended in production):\nbash\n# Start Redis server (varies by OS) and ensure it is reachable at redis://localhost:6379\n# Then in .env:\nREDIS_URL=redis://localhost:6379\nUSE_REDIS=true\n\n6) Run migrations and start the server:\nbash\npython manage.py migrate\n# Run Django MCP server on port 8001\npython manage.py runserver 8001\n\n7) Verification:\n- Health: http://127.0.0.1:8001/mcp/\n- Test tool call via curl as shown in the README.\n

Additional notes

Tips and caveats:\n- Ensure credentials.json path is correct; a missing or invalid credentials file triggers authentication errors like Default app does not exist.\n- If the MCP server won’t start due to port conflicts, stop the other process using that port or change MCP_PORT.\n- Redis improves persistence across restarts; if not using Redis, the InMemorySaver stores only in-memory state during a session.\n- The toolset includes 14 Firebase tools across Authentication (4), Firestore (6), and Cloud Storage (4). Familiarize yourself with tool names to construct JSON-RPC requests (e.g., name: firestore_list_collections).\n- For production deployments, consider using the HTTP transport with proper reverse-proxy setup and TLS termination.\n- If running standalone for testing, you can invoke the standalone Firebase agent as described in the Quick Start.\n- When using LangChain or other agents, import ALL_FIREBASE_TOOLS to expose the full Firebase capability surface to your agent.

Related MCP Servers

Sponsor this space

Reach thousands of developers