@appsflyer/sdk-mcp-server
v1.5.2
Published
Node.js MCP server for AppsFlyer SDK integration
Downloads
1,250
Keywords
Readme
MCP AppsFlyer SDK Server
A robust Model Context Protocol (MCP) server for integrating, testing, and validating the AppsFlyer SDK in Android and iOS applications. This tool provides Android logcat analysis, iOS Xcode log validation, event detection, and automated checks to help ensure your AppsFlyer integration is correct and reliable.
Table of Contents
- MCP AppsFlyer SDK Server
Features
- Easy AppsFlyer SDK integration guidance
- Real-time logcat streaming and filtering for AppsFlyer logs
- Automated detection of key events: conversion, launch, in-app, and deep links
- Structured log output for analysis and debugging
- SDK validation: test your integration and event logging
- Error detection: scan for common AppsFlyer SDK errors
- Lightweight, modular, and scriptable
Prerequisites
- Node.js (v16+ recommended)
- TypeScript (
npx tscfor build) - For Android tools: Android SDK with
adbinstalled and accessible - For Android tools: At least one Android device (emulator or physical) connected via ADB
- For iOS tools: Xcode installed and access to Xcode console logs from an iOS app run
- For iOS tools: An iOS simulator or physical iOS device for running the app and collecting logs
- Model Context Protocol (MCP) compatible IDE (e.g., Copilot, Cursor)
Installation
Clone the repository:
git clone <repo-url> && cd mcp-AppsFlyer-sdkInstall dependencies:
npm installBuild the project:
npx tsc
Configuration
1. MCP Integration
Add the following to your mcp.json (in your IDE, e.g., Copilot/Cursor):
{
"AppsFlyer-mcp": {
"command": "ABSOLUTE/PATH/TO/node",
"args": ["ABSOLUTE/PATH/TO/appsflyer-sdk-mcp-server/dist/server.js"],
"cwd": ".",
"env": {
"DEV_KEY": "YOUR-DEV-KEY",
"APP_ID": "YOUR-APP-ID"
}
}
}Replace ABSOLUTE/PATH/TO/node with the absolute path to your Node.js executable, and replace ABSOLUTE/PATH/TO/appsflyer-sdk-mcp-server with the absolute path to this project directory.
2. Environment Variables
Set these values before running the server:
- Preferred: in your IDE MCP config (
mcp.json->env) as shown above. - Alternative: as OS environment variables in your shell.
Required variables:
- APP_ID: Your Android package name (for example:
com.example.app) or iOS app ID (for example:id123456789) - DEV_KEY: Your AppsFlyer Dev Key (required for Android and iOS validation and verification tools)
Usage
Running the Server
The server is designed to be launched by your MCP-compatible IDE. Once configured, it will start automatically when you invoke AppsFlyer-related commands or tools.
Available Tools & Commands
The server exposes the following tools organized by functionality:
SDK Integration Tools
| Tool Name | Description |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| integrateAppsFlyerSdk | Guides AppsFlyer SDK integration for Android or iOS, with platform-specific setup options and code instructions. |
| getAppsFlyerInAppEventRecommendations | Shows vertical-specific recommended AppsFlyer in-app events and parameters from the built-in catalog. |
| createAppsFlyerLogEvent | Generates Android Java code instructions for logging an in-app event with AppsFlyer. |
| createIosAppsFlyerLogEvent | Generates iOS Swift code instructions for logging an in-app event with AppsFlyer. |
Log Analysis Tools
| Tool Name | Description |
| -------------------- | --------------------------------------------------------------------------- |
| fetchAppsflyerLogs | Fetches recent Android logcat logs related to AppsFlyer. |
| getConversionLogs | Extracts Android conversion/install event logs from logcat. |
| getInAppLogs | Returns Android in-app event logs captured by AppsFlyer from logcat. |
| getLaunchLogs | Parses Android app launch/session events from logcat. |
| getDeepLinkLogs | Extracts Android deep link-related logs from logcat. |
| getAppsflyerErrors | Scans Android logcat for common AppsFlyer SDK errors and exceptions. |
Testing & Validation Tools
| Tool Name | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------ |
| verifyAppsFlyerSdk | Validates Android SDK integration by querying install data using appId, devKey, and device ID from logcat. |
| verifyAppsFlyerIosSdk | Validates iOS SDK integration using pasted Xcode logs and AppsFlyer install data. |
| verifyInAppEvent | Validates that a specific Android in-app event was triggered and sent by checking recent AppsFlyer logcat. |
| verifyIosInAppEvent | Validates that a specific iOS in-app event was triggered and sent using pasted Xcode logs. |
Deep Link Tools
| Tool Name | Description |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------- |
| createDeepLink | Guides Android AppsFlyer OneLink deep-link setup, including required manifest, URI scheme, and code steps. |
| createIosDeepLink | Guides iOS AppsFlyer OneLink deep-link setup, including Associated Domains, URL schemes, and Swift delegate steps. |
| guideDeepLinkTesting | Provides Android or iOS step-by-step testing instructions for deferred or direct deep links based on setup context. |
| verifyDeepLink | Validates Android deep-link handling from recent AppsFlyer logcat logs and confirms callback status. |
| verifyIosDeepLink | Validates iOS deep-link handling from pasted Xcode logs saved in ios-deeplink-logs.txt. |
Core Components
SDK Integration
The server provides comprehensive SDK integration support:
- Step-by-step integration guides with code examples
- Supports listener configuration: During integration, the tool asks whether you want to use a response listener and adjusts the steps accordingly.
- Event recommendation catalog: Choose an app vertical, then review recommended in-app events and parameter names before generating Android or iOS code.
- Event logging templates for common AppsFlyer events
- Best practices for SDK initialization and configuration
- Code generation for custom event implementations
Example Flow:
Ask: "How do I integrate AppsFlyer SDK?"
→ Get complete integration instructions with code examples
Ask: "Which in-app events should I track for a gaming app?"
→ Choose a vertical and get recommended event and parameter namesLog Analysis & Event Validation
Advanced log processing and event detection capabilities:
- Real-time log streaming from connected Android devices
- Intelligent filtering for AppsFlyer-related entries
- Event categorization (conversion, in-app, launch, deep links)
- Error pattern detection for common SDK issues
- Structured log output for easy analysis
Example Flow:
Ask: "Show recent AppsFlyer logs"
→ Get filtered, real-time logcat outputTesting & Validation
Comprehensive testing tools for SDK validation:
- SDK integration validation using AppsFlyer APIs
- Event logging verification with real-time feedback
- Error detection and diagnosis from log analysis
- Performance monitoring for SDK operations
Example Flow:
Ask: "Test AppsFlyer SDK"
→ Validate your integration against AppsFlyer servicesTroubleshooting
Common Issues
The items below primarily apply to Android tools that use ADB and logcat. iOS verification tools use pasted Xcode logs instead.
No devices found:
- Ensure your Android device is connected and
adb deviceslists it - Check USB debugging is enabled on your device
ADB not found:
Make sure the Android SDK is installed and adb is in the expected location:
- macOS:
~/Library/Android/sdk/platform-tools/adb - Linux:
~/Android/Sdk/platform-tools/adb - Windows:
%USERPROFILE%\AppData\Local\Android\Sdk\platform-tools\adb.exe
DEV_KEY not set:
- Set your AppsFlyer Dev Key in your environment or IDE configuration
- Verify the key is correctly formatted and active
APP_ID not set:
- Set your Android app ID in your environment or IDE configuration
- Verification requires APP_ID and will prompt for it if missing
Multiple devices:
- If more than one device is connected, specify the device ID when prompted
- Use
adb devicesto list available devices
Log output is empty:
- Make sure your app is running and generating AppsFlyer logs
- Check that AppsFlyer SDK is properly initialized in your app
- Verify log level settings in your app's AppsFlyer configuration
Contributing
Pull requests and issues are welcome! Please open an issue to discuss your proposed changes or feature requests.
Development Setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support & Reference
Documentation
Getting Help
- Create an issue for bug reports or feature requests
- Check the troubleshooting section above
- Review AppsFlyer's official documentation
