PyMC Marketing MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MARKETING_MCP_API_KEY | No | API key required when the security profile is set to 'http-private-api-key'. | |
| MARKETING_MCP_INGEST_DIR | No | Directory where ingested datasets are stored. | |
| MARKETING_MCP_METADATA_DB | No | Path to the SQLite database for metadata, jobs, and credentials. | |
| MARKETING_MCP_ARTIFACT_DIR | No | Directory where model artifacts are stored. | |
| MARKETING_MCP_MAX_DATASET_MB | No | Maximum allowed dataset size in megabytes. | |
| MARKETING_MCP_SHARED_SQL_URL | No | Connection URL for the shared SQL database when using the shared_sql backend. | |
| MARKETING_MCP_SECURITY_PROFILE | No | Security profile to use (e.g., 'http-private-api-key', 'http-production-oauth'). | |
| MARKETING_MCP_PERSISTENCE_BACKEND | No | Persistence backend to use (e.g., 'sqlite' or 'shared_sql'). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| fit_purchase_modelA | Fit a Bayesian purchase/transaction frequency model (BG/NBD or Shifted Beta-Geometric). Normalizes user column names to canonical RFM attributes. |
| fit_value_modelC | Fit a Bayesian monetary value transaction model (Gamma-Gamma) on repeat customer spending. Requires frequency and average monetary value columns. |
| predict_expected_purchasesB | Predict expected future purchase counts per customer from a fitted purchase model (BG/NBD). |
| predict_probability_aliveB | Estimate probability of customer retention/alive from a fitted purchase or churn model. |
| predict_expected_spendA | Predict average transaction monetary spend per customer from a fitted Gamma-Gamma value model. |
| estimate_customer_lifetime_valueA | Estimate discounted net present Customer Lifetime Value (CLV) by combining a fitted purchase model (e.g. BG/NBD) and monetary value model (e.g. Gamma-Gamma). |
| fit_clv_modelA | Fit a Bayesian Customer Lifetime Value (CLV) model on RFM transaction data. (Deprecated: prefer fit_purchase_model or fit_value_model). |
| predict_customer_clvA | Generate per-customer CLV predictions from a fitted BG/NBD model. (Deprecated: prefer predict_expected_purchases or estimate_customer_lifetime_value). |
| get_churn_risk_cohortsA | Identify customers at churn risk from a fitted CLV model. Returns customers whose Bayesian P(alive) is below the specified threshold. Lower threshold = higher confidence of churn. Default threshold: 0.3. |
| compare_modelsA | Compare diagnostics, predictive metrics, and lineage across multiple fitted MMMs. |
| select_best_modelC | Compare multiple fitted MMMs using PSIS-LOO, WAIC, or Bayesian stacking weights via ArviZ. All models must be fitted on the same dataset. Returns ranked specifications, LOO/WAIC scores, and recommended model ID. Methods: loo (PSIS-LOO), waic (WAIC), stacking (BMA weights), all (run all three). |
| get_channel_contributionsA | Return posterior channel contribution summaries from the fitted PyMC-Marketing model. Does not fabricate estimates. |
| get_incremental_roasA | Return total and marginal iROAS from PyMC-Marketing's official incrementality API, including posterior uncertainty. No ad-hoc LLM ROAS calculation. |
| get_response_curvesB | Return response/saturation information sampled by PyMC-Marketing rather than raw posterior arrays. |
| simulate_budgetC | Evaluate the exact requested channel or dimension-cell scenario with posterior response sampling. Rejected models are blocked. |
| optimize_budgetC | Use PyMC-Marketing budget optimization under channel or dimension-cell constraints, then compare baseline and recommended posterior responses. Requires a diagnosed model. |
| recommend_next_measurementA | Recommend evidence-gathering options when model/data signals imply material uncertainty. It can explicitly return that no single experiment is implied. |
| optimize_flightingA | Optimize a dynamic weekly media flighting schedule over a planning horizon, accounting for adstock carryover dynamics, channel spend constraints, target iROAS floors, and profit-maximization objectives. The model must be approved or approved_with_caution before optimization. Returns a week-by-week spend table per channel, posterior response distribution, and net-profit estimates. |
| fit_mmmB | Fit a real Bayesian Marketing Mix Model with PyMC-Marketing using typed, controlled configuration. No arbitrary Python is accepted. Supports adstock types: geometric (default), delayed, weibull_cdf, weibull_pdf, binomial, none. Supports saturation types: logistic (default), tanh, tanh_baselined, michaelis_menten, hill, hill_sigmoid, inverse_scaled_logistic, log, root, none. Per-channel adstock/saturation overrides can be set via channel_priors. |
| get_model_statusB | Get persisted model fit state, lineage, and safe failure information. |
| diagnose_mmmA | Mandatory diagnostic gate. Checks sampler health plus posterior predictive coverage, predictive error, and residual behavior before decision tools may run. |
| cross_validate_mmmB | Run rolling Time-Slice Cross-Validation with PyMC-Marketing. Evaluates out-of-sample predictive RMSE/NRMSE across multiple temporal folds. |
| evaluate_prior_sensitivityA | Evaluate sensitivity of commercial conclusions (channel rank order and iROAS) under alternative adstock and saturation priors. |
| calibrate_mmmA | Calibrate an existing MMM using experimental lift test measurements. Produces a new calibrated model artifact linked via lineage. |
| archive_modelB | Archive a model record and update its lifecycle state. |
| get_posterior_plotsA | Generate posterior visualization plots from a fitted and approved MMM. Returns base64-encoded PNG/SVG images in the evidence envelope and caches them as MCP resources at marketing://models/{model_id}/plots/{plot_type}. Supported plot types: saturation_curves, waterfall_decomposition, actual_vs_predicted, channel_contribution_share. |
| register_datasetA | Register a local CSV or Parquet marketing dataset and return a stable dataset reference. |
| inspect_datasetA | Inspect a registered dataset before MMM configuration. Returns candidate targets, channels, controls, frequency, and data issues. |
| validate_datasetA | Run MMM-specific data quality, panel-shape, and identifiability checks. This must pass before fitting. |
| submit_fit_mmm_jobB | Submit an asynchronous MMM fitting job that executes in the background without blocking. |
| get_job_statusA | Retrieve the execution status, results, or error details of an asynchronous job. |
| cancel_jobA | Cancel a currently queued or running background job. |
| list_jobsC | List recent asynchronous background jobs for the active tenant. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 33 tools
Most tools target distinct actions, but several overlap: deprecated fit_clv_model and predict_customer_clv duplicate newer fit/predict tools, compare_models and select_best_model both compare fitted MMMs, and predict_probability_alive overlaps somewhat with get_churn_risk_cohorts. Descriptions do help clarify boundaries, so the set is usable but not sharply distinct.
The dominant pattern is consistent snake_case verb_noun (fit_, predict_, get_, optimize_, register_), which is easy to follow. Minor deviations exist, such as recommend_next_measurement, get_churn_risk_cohorts, and inconsistent use of the mmm suffix (fit_mmm vs get_channel_contributions), but the overall style remains predictable.
With 33 tools, this is a large surface and above the 25+ threshold that typically signals overload. The count is inflated by deprecated tools, separate synchronous/asynchronous fit paths, and many highly granular getter tools, making the set feel heavier than necessary even for a complex marketing analytics domain.
The toolset covers the main MMM lifecycle well: data registration, validation, fitting, diagnosis, cross-validation, calibration, comparison, budget optimization, plotting, and archival. CLV coverage also includes fitting, prediction, and churn risk. Minor gaps such as no generic model listing/deletion tool and no CLV-specific dataset validation are noticeable but workable.