# OneSignal MCP

> OneSignal MCP Server lets your AI client send, manage, and track push notifications for mobile and web apps. You can target specific user segments, check delivery metrics for any campaign, or list all registered player devices without touching the OneSignal dashboard. It gives your agent direct control over customer alerts.

## Overview
- **Category:** growth-engine
- **Price:** Free
- **Tags:** push-notifications, customer-engagement, in-app-messaging, audience-segmentation, message-automation

## Description

**OneSignal MCP Server**

Your agent gives you direct control over customer alerts for mobile and web apps. You don't have to open up the OneSignal dashboard; your AI client handles all the comms right from here. It lets your agent send, manage, and track push notifications without breaking a sweat.

**Sending and Scheduling Alerts**
You can create new pushes using `create_notification`, sending them immediately or scheduling them for a specific date later on. If you change your mind before it goes out, you've got `cancel_notification` to pull the plug on any push notification that was scheduled.

**Managing Your Audience and Devices**
You don't have to guess who gets the message; your agent lets you target specific groups. You can list every single registered user device using `list_players`, giving you a full roster of player IDs for the app. If you need details on one specific person, use `get_player` to pull up that player ID's metadata and status information. Conversely, if a player stops using your app or their record is bad data, you can clean things up by calling `delete_player`, which removes that specific device from the records.

**Monitoring Performance and Deliverability**It’s not enough to send it; you gotta know if it landed. Your agent runs `get_outcomes` to pull performance metrics, letting you see detailed analytics on how well your notifications did. You can also check campaign success and failure rates using the same tool. For a specific push notification that went out, `get_notification` lets you check its exact status and details just by its unique ID. If you want a list of every message recently sent for an app, run `list_notifications`. 

**Infrastructure Control**To see what apps are connected to your account, use `list_apps`, which requires the User Auth Key. Once you know which one it is, `get_app` lets you pull up all the full configuration details for that single specified OneSignal application. These tools give you total visibility into the backend setup.

This server gives your agent immediate access to core functions: creating and scheduling pushes; defining audience segments or individual players; pulling detailed analytics on performance metrics; listing every registered player device and inspecting their metadata; and managing all associated app configurations.

## Tools

### cancel_notification
Cancels a push notification that was previously scheduled for later.

### create_notification
Sends a new OneSignal push notification to users or segments.

### delete_player
Removes a specific registered device (player ID) from your app's records.

### get_app
Retrieves full configuration details for one specified OneSignal application. Requires the User Auth Key.

### get_notification
Checks the status and details of a specific notification by its ID.

### get_outcomes
Fetches performance data and outcomes metrics for your OneSignal application.

### get_player
Retrieves detailed metadata and status information for a specific player ID. Requires the User Auth Key.

### list_apps
Lists all OneSignal applications linked to your account. Requires the User Auth Key.

### list_notifications
Retrieves a list of recently sent notifications for a given app.

### list_players
Returns a full list of all registered user devices (player IDs) in the application.

## Prompt Examples

**Prompt:** 
```
Send a push notification to all subscribed users saying 'Flash Sale: 50% off today only!'
```

**Response:** 
```
Notification sent successfully! It is being delivered to the 'Subscribed Users' segment. Notification ID: 493021-abcd-1234.
```

**Prompt:** 
```
Check the delivery status of notification 550e8400-e29b-41d4-a716-446655440000.
```

**Response:** 
```
I've retrieved the metrics. The notification reached 1,250 devices with a 98% success rate. 25 deliveries failed due to unsubscribed users.
```

**Prompt:** 
```
List the last 5 registered devices for our app.
```

**Response:** 
```
I've fetched the latest device registrations. Here are the 5 most recent players, including their device types (iOS/Android) and last active timestamps.
```

## Capabilities

### Send Notifications
Creates and sends new push notifications, either immediately or on a scheduled date.

### Manage Audience Targeting
Sends messages only to defined user segments or specific player IDs.

### Check Delivery Metrics
Retrieves detailed analytics on notification performance, including success and failure rates.

### List Player Devices
Fetches a list of all registered user devices (players) associated with the app.

### Inspect Specific Players
Retrieves detailed metadata and status for one specific player ID or device record.

