Send Firebase Cloud Messaging push notifications directly from your AI assistant. π
A powerful Model Context Protocol (MCP) server that enables AI assistants like Claude and Cursor to send push notifications via Firebase Cloud Messaging. Perfect for testing, automation, and AI-driven notification workflows.
- Why MCP FCM Push?
- Key Features
- Installation
- Quick Start
- Usage
- Parameters
- Project Structure
- How It Works
- Troubleshooting
- Security Notes
- Contributing
- License
- Acknowledgments
- β Manual notification testing is time-consuming
- β Complex OAuth 2.0 authentication setup
- β Need to switch between tools for notifications
- β Repetitive curl commands and JSON formatting
- β Difficult to automate notification workflows
- β Send notifications directly from your AI assistant
- β Automatic OAuth 2.0 authentication handling
- β Natural language interface - just ask
- β Clean, simple command structure
- β Easy integration with AI workflows
- π€ AI-Native Integration: Works seamlessly with Claude Desktop, Cursor, and other MCP-compatible AI assistants
- π Secure Authentication: Built-in OAuth 2.0 JWT authentication with Firebase service accounts
- π± Cross-Platform: Supports both iOS (APNS) and Android FCM delivery
- π Zero Configuration: Automatically reads project ID from service account
- π― Simple Interface: Natural language commands - no complex API calls
- π§ Flexible: Works with any Firebase project
- β‘ Fast: Direct FCM API integration with no intermediaries
git clone https://github.com/kibotu/mcp-fcm-push.git
cd mcp-fcm-pushcd mcp-server
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtPlace your service-account.json file in the cmd/ directory:
# Download from Firebase Console:
# Project Settings β Service Accounts β Generate New Private Key
cp ~/Downloads/service-account.json cmd/service-account.jsonAdd to ~/.cursor/mcp.json:
{
"mcpServers": {
"push-notification": {
"command": "/absolute/path/to/mcp-fcm-push/mcp-server/venv/bin/python",
"args": [
"/absolute/path/to/mcp-fcm-push/mcp-server/server.py"
]
}
}
}Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"push-notification": {
"command": "/absolute/path/to/mcp-fcm-push/mcp-server/venv/bin/python",
"args": [
"/absolute/path/to/mcp-fcm-push/mcp-server/server.py"
]
}
}
}Restart Cursor or Claude Desktop to load the MCP server.
Simply ask your AI assistant to send notifications using natural language:
Send a push notification with:
- FCM token: YOUR_FCM_DEVICE_TOKEN_HERE
- Title: New Message
- Body: You have a new message
- URL: https://example.com/notifications
Or be more direct:
Send me a test push notification to device token ABC123
with title "Hello World" and body "Testing FCM"
| Parameter | Type | Description |
|---|---|---|
fcm_token |
string | FCM device token from your mobile app |
title |
string | Notification title (displayed prominently) |
body |
string | Notification body text |
url |
string | Deep link or URL to open when tapped |
service_account_path |
string | Path to Firebase service account JSON |
| Parameter | Type | Default | Description |
|---|---|---|---|
badge |
integer | 100 |
Badge count for iOS notifications |
π‘ Tip: The project_id is automatically extracted from your service account JSON file, making this tool completely generic and reusable across different Firebase projects.
mcp-fcm-push/
βββ cmd/
β βββ push.sh # Bash script alternative
β βββ service-account.json # Firebase credentials (gitignored)
βββ mcp-server/
β βββ server.py # MCP server implementation
β βββ requirements.txt # Python dependencies
β βββ README.md # Technical documentation
β βββ venv/ # Virtual environment
βββ LICENSE # Apache 2.0 License
βββ README.md # This file
βββ SECURITY.md # Security policy
- Authentication: Reads Firebase service account credentials and extracts
project_id - JWT Generation: Creates a JSON Web Token for OAuth 2.0 authentication
- Token Signing: Signs the JWT using the private key from your service account
- Access Token: Exchanges the JWT for a short-lived access token from Google's OAuth endpoint
- FCM Request: Sends the notification payload to FCM API v1 with proper authentication
- Cross-Platform: Automatically configures for both Android FCM and iOS APNS delivery
- Response: Returns success confirmation or detailed error messages
- β Verify absolute paths in your MCP config file
- β Restart your editor after configuration changes
- β Check that Python virtual environment is properly set up
- β
Ensure all dependencies are installed:
pip install -r requirements.txt
- β
Confirm
service-account.jsonexists incmd/directory - β
Use full absolute path:
/Users/you/path/to/service-account.json - β
Check file permissions:
chmod 600 cmd/service-account.json
- β Verify FCM token matches the Firebase project in your service account
- β Check service account has "Firebase Cloud Messaging API Admin" role
- β Ensure the device token hasn't expired (mobile app may need to refresh)
- β Confirm Firebase Cloud Messaging API is enabled in Google Cloud Console
- β Validate service account JSON is properly formatted
- β Ensure service account has necessary permissions
- β
Check system has
opensslandcurlinstalled - β Verify internet connectivity for OAuth token exchange
Open an issue with:
- Your MCP config (remove sensitive paths)
- Error messages
- Python and OS versions
- π Never commit your
service-account.jsonto version control - π Set restrictive permissions:
chmod 600 cmd/service-account.json - π Use dedicated service accounts for different environments
- π Rotate service account keys regularly
- π Monitor Firebase usage for unexpected activity
- π Store credentials in secure locations only
- β Access tokens are valid for 1 hour only
- β Fresh token generated for each notification
- β No credentials stored in memory
- β Service account file only read when needed
Please review our Security Policy and report vulnerabilities privately to the maintainers.
We welcome contributions! Whether it's bug fixes, new features, documentation improvements, or spreading the word.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/mcp-fcm-push.git
cd mcp-fcm-push
# Set up development environment
cd mcp-server
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Make your changes and test
python server.py- π Improve documentation
- π Fix bugs or issues
- β¨ Add new features (batch notifications, templates, etc.)
- π§ͺ Add tests and CI/CD
- π Add examples and use cases
- π¨ Improve error messages
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2025 kibotu
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- Built with Model Context Protocol by Anthropic
- Powered by Firebase Cloud Messaging
- Inspired by the need for seamless AI-driven notification workflows
- Made with β€οΈ by kibotu
Happy Notifying! π If you find this tool useful, please β star the repository and share it with others!