home / mcp / django firebase mcp server
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).
Configuration
View docs{
"mcpServers": {
"highpolar-softwares-django-firebase-mcp": {
"url": "http://127.0.0.1:8001/mcp",
"headers": {
"DEBUG": "True",
"MCP_HOST": "127.0.0.1",
"MCP_PORT": "8001",
"MCP_TRANSPORT": "http",
"FIREBASE_STORAGE_BUCKET": "your-project.appspot.com",
"SERVICE_ACCOUNT_KEY_PATH": "credentials.json"
}
}
}
}You have a Django-based MCP server that exposes Firebase services (Authentication, Firestore, and Cloud Storage) through a standardized MCP interface. It lets you manage Firebase resources via AI agents and MCP clients, with both quick-start standalone usage and full Django integration for production-like setups.
Start with the MCP server to expose Firebase capabilities to your AI agents. You can run a lightweight HTTP endpoint for MCP clients or operate in stdio mode for local, agent-to-agent communication. Once the server is running, you can issue MCP requests to list, query, or modify Firebase resources such as users, documents, and storage files. Use the stand-alone agent for quick testing, then switch to the Django-based MCP server for full integration.
Follow these concrete steps to install and start using the MCP server in a Django environment.
# Prerequisites
Python 3.11+
Firebase project with Admin SDK
Git (optional)
Redis (optional, for persistent state management)
# 1. Clone the project
git clone https://github.com/your-repo/django-firebase-mcp.git
cd django-firebase-mcp
# 2. Install dependencies
pip install -r requirements.txt
# 3. Firebase setup - place credentials in project root as credentials.json
# Obtain credentials.json from Firebase Console > Project Settings > Service Accounts > Generate private key
# 4. Environment configuration - create a .env file with required values
# Example values (replace with your own):
SERVICE_ACCOUNT_KEY_PATH=credentials.json
FIREBASE_STORAGE_BUCKET=your-project-id.appspot.com
MCP_TRANSPORT=http
MCP_HOST=127.0.0.1
MCP_PORT=8001
DEBUG=True
SECRET_KEY=your-secret-key-here
# 5. State management choice
# A) Redis (recommended for production)
REDIS_URL=redis://localhost:6379
USE_REDIS=true
# B) InMemorySaver (for quick testing)
USE_REDIS=false4. Run the standalone Firebase agent for quick testing (optional but convenient):
# Start the standalone Firebase agent for quick testing
python firebase_admin_mcp/standalone_firebase_agent.py5. Run the full Django MCP server (choose one mode):
# Run MCP server via Django (HTTP/REST MCP endpoint)
python manage.py runserver 8001
# Or run MCP server in stdio mode for MCP clients
python manage.py run_mcp --transport stdio
# Or run MCP server in HTTP mode (explicit host/port)
python manage.py run_mcp --transport http --host 127.0.0.1 --port 8001After starting, access to the MCP endpoint is typically available at http://127.0.0.1:8001/mcp/. Use this URL for HTTP-based MCP clients. The stdio mode provides a local IPC channel suitable for tightly coupled agents.
Django migrations and superuser creation are optional but recommended for a full integration.
# Django setup (optional but recommended)
p python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 8001Verify Firebase ID tokens to authenticate requests against Firebase authentication.
Create custom Firebase authentication tokens for non-standard sign-in flows.
Retrieve user information by UID from Firebase Authentication.
Delete a Firebase Authentication user by UID.
List all Firestore collections in the project.
Create a new document in a Firestore collection.
Retrieve a Firestore document by path.
Update fields in an existing Firestore document.
Delete a Firestore document from a collection.
Query Firestore documents within a collection using filters.
List files stored in Cloud Storage with optional filters.
Upload a file to Cloud Storage.
Download a file from Cloud Storage.
Delete a file from Cloud Storage.