### Control App Infrastructure
Lists all associated OneSignal apps and gets configuration details for a single app.

## Use Cases

### Flash Sale Announcement
The marketing team needs to announce a flash sale across all platforms right now. They ask their agent: 'Send a high-priority notification saying 50% off until midnight.' The agent uses `create_notification` and specifies the target segment, ensuring zero delay.

### Debugging Failed Alerts
A user reports not receiving an alert. The support agent asks their agent to run a status check: 'Check notification ID 123.' The agent calls `get_notification` and returns the failure reason, telling the team exactly why it dropped.

### User Data Cleanup
The data governance officer spots hundreds of inactive player IDs. They ask their agent to list all players using `list_players`, filter out accounts dormant for 90 days, and then use `delete_player` on those records.

### Reviewing Past Performance
The product lead wants a quarterly performance snapshot. They ask their agent to fetch the metrics: 'Show me all campaign outcomes for Q3.' The agent runs `get_outcomes`, providing immediate, quantitative data.

## Benefits

- Send campaigns instantly: Instead of logging in to send a blast, just prompt your agent. Use `create_notification` to alert users about sales or updates immediately.
- Audit user activity: Need to know if User X got the announcement? Run `get_player` and then check delivery status with `get_notification`. You track it all.
- Precision targeting: Don't waste messages. Use audience segmentation when calling `create_notification` to ensure only 'Premium Users' get the specific offer.
- Clean up data debt: If a player account is abandoned, use `delete_player` to remove their device ID from your active list and keep records clean.
- Total visibility: Quickly check all app configurations using `list_apps`, or see aggregated performance reports by calling `get_outcomes`. No dashboard deep dives needed.

## How It Works

The bottom line is, you treat OneSignal like another set of tools in your agent's toolbox, running complex operations with simple conversation prompts.

1. Subscribe to the server, then enter your required credentials: your OneSignal REST API Key and App ID. If you need account-level actions, provide the User Auth Key.
2. Your AI client calls a specific tool (e.g., `create_notification`). The server validates the request against your stored keys.
3. The server executes the action on OneSignal's backend and returns the result—whether it's a successful notification ID or an error message.

## Frequently Asked Questions

**How do I send a notification to only certain users using create_notification?**
You specify the audience when calling `create_notification`. You can target specific segments or pass a list of player IDs to restrict delivery.

**What does get_outcomes do for my campaigns?**
`get_outcomes` retrieves overall performance data. It gives you high-level metrics on engagement and success across multiple notifications, helping you gauge general campaign health.

**Can I list all players using list_players to find an ID?**
Yes, `list_players` fetches a full roster of registered devices (player IDs). This list is useful for auditing or identifying users who need targeted communications.

**What if I want to stop a scheduled message? Should I use cancel_notification?**
Yes, `cancel_notification` handles this. You pass the notification ID and it removes the alert from the queue before it gets sent out.

**Is get_player enough to check if a user is active?**
`get_player` gives you device metadata, including last activity timestamps. This allows your agent to determine if the player record is stale or recently active.

**I need to manage my OneSignal accounts; what do I use with `list_apps` and `get_app`?**
You must provide the User Auth Key to list or get app details. This key grants access to your overall notification infrastructure configuration, letting you see all connected apps before managing settings.

**What is the correct process for removing a player's device using `delete_player`?**
Use `delete_player` when a user has permanently unsubscribed or if the device record is invalid. This action removes the specific registered device ID from your system, preventing future send errors.

**How can I check the exact delivery status of one notification using `get_notification`?**
The `get_notification` tool lets you fetch granular data for a single message ID. This provides detailed metrics—like success rates and failure reasons—for that specific campaign run.

**Can I target specific users instead of sending to everyone?**
Yes! Use the `create_notification` tool and provide a list of `include_player_ids`. This ensures the notification is only delivered to the specific devices you've identified.

**How can I check if a scheduled notification was actually sent?**
You can use the `get_notification` tool with the Notification ID. It will return real-time delivery metrics, including the number of successful deliveries and current status.

**Is it possible to manage multiple OneSignal apps?**
Yes. While the core operations use the primary App ID provided in credentials, you can use `list_apps` (requires User Auth Key) to see all your applications and their respective IDs.