MCP
The Affluent API MCP server lets AI coding assistants (Cursor, Claude Code, VS Code Copilot, and other MCP clients) read the live Agency API spec.
Use Affluent from an MCP client (Cursor, Claude Desktop, and other MCP-compatible agents).
The MCP server is not the Agency REST API. Tools, resources, and prompts are the contract. Discover them with tools/list, resources/list, and prompts/list. For REST request bodies, use the Agency API reference or the search_api_docs / get_api_endpoint tools.
Base URL
https://{agency}.affluent.io/api/mcp
Replace {agency} with the subdomain you use to log in. If you log in at https://acme.affluent.io, the MCP URL is https://acme.affluent.io/api/mcp.
This is the dashboard host, not {agency}-api.affluent.io. The REST API stays on the -api host.
| MCP | Agency REST API | |
|---|---|---|
| Host | https://{agency}.affluent.io/api/mcp | https://{agency}-api.affluent.io |
| Auth | Authorization: Bearer <mcp_token> | ?apiKey= (or the REST auth documented in the API reference) |
| Protocol | MCP over Streamable HTTP (POST) | HTTPS JSON |
| Contract | tools/list + JSON Schema | OpenAPI |
GET /api/mcp returns 405. Clients must POST.
Authentication
- In Affluent, create an MCP token (in the Affluent dashboard). The full token is shown once. Store it like a password.
- Send it on every request:
Authorization: Bearer <mcp_token>
Do not put MCP tokens in git, screenshots, or shared chats. Revoke a token if it leaks.
Advertiser Client and Support roles cannot connect. Use an agency user that can already use the dashboard.
Connect a client
Cursor
Add this to ~/.cursor/mcp.json (or the project .cursor/mcp.json):
{
"mcpServers": {
"affluent": {
"url": "https://YOUR_AGENCY.affluent.io/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_MCP_TOKEN"
}
}
}
}Restart Cursor (or reload MCP servers), then confirm tools from affluent appear.
Claude Desktop and other HTTP clients
Use the same URL and Bearer header. If the client only supports stdio, use an HTTP-to-stdio bridge, for example:
{
"mcpServers": {
"affluent": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://YOUR_AGENCY.affluent.io/api/mcp",
"--header",
"Authorization: Bearer YOUR_MCP_TOKEN"
]
}
}
}Replace the URL and token. Do not commit this file if it contains a real token.
What you can do
Ask the agent in natural language. Typical jobs:
- How-to (product UI): “How do I create a dashboard with a pie chart?”
- API shape: “What query params does GET /v1/actions/ take?”
- Performance data: “Top publishers by revenue last 30 days for brand X.”
For how-to questions, the agent should search Learn, read the article body, and cite the Learn URL. For API questions, it should look up the endpoint schema and not invent field names.
Tools
| Tool | Use it for | Arguments |
|---|---|---|
search_help_center | Find Agencies & Advertisers articles on Learn | query (string), optional limit |
fetch_help_article | Read the full article text | url — a https://learn.affluent.io/... URL from search |
search_api_docs | Search the Agency API spec on docs.affluent.io | query (string) |
get_api_endpoint | Full schema for one REST path | path (e.g. /v1/actions/), method (e.g. GET) |
run_custom_report_query | Affiliate performance numbers (warehouse) | See below |
Help tools only return Agencies & Advertisers content. Publisher Learn articles are not included.
get_api_endpoint returns documentation. It does not call the live Agency API. There is no tool that executes arbitrary REST requests.
run_custom_report_query
run_custom_report_query| Field | Required | Notes |
|---|---|---|
metrics | yes | Strings such as SUM(clickCount), AVG(revenue). Discover names via resources below. |
categories | no | Dimension names from the category schema. |
date_start | yes | Report period start (YYYY-MM-DD). |
date_end | yes | Report period end (YYYY-MM-DD). |
filters | no | { "field", "operator", "values" }. Operators: equals, notEquals, likeAny, notLikeAny. |
limit | no | Default 50. Maximum 200. |
This tool hits the reporting warehouse. Prefer resources to discover valid metric and category names before querying.
Resources
JSON at these URIs (pass a search term where {query} is shown):
| URI | What it is |
|---|---|
affluent://schema/metrics | Metric catalog |
affluent://schema/metrics/{query} | Metrics matching {query} |
affluent://schema/categories | Category catalog |
affluent://schema/categories/{query} | Categories matching {query} |
affluent://schema/compatibility/{query} | Which metrics work with which categories |
affluent://user/brands | Brands the token can see |
affluent://user/brands/{query} | Brands matching {query} |
affluent://user/accounts | Accounts the token can see |
Prompts
Optional starting prompts in the client:
| Prompt | Purpose |
|---|---|
answer-from-docs | Search Learn and API docs first, answer from that content, cite URLs |
custom-report-builder | How to assemble a custom report query |
publisher-revenue-comparison | Publisher revenue comparison |
top-brands-by-performance | Top brands |
top-clicks-by-country | Clicks by country |
top-publishers-by-revenue | Top publishers by revenue |
Limits
- MCP: 100 requests per minute per Bearer token.
run_custom_report_query:limit≤ 200 rows per call.- Agency REST date windows (when you use the REST API, not MCP): custom-report-style ranges are capped (Agency API: 62 days). Page large extracts; do not use MCP as a bulk dump.
If the client loops (retry storms), revoke the token.
When to use MCP vs the Agency API
| Job | Use |
|---|---|
| Ask how a dashboard / report / UI feature works | MCP help tools |
| Look up REST paths, params, and schemas | MCP API-docs tools, or OpenAPI on this site |
| Interactive performance questions | MCP run_custom_report_query |
| Bulk export or backfill (actions, large extracts) | Agency REST API (https://{agency}-api.affluent.io) |
| Writes, webhooks, or anything that is not an MCP tool | Agency REST API |
Do not map every REST endpoint 1:1 to an MCP tool. MCP is a small agent surface. REST remains the integration API.
Errors
| Symptom | What to check |
|---|---|
| 401 / auth failed | Token revoked, wrong header, or role cannot use MCP |
| 405 on GET | Client must POST to /api/mcp |
| Empty help results | Query may only match publisher articles; rephrase for agency/advertiser topics |
| Invalid metric / category | Read affluent://schema/metrics and affluent://schema/categories first |
| Report tool slow or expensive | Narrow dates, categories, and limit; don’t poll in a tight loop |
Agent instructions (optional)
If you maintain llms.txt or a system prompt, this is enough:
Affluent MCP: https://{agency}.affluent.io/api/mcp
Auth: Authorization: Bearer <mcp_token>
For product how-tos: search_help_center then fetch_help_article; cite learn.affluent.io URLs.
For REST fields: search_api_docs then get_api_endpoint; do not invent property names.
For performance numbers: discover metrics/categories via affluent://schema/* then run_custom_report_query.
Do not use MCP for bulk actions backfill; use the Agency REST API.
See also
- Agency API reference — OpenAPI for REST payloads
- Affluent Learn — Agencies & Advertisers how-tos
Updated 2 days ago
