Skip to content

About

πŸ”” Send Firebase Cloud Messaging push notifications directly from AI assistants like Claude and Cursor using Model Context Protocol (MCP). Zero-config OAuth 2.0, cross-platform support for iOS & Android.

Topics

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MCP FCM Push πŸ””

License Python MCP

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.

Table of Contents πŸ“‘

Why MCP FCM Push? πŸ€”

Common Problems

  • ❌ 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

MCP FCM Push Solutions

  • βœ… 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

Key Features 🌟

  • πŸ€– 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

Installation πŸ“¦

1. Clone the Repository

git clone https://github.com/kibotu/mcp-fcm-push.git
cd mcp-fcm-push

2. Set Up Virtual Environment

cd mcp-server
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Add Your Firebase Service Account

Place 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.json

⚠️ Security: Never commit your service account file to version control!

Quick Start πŸš€

Configure Your AI Assistant

For Cursor

Add 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"
      ]
    }
  }
}

For Claude Desktop

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 Your Editor

Restart Cursor or Claude Desktop to load the MCP server.

Usage πŸ’¬

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"

Parameters πŸ“‹

Required Parameters

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

Optional Parameters

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.

Project Structure πŸ“

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

How It Works πŸ”§

  1. Authentication: Reads Firebase service account credentials and extracts project_id
  2. JWT Generation: Creates a JSON Web Token for OAuth 2.0 authentication
  3. Token Signing: Signs the JWT using the private key from your service account
  4. Access Token: Exchanges the JWT for a short-lived access token from Google's OAuth endpoint
  5. FCM Request: Sends the notification payload to FCM API v1 with proper authentication
  6. Cross-Platform: Automatically configures for both Android FCM and iOS APNS delivery
  7. Response: Returns success confirmation or detailed error messages

Troubleshooting πŸ”

Server Not Showing Up?

  • βœ… 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

"No Such File" Error?

  • βœ… Confirm service-account.json exists in cmd/ directory
  • βœ… Use full absolute path: /Users/you/path/to/service-account.json
  • βœ… Check file permissions: chmod 600 cmd/service-account.json

Token Invalid?

  • βœ… 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

Authentication Errors?

  • βœ… Validate service account JSON is properly formatted
  • βœ… Ensure service account has necessary permissions
  • βœ… Check system has openssl and curl installed
  • βœ… Verify internet connectivity for OAuth token exchange

Still Having Issues?

Open an issue with:

  • Your MCP config (remove sensitive paths)
  • Error messages
  • Python and OS versions

Security Notes πŸ”’

Best Practices

  • πŸ” Never commit your service-account.json to 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

What's Protected

  • βœ… 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

Reporting Security Issues

Please review our Security Policy and report vulnerabilities privately to the maintainers.

Contributing 🀝

We welcome contributions! Whether it's bug fixes, new features, documentation improvements, or spreading the word.

How to Contribute

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# 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

Contribution Ideas

  • πŸ“ 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

License πŸ“„

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.

Acknowledgments πŸ™


Happy Notifying! πŸŽ‰ If you find this tool useful, please ⭐ star the repository and share it with others!

About

πŸ”” Send Firebase Cloud Messaging push notifications directly from AI assistants like Claude and Cursor using Model Context Protocol (MCP). Zero-config OAuth 2.0, cross-platform support for iOS & Android.

Topics

Resources

Code of conduct

Security policy

Stars

1 star

Watchers

0 watching

Forks

Sponsor this project

Contributors

Languages