MCP Server
AgentWallie's MCP (Model Context Protocol) server enables AI agents to manage the entire paywall lifecycle programmatically. It wraps the REST API as MCP tools, so Claude Code, Cursor, or any MCP-compatible agent can create paywalls, configure campaigns, run experiments, and query analytics without leaving the terminal.
Quick Setup (3 Steps)
- Create a project -- get your API keys via curl or the dashboard
- Add the MCP server to your Claude Code or Cursor settings
- Start using tools -- ask the agent to list paywalls, create campaigns, etc.
Prerequisites
- Node.js 20+
- An AgentWallie account with API keys
The MCP server is available as an npm package — no need to clone the monorepo.
Step 1: Create a Project
Every app gets its own project with a pair of API keys: a public key (pk_...) for mobile SDKs and a private key (sk_...) for management API calls and the MCP server.
# If you already have a private key from another project:
curl -X POST https://agentwallie.com/api/v1/projects \
-H "Authorization: Bearer sk_your_existing_key" \
-H "Content-Type: application/json" \
-d '{"name": "My App"}'Response:
{
"id": "proj_abc123",
"name": "My App",
"apiKeys": [
{ "key": "pk_abc123...", "type": "public" },
{ "key": "sk_abc123...", "type": "private" }
]
}If you do not have an existing key, contact the AgentWallie team for initial access.
Step 2: Configure Your AI Agent
Claude Code
Add to your project's .claude/settings.json:
{
"mcpServers": {
"agentwallie": {
"command": "npx",
"args": ["-y", "@agentwallie/mcp-server"],
"env": {
"AGENTWALLIE_API_URL": "https://agentwallie.com/api",
"AGENTWALLIE_API_KEY": "sk_your_private_key"
}
}
}
}That's it — npx downloads and runs the server automatically. No cloning or building required.
Alternative -- local development (from monorepo):
{
"mcpServers": {
"agentwallie": {
"command": "npx",
"args": ["tsx", "/path/to/agentwallie/packages/mcp-server/src/index.ts"],
"env": {
"AGENTWALLIE_API_URL": "https://agentwallie.com/api",
"AGENTWALLIE_API_KEY": "sk_your_private_key"
}
}
}
}Cursor
Add to Cursor's MCP settings:
{
"mcpServers": {
"agentwallie": {
"command": "npx",
"args": ["-y", "@agentwallie/mcp-server"],
"env": {
"AGENTWALLIE_API_URL": "https://agentwallie.com/api",
"AGENTWALLIE_API_KEY": "sk_your_private_key"
}
}
}
}SSE Transport (Remote / Cloud)
For remote deployments or shared team servers, run the MCP server as an SSE endpoint:
export AGENTWALLIE_API_URL="https://agentwallie.com/api"
export AGENTWALLIE_API_KEY="sk_your_private_key"
export PORT=3002
npx tsx packages/mcp-server/src/index.ts --transport sseThe SSE server exposes:
GET /-- Health checkGET /sse-- SSE stream endpointPOST /message?sessionId=...-- JSON-RPC message endpoint
Step 3: Verify Connection
In Claude Code, ask:
"List my AgentWallie paywalls"
The agent should call agentwallie_list_paywalls and return your project's paywalls. If it works, you are connected.
Authentication
AgentWallie uses two types of API keys:
| Key Type | Prefix | Access Level | Where to Use |
|---|---|---|---|
| Private key | sk_... | Full management access | MCP server, dashboard, API clients, server-side code |
| Public key | pk_... | SDK-only access (config fetch + event posting) | iOS SDK, Android SDK, client-side code |
Never put the private key in client-side code. The public key is safe to embed in your mobile app -- it can only fetch configs and post events.
Available Tools
Paywall Management
agentwallie_create_paywall-- Create a new paywall from JSON schemaagentwallie_update_paywall-- Update paywall schema, name, or statusagentwallie_list_paywalls-- List all paywalls with statusagentwallie_get_paywall-- Get full paywall detail including schemaagentwallie_publish_paywall-- Publish a draft paywall to make it liveagentwallie_preview_paywall-- Generate an HTML preview URLagentwallie_duplicate_paywall-- Clone an existing paywallagentwallie_create_from_template-- Create a paywall from a built-in templateagentwallie_generate_paywall-- Generate a paywall from a natural language description
Campaign Management
agentwallie_create_campaign-- Create a new campaignagentwallie_update_campaign-- Update campaign name or statusagentwallie_list_campaigns-- List all campaignsagentwallie_get_campaign-- Get campaign detail with placements and audiencesagentwallie_toggle_campaign-- Activate or deactivate a campaign
Placement Management
agentwallie_add_placement-- Add a placement trigger to a campaignagentwallie_pause_placement-- Pause or resume a placementagentwallie_remove_placement-- Remove a placement from a campaignagentwallie_list_placements-- List all placements in a campaign
Audience Management
agentwallie_create_audience-- Create an audience with filter rulesagentwallie_update_audience-- Update audience filtersagentwallie_reorder_audiences-- Change audience priority orderagentwallie_delete_audience-- Delete an audience
Experiment Management
agentwallie_create_experiment-- Create an A/B test with variant splitsagentwallie_get_experiment_results-- Get results with statistical significanceagentwallie_promote_variant-- Promote the winning variant to 100%agentwallie_add_holdout-- Set a holdout percentage for measurementagentwallie_reset_experiment-- Reset experiment data and start over
Product Management
agentwallie_add_product-- Add an in-app purchase productagentwallie_list_products-- List all configured productsagentwallie_update_product-- Update product metadataagentwallie_sync_products-- Sync products from App Store Connectagentwallie_configure_asc-- Set up App Store Connect credentials
Analytics
agentwallie_get_overview-- Top-level project metrics (impressions, conversions, revenue)agentwallie_get_funnel-- Conversion funnel analysisagentwallie_get_revenue-- Revenue breakdown by product, period, or cohortagentwallie_query_analytics-- Flexible custom analytics queryagentwallie_get_paywall_analytics-- Per-paywall performance metrics
Agent Features
agentwallie_validate_config-- Validate the current project configurationagentwallie_dry_run-- Simulate placement evaluation for a given useragentwallie_get_changelog-- View config change historyagentwallie_diff_config-- Compare current config against a proposed changeagentwallie_generate_paywall-- AI-powered paywall generation from a descriptionagentwallie_suggest_experiments-- AI-powered experiment suggestions based on your dataagentwallie_migrate_from_superwall-- Import an existing Superwall configuration
Available Resources
MCP resources provide read-only access to project data and documentation:
| URI | Description |
|---|---|
agentwallie://project/{id}/config | Live compiled project configuration |
agentwallie://project/{id}/schema-spec | Paywall schema reference |
agentwallie://project/{id}/templates | Available paywall templates |
agentwallie://project/{id}/changelog | Recent configuration changes |
agentwallie://docs/api-reference | Full API documentation |
agentwallie://docs/quick-start | Step-by-step getting started guide |
agentwallie://docs/tools-reference | All MCP tools documented with parameters |
agentwallie://docs/component-types | Paywall component type reference |
agentwallie://docs/best-practices | Design and testing best practices |
Example Workflow
Here is a realistic example of how an agent uses the MCP tools to set up a paywall for a workout app:
User: "Add a paywall to the workout completion feature"
Agent calls:
1. agentwallie_generate_paywall
→ Creates paywall schema from the description
2. agentwallie_publish_paywall
→ Makes the paywall live
3. agentwallie_create_campaign
→ Creates "Workout Completion" campaign
4. agentwallie_add_placement
→ Adds "workout_completed" as a placement trigger
5. agentwallie_create_audience
→ Targets "Free Users" with subscription_status = free
6. agentwallie_create_experiment
→ Sets up A/B test at 100% traffic
7. agentwallie_dry_run
→ Simulates a free user hitting "workout_completed" to verify it worksThe entire flow -- from natural language request to a live, testable paywall with an A/B experiment -- happens in a single conversation.
The MCP server is a thin wrapper over the REST API. Every tool maps 1:1 to an API endpoint. If you can do it with curl, you can do it with MCP.
Troubleshooting
| Problem | Solution |
|---|---|
| "Tool not found" | Verify the MCP server path in your settings file. Make sure the path to index.ts or index.js is correct. |
| "Authentication failed" | Check that AGENTWALLIE_API_KEY is set to a private key (sk_...), not a public key. |
| "Config not found" | The project may not have any published paywalls or campaigns yet. Create and publish one first. |
| "Module not found" | If using the compiled dist/index.js, run cd packages/mcp-server && npm run build first. Or use the npx/tsx approach which requires no build step. |
| Agent does not see tools | Restart Claude Code or Cursor after changing MCP settings. Check that the server starts without errors by running it manually. |