MCP server exposing adsat analytics functions as conversational tools
Project description
analytics-agents
MCP server that exposes adsat advertising analytics functions as conversational tools for Claude Desktop, Cowork, and any other MCP-compatible client.
Ask questions like "which of my campaigns are past saturation?" or "how should I reallocate my £2M budget across these campaigns?" — the server handles the tool calls; you get the results.
Requirements
- Python 3.9 or higher
adsat >= 0.5.0(installed automatically as a dependency)
Installation
pip install analytics-agents
If you are using Claude Desktop or Cowork, you will also need the SKILL.md orchestration
files. These tell Claude which tools to call, in what order, and how to interpret the results.
They are available in the skills/ directory of this repo.
Coming in a future release:
analytics-agents install-skills— a CLI command that will copy the bundled SKILL.md files directly to your skills directory. The SKILL.md files ship inside the pip package so that skill instructions and server are always on the same version. For now, copy the files fromskills/manually to your Claude skills directory.
Connecting to Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"analytics-agents": {
"command": "python",
"args": ["/path/to/analytics-agents/server.py"]
}
}
}
Replace /path/to/analytics-agents/ with the absolute path to the directory where you cloned or installed this repo.
The server runs as a local process on your machine — no cloud hosting, no API keys required.
Available tools
Currently available
| Tool | What it does |
|---|---|
analyse_campaign_saturation |
Fits saturation curves per campaign; returns saturation status, R², best model, and optional response curves |
optimise_budget |
Allocates a total budget across campaigns to maximise total outcome using SLSQP optimisation |
generate_report |
Produces a self-contained HTML report with all charts embedded as base64 PNG |
Planned
| Tool | What it does |
|---|---|
run_exploratory_analysis |
Full EDA suite — distributions, correlations, outliers, time-series plots |
run_model_diagnostics |
Six-panel residual diagnostics (normality, autocorrelation, Cook's D, heteroscedasticity) |
decompose_seasonality |
CMA-based seasonal decomposition; separates trend, seasonal, and residual components |
run_scenario_simulation |
Named what-if scenario comparison and sensitivity tables |
run_attribution |
Multi-touch attribution across 9 models (last-click, Shapley, Markov, and more) |
benchmark_campaigns |
Statistical benchmarking of campaign metrics against historical baselines with change-point detection |
Multi-agent orchestration
All tools — across all agents — are registered on the same server.py. A client like Claude
can see every tool at once and chain them across agents by reading the SKILL.md files and
calling tools in the right order.
Simple sequential workflows are handled this way without any additional framework:
SQL Agent (pulls data) → Campaign Saturation Agent → Budget Optimiser → Report
Each SKILL.md file contains a "Handoff conditions" section that tells Claude when to invoke another agent's tools — for example, handing off to the Seasonality Agent when a date column is present, or to the Diagnostics Agent when R² is below threshold.
LangGraph is not used in the current release (Campaign Saturation Agent only). It will be
evaluated and introduced when building the second agent. Multi-agent workflows are not always
linear — conditional branching across agents (e.g. re-run saturation on deseasonalised data
only if seasonality is detected) is too fragile to express reliably in SKILL.md. When
introduced, LangGraph slots into a dedicated orchestration/ layer only; server.py and
all tool contracts remain unchanged.
MCP client compatibility
The MCP server is not Claude-exclusive. MCP is an open protocol — any MCP-compatible client (Cursor, Continue, Zed, Claude Desktop, Cowork, Claude Code) can connect and call the tools.
What all clients get: the full tool set — analyse_campaign_saturation, optimise_budget,
generate_report, and all future tools. The tools are deterministic and return structured JSON
regardless of which client calls them.
What is currently Claude-only: the orchestration and quality layer — the two-round question flow before a run, the model quality gate (R², convergence status) before presenting results, the guardrail against using non-converged models for budget decisions, and the handoff suggestions to other agents. These behaviours live in the SKILL.md files, which are read by Claude only. A non-Claude client calling the tools directly gets correct results but none of this workflow intelligence.
The path to full client parity: once orchestration logic moves into the planned
orchestration/ module (targeted for the second agent), the workflow graph — including
quality gates, conditional branching, and guardrails — will live in code rather than in
SKILL.md. At that point, any client calling a composite tool (e.g. run_saturation_pipeline)
gets the same safeguards as a Claude user. The SKILL.md layer remains for Claude-specific
presentation and user-facing narrative; the correctness guarantees become client-agnostic.
Development
See CLAUDE.md for the full architectural context, agent inventory, tool contract specifications, and conventions for adding new tools or agents.
Quick start for local development:
git clone https://github.com/stefanobandera1/analytics-agents
cd analytics-agents
pip install -e ".[dev]"
python -m pytest tests/ -v
Links
- adsat package: github.com/stefanobandera1/adsat · pypi.org/project/adsat
- MCP protocol: modelcontextprotocol.io
- MCP community servers: github.com/modelcontextprotocol/servers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file analytics_agents-0.1.1.tar.gz.
File metadata
- Download URL: analytics_agents-0.1.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
739d5367e7fe24eaf8fd75257d20f51d80444f5936cb541621a2c24a20a975ef
|
|
| MD5 |
aed8510179ad1933c1d67466e0907560
|
|
| BLAKE2b-256 |
26783feb4b235899d31e7558f9d590f42edc678f1f025c2d6a32196a376dfcc1
|
Provenance
The following attestation bundles were made for analytics_agents-0.1.1.tar.gz:
Publisher:
publish.yml on stefanobandera1/analytics-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
analytics_agents-0.1.1.tar.gz -
Subject digest:
739d5367e7fe24eaf8fd75257d20f51d80444f5936cb541621a2c24a20a975ef - Sigstore transparency entry: 1180350126
- Sigstore integration time:
-
Permalink:
stefanobandera1/analytics-agents@8cd4ce74aa3356ca5423f181d120d01335ca51c1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/stefanobandera1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8cd4ce74aa3356ca5423f181d120d01335ca51c1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file analytics_agents-0.1.1-py3-none-any.whl.
File metadata
- Download URL: analytics_agents-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
709516e40d8c06cff0bc5e050e9c230b14a9e159e43cf51781eb6553b3c5fba6
|
|
| MD5 |
93f60335ea9e99c038e88a8836e8c272
|
|
| BLAKE2b-256 |
680b489b06ec6b4db00c4908dff86dc5b046e0d7e4b2dddb4c7f148d532e3434
|
Provenance
The following attestation bundles were made for analytics_agents-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on stefanobandera1/analytics-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
analytics_agents-0.1.1-py3-none-any.whl -
Subject digest:
709516e40d8c06cff0bc5e050e9c230b14a9e159e43cf51781eb6553b3c5fba6 - Sigstore transparency entry: 1180350133
- Sigstore integration time:
-
Permalink:
stefanobandera1/analytics-agents@8cd4ce74aa3356ca5423f181d120d01335ca51c1 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/stefanobandera1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8cd4ce74aa3356ca5423f181d120d01335ca51c1 -
Trigger Event:
push
-
Statement type: