A Model Context Protocol (MCP) server that integrates AB Tasty's Feature Experimentation & Rollouts platform with AI assistants. This server provides tools for feature flag management, campaign retrieval, and guided SDK integration through the MCP protocol.
-
Decision API Integration: Retrieve campaigns and feature flags for visitors
decision_api_get_campaigns: Get all campaigns for a visitor with contextdecision_api_get_campaign: Get a specific campaign by ID for a visitordecision_api_get_flags: Get all feature flags for a visitordecision_api_activate_campaign: Activate a campaign for a visitor
-
Resource Loader API: Extract and analyze campaign configurations (v0.2.0+)
resource_loader_api_load_webexp_resources: Load Web Experimentation & Personalization resources (use withwe_resource_extractorprompt)resource_loader_api_load_featexp_resources: Load Feature Experimentation & Rollout resources (use withfear_resource_extractorprompt)- Note: In v0.2.0, the Resource Loader API was split into platform-specific tools for better clarity
- Quick Start Guides: Interactive prompts for AB Tasty SDK installation
- Node.js SDK installation guide
- Resource Extractors: AI-powered resource configuration generators
we_resource_extractor: Converts natural language campaign briefs into Web Experimentation resource configurationsfear_resource_extractor: Converts natural language campaign briefs into Feature Experimentation resource configurations- These prompts generate the JSON needed for the Resource Loader API tools
- Documentation: Access to AB Tasty Feature Experimentation & Rollout documentation directly through MCP
- Node.js 18+
- npm or yarn
- AB Tasty credentials:
- Environment ID
- API Key
- (Optional) Account ID and token for Resource Loader features for Web Experimentation
- Clone the repository:
git clone https://github.com/flagship-io/mcp-server.git
cd mcp-server- Install dependencies:
yarn install- Build the project:
yarn buildThe easiest way to use the MCP server is through npx without any installation:
{
"mcpServers": {
"ABTasty": {
"command": "npx",
"args": [
"-y",
"@abtasty/mcp-server",
"--fear-env-id",
"YOUR_FEAR_ENV_ID",
"--fear-api-key",
"YOUR_FEAR_API_KEY",
"--resource-loader-fear-account-id",
"YOUR_FEAR_ACCOUNT_ID",
"--resource-loader-fear-account-environment-id",
"YOUR_FEAR_ACCOUNT_ENVIRONMENT_ID",
"--resource-loader-fear-rca-token",
"YOUR_FEAR_RCA_TOKEN",
"--resource-loader-we-account-id",
"YOUR_WE_ACCOUNT_ID",
"--resource-loader-we-token",
"YOUR_WE_TOKEN"
]
}
}
}Replace the placeholder values with your actual credentials:
YOUR_FEAR_ENV_ID: Your AB Tasty Feature Experimentation account environment IDYOUR_FEAR_API_KEY: Your AB Tasty Feature Experimentation API keyYOUR_FEAR_ACCOUNT_ID: Your AB Tasty Feature Experimentation Account IDYOUR_FEAR_ACCOUNT_ENVIRONMENT_ID: Your AB Tasty Feature Experimentation account Environment IDYOUR_FEAR_RCA_TOKEN: Your AB Tasty Feature Experimentation RCA TokenYOUR_WE_ACCOUNT_ID: Your AB Tasty Web Experimentation Account IDYOUR_WE_TOKEN: Your AB Tasty Web Experimentation token
Alternative: Environment Variables
You can also set credentials via environment variables instead of command-line arguments:
# Feature Experimentation & Rollout
export FEAR_ENV_ID="your_fear_env_id"
export FEAR_API_KEY="your_fear_api_key"
# Resource Loader - Feature Experimentation & Rollout
export RESOURCE_LOADER_FEAR_ACCOUNT_ID="your_fear_account_id"
export RESOURCE_LOADER_FEAR_ACCOUNT_ENVIRONMENT_ID="your_fear_account_environment_id"
export RESOURCE_LOADER_FEAR_RCA_TOKEN="your_fear_rca_token"
# Resource Loader - Web Experimentation & Personalization
export RESOURCE_LOADER_WE_ACCOUNT_ID="your_we_account_id"
export RESOURCE_LOADER_WE_TOKEN="your_we_token"Then use a simpler npx command:
{
"mcpServers": {
"ABTasty": {
"command": "npx",
"args": ["-y", "@abtasty/mcp-server"]
}
}
}Start the server on the default port (3000):
yarn startOr specify a custom port:
PORT=8080 yarn startThe server will be available at http://localhost:3000/mcp (or your custom port).
The server accepts configuration through HTTP headers for each session:
x-fear-env-id: Your AB Tasty Feature Experimentation & Rollout environment IDx-fear-api-key: Your AB Tasty Feature Experimentation & Rollout API key
For Web Experimentation & Personalization:
x-resource-loader-we-account-id: Your AB Tasty Web Experimentation account IDx-resource-loader-we-token: Your Web Experimentation resource loader authentication token
For Feature Experimentation & Rollout:
x-resource-loader-fear-account-id: Your AB Tasty Feature Experimentation & Rollout account IDx-resource-loader-fear-account-environment-id: Your AB Tasty Feature Experimentation & Rollout environment IDx-resource-loader-fear-rca-token: Your Feature Experimentation & Rollout (Remote Control API) resource loader authentication token
The server supports two modes of operation:
Use the npx command shown above for stdio-based MCP clients like Claude Desktop.
For HTTP-based clients, the server uses the Streamable HTTP transport protocol. Configure your MCP client to connect to the server endpoint:
{
"mcpServers": {
"ABTasty": {
"url": "http://localhost:3000/mcp",
"headers": {
"x-fear-env-id": "your_env_id",
"x-fear-api-key": "your_api_key"
}
}
}
}Once connected through an MCP client, you can use the available tools:
Get campaigns for a visitor:
decision_api_get_campaigns({
visitor_id: "user123",
context: {
age: 25,
country: "US"
},
trigger_hit: true
});Get feature flags:
decision_api_get_flags({
visitor_id: "user123",
context: {
age: 25,
country: "US"
},
trigger_hit: false
});Create and load Web Experimentation resources:
Step 1: Use the we_resource_extractor prompt to convert your campaign brief into a resource configuration:
User: Create an A/B test on https://example.com/pricing.
Show a red button for 50% of traffic.
Prompt Output:
{
"needs_clarification": false,
"questions": [],
"resources": [
{
"type": "campaign",
"$_ref": "c1",
"action": "create",
"payload": {...}
}
]
}
Step 2: Load the resources using the tool:
resource_loader_api_load_webexp_resources({
resourceLoaderContent: {
"needs_clarification": false,
"questions": [],
"resources": [...]
},
dryrun: false,
});Create and load Feature Experimentation resources:
Step 1: Use the fear_resource_extractor prompt to convert your campaign brief:
User: Create a feature flag 'new-checkout' for 25% of users
Prompt Output:
{
"version": 1,
"needs_clarification": false,
"questions": [],
"resources": [
{
"type": "project",
"$_ref": "p1",
"action": "create",
"payload": {...}
},
{
"type": "campaign",
"$_ref": "c1",
"action": "create",
"payload": {...}
}
]
}
Step 2: Load the resources using the tool:
resource_loader_api_load_featexp_resources({
resourceLoaderContent: {
"version": 1,
"needs_clarification": false,
"questions": [],
"resources": [...]
},
dryrun: false,
});├── src/
│ ├── index.ts # Main HTTP server entry point
│ ├── cli.ts # CLI entry point for stdio mode
│ ├── tools/ # MCP tool implementations
│ │ ├── decision-api.ts # Feature flag tools
│ │ └── resource-loader-api.ts
│ ├── prompts/ # Interactive prompt definitions
│ │ ├── quickstart-guide.ts
│ │ └── resource-loader-prompts.ts
│ └── resources/ # Resource providers
│ └── documentation.ts
├── helpers/ # Utility functions
│ ├── abtasty-fear.ts # AB Tasty Feature Experimentation SDK wrapper
│ └── resource-loader.ts # Campaign extraction utilities
├── types/ # TypeScript type definitions
├── assistant-prompts/ # Markdown prompt templates
└── build/ # Compiled output
# Generate prompt files
yarn generate:prompts
# Build the project
yarn build
# Build and run
yarn devThe build process:
- Generates TypeScript files from markdown prompts
- Bundles the application with esbuild
- Copies assistant prompt files to the build directory
yarn buildThe server maintains isolated sessions for each client connection:
- Each session has its own credentials (provided via headers)
- Sessions are identified by unique UUIDs
- Sessions are cleaned up when connections close
Uses the Streamable HTTP transport from the MCP SDK:
- Supports JSON-RPC 2.0 over HTTP
- Session-based connection management
- Automatic session initialization and cleanup
- Credentials are session-scoped and not shared between sessions
- Always use HTTPS in production environments
- Store credentials securely and never commit them to version control
Retrieves all campaigns for a visitor.
Parameters:
visitor_id(string): Unique visitor identifiercontext(object): Key-value pairs for targeting (optional)trigger_hit(boolean): Send analytics hit (default: false)
Returns: Array of campaigns with variations and modifications
Retrieves a specific campaign by its ID for a visitor.
Parameters:
visitor_id(string): Unique visitor identifiercampaign_id(string): Campaign ID to retrievecontext(object): Key-value pairs for targeting (optional)trigger_hit(boolean): Send analytics hit (default: false)
Returns: Campaign with variation and modifications
Retrieves all feature flags for a visitor.
Parameters:
visitor_id(string): Unique visitor identifiercontext(object): Key-value pairs for targeting (optional)trigger_hit(boolean): Send analytics hit (default: false)
Returns: Object with flag keys and their values
Activates a campaign for a visitor.
Parameters:
visitor_id(string): Unique visitor identifiervariation_group_id(string): Variation group ID to activatevariation_id(string): Variation ID to activate
Returns: Activation confirmation
Loads Web Experimentation & Personalization resources via the Resource Loader API.
Workflow: Use the we_resource_extractor prompt to generate the resourceLoaderContent from a natural language campaign brief, then pass it to this tool.
Parameters:
resourceLoaderContent(object): JSON containing resource loader content withneeds_clarification,questions, andresourcesarraydryrun(boolean): Whether to simulate the request without sending it
Returns: Loaded resources results
Loads Feature Experimentation & Rollout resources via the Resource Loader API.
Workflow: Use the fear_resource_extractor prompt to generate the resourceLoaderContent from a natural language campaign brief, then pass it to this tool.
Parameters:
resourceLoaderContent(object): JSON containing resource loader content withversion,needs_clarification,questions, andresourcesarraydryrun(boolean): Whether to simulate the request without sending it
Returns: Loaded resources results
- Check if port 3000 is already in use
- Verify Node.js version (18+ required)
- Ensure dependencies are installed:
yarn install
- Verify your environment ID and API key are correct
- Check that headers are properly set in your MCP client configuration
- Ensure credentials have the necessary permissions in AB Tasty
For issues related to:
- This MCP server: Open an issue on GitHub
- AB Tasty platform: Contact AB Tasty support
- MCP protocol: See Model Context Protocol documentation
- AB Tasty SDK: See AB Tasty SDK