nightjar-mcp-server
If you are the rightful owner of nightjar-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Nightjar MCP Server is a tool designed to analyze Adobe Launch/Tags implementations and embed codes, providing insights into rules, data elements, and variables.
Nightjar MCP Server
A Model Context Protocol (MCP) server for analyzing Adobe Launch/Tags implementations and embed codes.
Features
- Parse Adobe Launch embed codes to extract rules, data elements, and variables
- Analyze rules, data elements, and variables to understand their purpose and configuration
- Extract embed codes from website URLs
- AI-powered analysis of implementation components (with OpenAI API key)
- Works seamlessly with Claude Desktop and other MCP clients
Recent Fixes
- Enhanced Rule Parsing: Completely redesigned rule parsing logic using direct pattern matching to reliably extract rules from Adobe Launch embed codes.
- Robust Extraction Algorithm: Now uses targeted pattern recognition to find rules by their ID and name patterns, ensuring reliable extraction even with complex Launch configurations.
- Improved Data Capture: Better extraction of rule events, conditions, actions, and custom code.
- Enhanced Debugging: Added detailed logging for troubleshooting and diagnostics.
Installation
Quick Install
Run the installer script:
curl -sSL https://raw.githubusercontent.com/yourusername/nightjar-mcp-server/main/install.sh | bash
Manual Installation
Install the package globally:
npm install -g nightjar-mcp-server
Usage with Claude Desktop
After installation, the server will be registered in your Claude Desktop configuration.
- Restart Claude Desktop
- Ask Claude to analyze an Adobe Launch implementation:
- "Can you analyze this Adobe Launch embed code: https://assets.adobedtm.com/launch-..."
- "What rules are in this website's Adobe Launch implementation: https://example.com"
- "Analyze the 'addToCart' rule in this embed code: https://assets.adobedtm.com/launch-..."
Command Line Options
nightjar-mcp-server [options]
Options:
--openai-api-key <string> OpenAI API Key for AI-powered analysis
--debug Enable debug mode for verbose logging
--help Display help information
Tool Capabilities
The Nightjar MCP Server provides the following tools:
-
parse_embed_code - Parse an Adobe Launch embed code directly
- Input: Adobe Launch embed code URL (e.g., https://assets.adobedtm.com/launch-...)
-
parse_embed_from_url - Extract and parse an Adobe Launch embed code from a website URL
- Input: Website URL (e.g., https://www.example.com)
-
analyze_rule - Analyze a specific rule from the parsed embed code
- Input: Rule name, optional embed code, and AI analysis flag
-
analyze_data_element - Analyze a specific data element from the parsed embed code
- Input: Data element name, optional embed code, and AI analysis flag
-
analyze_variable - Analyze how an Adobe Analytics variable is used across rules
- Input: Variable name (e.g., eVar1, prop5, event10), optional embed code, and AI analysis flag
-
list_rules - List all rules found in the Adobe Launch embed code
- Input: Optional embed code
-
list_data_elements - List all data elements found in the Adobe Launch embed code
- Input: Optional embed code
-
list_variables - List all Adobe Analytics variables used in the Launch embed code
- Input: Optional embed code
Examples
Basic Usage
# Parse an embed code
parse_embed_code:
embed_code: "https://assets.adobedtm.com/launch-EN12345.min.js"
# Extract and parse from a URL
parse_embed_from_url:
url: "https://www.example.com"
# List all rules
list_rules:
# No parameters needed if you've already parsed an embed code
# Analyze a specific rule
analyze_rule:
rule_name: "pageLoad"
use_ai: true
Advanced Analysis with AI
For enhanced analysis using AI (requires OpenAI API key):
# Start the server with OpenAI API key
nightjar-mcp-server --openai-api-key YOUR_API_KEY
# Then in Claude, request AI-powered analysis
analyze_rule:
rule_name: "addToCart"
use_ai: true
Testing
To run the tests:
# Test rule extraction with the new approach
node extract-rules.js
# Test the updated NightjarClient implementation
node test-new-approach.js
# Run the original test script
node test-rule-analysis.js
Troubleshooting
If you encounter issues with rule parsing or other functionality:
- Run with debug mode:
nightjar-mcp-server --debug
- Check the logs for errors or warnings
- Verify that the embed code URL is valid and accessible
- Test with the included test scripts to verify functionality
Development
To contribute or customize:
- Clone the repository
- Install dependencies:
npm install
- Run tests:
npm test
- For debugging, use the dedicated test scripts
Technical Details
How Rule Parsing Works
The Nightjar MCP server extracts rules from Adobe Launch embed codes using a completely redesigned approach:
- Fetches the Launch file using the embed code URL
- Uses direct pattern matching to find rules by their ID and name patterns
- Extracts complete rule context for each matched rule
- Parses rule components (events, conditions, actions, etc.) from the context
- Creates a structured representation of the rules for analysis
This new approach is more robust and reliable than the previous method, which relied on complex string splitting and could easily break with different Launch configurations.
Architecture
The server consists of two main components:
- NightjarClient class: Handles parsing and analysis of Adobe Launch embed codes
- MCP server: Exposes Nightjar functionality through the Model Context Protocol
License
MIT