---
name: push-provider-setup
description: Guide users through configuring FCM or APNs push providers in notification.dev, collecting missing information one step at a time and saving or replacing credentials through MCP. Use for server-side provider setup, not merely fetching SDK documentation.
---

# Push provider setup

Read `notification-platform` before workspace operations. This configures
server-side providers; app-side SDK setup uses `get_sdk_integration_guide`.
The SDK uses the public notification.dev project UUID, never provider secrets.

## Tools and access

Select an approved project with `list_projects`. All provider tools require
`credentials:manage` and an owner/admin role. Existing connections must authorize
this permission. If missing, explain reauthorization and stop retrying the tool.

| Tool               | Arguments                                   | Behavior                                                    |
| ------------------ | ------------------------------------------- | ----------------------------------------------------------- |
| `list_providers`   | `projectId`, optional `cursor`, `limit`     | List metadata; follow cursors to inspect all providers.     |
| `get_provider`     | `projectId`, `providerId`                   | Read provider metadata.                                     |
| `create_provider`  | `projectId`, `input`                        | Add a provider with supplied credentials.                   |
| `replace_provider` | `projectId`, `providerId`, complete `input` | Replace configuration and credentials, not a partial patch. |

Read tools never return credentials. Existing secrets cannot be recovered for
replacement. Writes validate credential format and encrypt secrets; they do not
prove provider authentication or delivery.

## Guided workflow

1. Inspect available app files to identify Android/iOS targets, Firebase
   configuration and bundle/application IDs. Ask about platforms only if unclear.
   Flutter and Expo apps may need both FCM and APNs.
2. Select the notification.dev project and inspect existing providers before
   writing. A Firebase project ID is different from the notification.dev UUID.
3. Ask **one question at a time** for the next missing item and explain where to
   find it. Reuse discovered or supplied values. Confirm the Firebase project
   matches the app and confirm the APNs environment.
4. Accept user-supplied credential files when the client can read them. Ask for a
   file rather than individual fields when it contains the required values;
   otherwise request fields one by one. Read only files supplied or specifically
   identified by the user for this setup.
5. Summarize the project, provider name/type and non-secret configuration before
   saving. A request to configure a new provider authorizes creation. Replace an
   existing provider only on an explicit request identifying it; explain that
   replacement affects future delivery. Ask if several providers could match.
6. Save and report provider ID and stored status without secrets. On an ambiguous
   creation timeout, list providers before retrying; ask if the result cannot be
   identified rather than creating duplicates. Do not repeatedly submit invalid
   credentials.

Never echo private keys, put them in app code or the repository, or include them
in summaries. Pass them only to the provider configuration tool. Do not promise
that the conversation or MCP client hides supplied credentials from its own
history. Offer dashboard entry/import when the user prefers not to supply secrets
to the agent.

## FCM

Use the app's Firebase project. Guide Firebase project settings → Service
accounts → Generate new private key, or reuse a suitable service-account key.
Ensure Cloud Messaging API v1 is enabled and the account can send messages in that
project. Follow the [Firebase authorization guide](https://firebase.google.com/docs/cloud-messaging/auth-server)
for current steps; do not request a legacy server key.

Extract `project_id`, `client_email` and `private_key` from the service-account
JSON and submit:

```json
{
  "provider": "fcm",
  "name": "Android FCM",
  "credentials": {
    "projectId": "<Firebase project_id>",
    "clientEmail": "<client_email>",
    "privateKey": "<private_key PEM>"
  }
}
```

`google-services.json` is app-side configuration, not a service-account key.
Configure it separately using the SDK guide, matching Firebase project and
Android application ID. Never embed the service-account key in the mobile app.

## APNs

Use an Apple APNs-enabled `.p8` key. Guide Apple Developer Certificates,
Identifiers & Profiles → Keys. Reuse an appropriate key or guide creation when
needed, obtaining its key ID and Apple team ID. Follow the
[Apple token-based connection guide](https://developer.apple.com/documentation/usernotifications/establishing-a-token-based-connection-to-apns)
for current key options; match environment/topic restrictions to the app.

Collect bundle ID, environment, team ID, key ID and private key, skipping known
values. Team/key IDs must each be 10 uppercase alphanumeric characters; the key
must be P-256 PEM. Ask for the `.p8` file when possible. Confirm sandbox for a
development-signed app or production for TestFlight/App Store distribution; do
not infer environment solely from a Debug/Release build name.

```json
{
  "provider": "apns",
  "name": "iOS APNs",
  "bundleId": "<app bundle ID>",
  "environment": "sandbox",
  "credentials": {
    "teamId": "<Apple team ID>",
    "keyId": "<APNs key ID>",
    "privateKey": "<contents of the .p8 file>"
  }
}
```

Configure app capabilities, entitlements and callback ownership using the
relevant iOS/Flutter/Expo SDK guide. The private key stays on the server.

## Verification

Fetch the relevant SDK guide for app setup and device verification. Check
registration, push token, OS permission, SDK opt-in and matching configuration on
a signed device. `configured: true` means stored configuration, not delivery.
Send a test notification only when requested, using the campaign workflow and
its permission/confirmation rules. Provider acceptance is not device receipt.
