Use Delivr from an AI agent
The short version
- The Delivr MCP server lets an AI agent work with your Delivr account through tools. Its URL is
https://api.delivr.ai/mcp. - It uses the Streamable HTTP transport. It keeps no session, so any request can reach any server.
- A person connects an agent with OAuth. The agent gets only the access the person approves, and never more than the person has.
- A backend job can use an organization API key instead. That path is read-only.
- Most tools are free. The tools in Tools that bill count toward your usage.
- The four lookup tools quote first. The first call returns a quote with the count and the price and runs nothing. The lookup runs only when the agent calls again with
confirmset to the quote'squote_id. See Quote, then confirm. get_rate_cardreturns the published prices for every meter. It is free.
Connect with OAuth
OAuth is the normal way to connect an agent that acts for a person. The person signs in to Delivr and approves a list of permissions. The agent never sees the person's password.
Claude
- In Claude, add a custom connector.
- Enter the URL
https://api.delivr.ai/mcp. - Select Connect. Claude opens the Delivr sign-in page.
- Sign in, review the permissions on the consent page, and approve.
Claude Desktop and the Claude mobile apps use the same connector as claude.ai.
Claude Code
Run this command:
claude mcp add --transport http delivr https://api.delivr.ai/mcpThen run /mcp in Claude Code and select delivr to sign in. Claude Code opens a browser for the consent page.
Codex
Run these commands:
codex mcp add delivr --url https://api.delivr.ai/mcp
codex mcp login delivrcodex mcp login opens a browser for the consent page. The Codex CLI, the Codex IDE extension and the ChatGPT desktop app share this configuration.
Cursor
Cursor connects with an organization API key today, so a Cursor connection is read-only. Cursor's OAuth needs dynamic client registration, and this server does not offer it. See Connect Cursor with an API key.
Other clients
Any MCP client that supports OAuth 2.1 with PKCE can connect. The server does not offer dynamic client registration. A client identifies itself with a Client ID Metadata Document: its client_id is an HTTPS URL that returns the client's metadata. The server advertises this with client_id_metadata_document_supported.
A client finds the rest by itself:
- Send a request to
https://api.delivr.ai/mcpwithout a credential. The server answers401with aWWW-Authenticateheader. The header holds aresource_metadataURL. - Read the protected resource document at
https://api.delivr.ai/.well-known/oauth-protected-resource/mcp(RFC 9728). It names the authorization serverhttps://auth.delivr.aiand listsscopes_supported. - Read the authorization server document at
https://auth.delivr.ai/.well-known/oauth-authorization-server(RFC 8414). It lists the authorization, token, and revocation endpoints. - Send the person to the authorization endpoint with the
coderesponse type and a PKCE challenge. Only theS256method is accepted. Name the scopes you need inscope. A request with no scope is refused. - Exchange the code at the token endpoint. Send the PKCE verifier.
- Send the access token on each MCP request as
Authorization: Bearer <token>.
| Setting | Value |
|---|---|
| Issuer | https://auth.delivr.ai |
| Grant types | authorization_code, refresh_token |
| PKCE | S256 only |
| Token endpoint authentication | none, client_secret_basic, client_secret_post |
| Resource | https://api.delivr.ai/mcp |
Tokens
An access token lasts 15 minutes. It is a signed JWT. Use the refresh token to get a new access token without a new sign-in. Refresh tokens are opaque and can be revoked.
To end a grant from code, send the token to the revocation endpoint (RFC 7009). An access token that was already issued works until it expires.
Permissions
The consent page lists the permissions the agent asks for. Each permission is a scope, such as audiences:read or audiences:write. The scopes_supported list in the discovery documents is the full set.
- The agent can do only what the person approved. A tool the agent has no scope for is refused.
- The agent can never do more than the person can do in the dashboard. Delivr applies the person's own memberships to every call.
- The scopes are fixed when the person approves. If you add a tool that needs a new scope, the person must reconnect and approve again.
- Some actions are never open to an agent, such as launching a campaign or adding a connection that needs credentials. The person does these in the dashboard.
Disconnect an agent
- In the dashboard, open Account > Apps.
- Find the agent under Connected agents. The row shows what it can see and change, and when it was last used.
- Select Disconnect and confirm.
Connect with an API key
A backend job with no person present can send an organization API key in the X-Api-Key header. Do not send it as a bearer token.
If the key requires its secret, send the secret in the X-Api-Secret header too. New keys require it by default. A key that requires its secret and arrives without it gets a 401 with api secret is required for this key. A secret that does not match the key gets a 401 with api secret does not match this key, even when the key does not require one. See Authentication for the key and secret pair.
curl -sS https://api.delivr.ai/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H "X-Api-Key: $DELIVR_API_KEY" \
-H "X-Api-Secret: $DELIVR_API_SECRET" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'An API key carries the identity:read and audiences:read scopes only. It cannot change anything. It cannot call a tool that needs another scope. Use OAuth for those tools.
A client must run the initialize handshake before any tools/call.
The four lookup tools need a person's OAuth connection, so an API key does not see them. With an API key, use the REST dry_run in See the count before you spend to price a lookup.
Connect Cursor with an API key
Put the key and secret in your environment as DELIVR_API_KEY and DELIVR_API_SECRET. Then add the server to ~/.cursor/mcp.json:
{
"mcpServers": {
"delivr": {
"url": "https://api.delivr.ai/mcp",
"headers": {
"X-Api-Key": "${env:DELIVR_API_KEY}",
"X-Api-Secret": "${env:DELIVR_API_SECRET}"
}
}
}
}This connection is read-only, like any API key connection. To change things or run a lookup from an agent, connect Claude, Claude Code or Codex with OAuth.
Start with these tools
After an OAuth connection:
- Call
whoamito see which identity the credential resolves to. An OAuth connection reportskindasagent. - Call
list_workspacesto list the projects the person can reach. Most tools need aproject_id. - Call
list_audiencesorget_audienceto read audiences.
The server returns its full tool list in response to tools/list.
The tools
The server offers these tools today. A client sees only the tools its credential can use, so an API key sees fewer. The tools/list response is the authority.
| Area | Tools |
|---|---|
| Account and help | whoami, list_workspaces, get_workspace_inventory, get_my_profile, list_announcements, search_help_articles, read_help_article, file_support_ticket |
| Projects, pixels and domains | create_project, update_project, create_pixel, get_pixel_install_code, check_pixel_events, list_data_sources, list_domains, add_domain, verify_domain, activate_pixel_domain |
| Site visitors and events | get_resolution_statistics, list_website_visitors, query_events, list_event_fields |
| People and intent lookup | look_up_person, look_up_people, look_up_person_intent, look_up_company_intent, list_companies_researching, get_people_coverage |
| Topics and fields | list_topics, get_topic, get_topic_activity, list_topic_categories, request_topic, draft_topic_request, list_topic_requests, list_fields, get_field |
| Audiences | list_audiences, get_audience, get_audience_size, get_audience_sample, check_audience_readiness, create_audience, create_audience_plan, create_lookalike_audience, update_audience, update_audience_state, delete_audience, get_audience_records, get_audience_signals, get_audience_signals_history, get_audience_topic_profile, get_audience_signal_members, get_fit_rubric, update_fit_rubric, clear_fit_rubric |
| Lists and datasets | list_lists, get_list_values, create_list, add_list_values, remove_list_values, delete_list, list_datasets, get_dataset, get_dataset_import, create_dataset, start_dataset_upload, import_dataset_file, delete_dataset |
| Exports and integrations | list_exports, create_file_export, create_dsp_export, create_webhook_export, update_export, update_export_state, delete_export, get_export_run, list_export_runs, list_export_destinations, add_export_destination, update_export_destination, list_integrations, get_integration_syncs, update_integration, test_integration, create_email_integration |
| Delivr DSP campaigns | list_campaigns, get_campaign, get_campaign_performance, get_campaign_breakdown, get_campaign_site_visits, get_campaigns_summary, list_creatives, check_campaign_setup, list_campaign_options, create_campaign, update_campaign, update_campaign_state, archive_campaign |
| Usage, billing and budgets | get_rate_card, get_usage, get_usage_by_project, get_api_usage, get_subscription, list_invoices, get_usage_limits, get_organization_budget, set_organization_budget, remove_organization_budget, list_project_budgets, get_project_budget, set_project_budget, remove_project_budget |
| Team and settings | list_members, list_roles, find_user, invite_members, update_invitation, update_member, remove_member, list_api_keys, revoke_api_key, delete_api_client, get_brand, update_brand, get_notification_preferences, update_notification_preferences, get_project_notifications, update_project_notifications, list_scheduled_reports, delete_scheduled_report |
request_topic asks Delivr to track a subject that list_topics does not have. Send one sentence as idea, or a full name, description and type. The tool waits up to a minute for the verdict and returns a status. approved and already_tracked carry a topic_id when the topic is ready to use, and you can pass it to create_audience. If there is no topic_id, follow the message and find the topic with list_topics first. in_review means the verdict has not arrived yet, so check list_topic_requests later. A new topic collects intent from the day it is published, so an audience built on it starts empty and fills over the following days. Delivr can rename a topic at approval. list_topic_requests returns each request's current name and the requested_name you submitted.
create_campaign saves a draft only. A person adds the creatives and launches the campaign in the dashboard.
create_email_integration adds an email connection, and create_file_export can then deliver to it. When the connection is added, its recipients must be you or active members of your organization. A person adds every other kind of connection in the dashboard under Connections. The tool needs the email_connections:write scope, so an agent connected before this tool existed must reconnect and approve it.
Build in parts
A buyer often asks for an audience that names people, companies and a subject they research, such as "marketing leaders at SaaS companies researching CDPs". The dashboard builder makes this in three parts, and an agent follows the same order:
- A persona for who the people are.
- An account for which companies. In the dashboard this is a company list. In the API its kind is
account. - The intent audience that references both, and adds the topics the people research.
See Understanding segmentation types for what each type holds.
Plan or single audience
- Call
create_audience_planwhen a request names two or more of people, companies and a researched subject. - Call
create_audiencefor one part, or for an audience the person wants to keep as a one-off.
create_audience_plan takes a persona, an account and an audience. The audience needs a name. It adds intent when the people research a subject, and without intent it is a contact audience of the people in the persona and account. For a persona or an account, send either a saved part's audience_id or a new part's name and rules. Find saved parts with list_audiences. A person's OAuth connection is required. An API key cannot call it.
Call create_lookalike_audience for people like a saved audience, such as website visitors or a customer list. Find the seed with list_audiences. A company audience cannot be a seed. Building a lookalike is free, so it is not in Tools that bill. Set preview to see the seed, how many of its people were measured, the topic count and any notices, with nothing created. A person's OAuth connection is required.
Reuse and preview
- Delivr reuses a saved persona or account that has the same rules. It does not create it again. When the person names a saved part, the agent sends its
audience_id. - A new part whose name a saved part already has gets a number after it, such as
Marketing leaders (2). - Call with
previewset totrueto see each part and the estimated size. A preview is free and creates nothing.
A preview lists each part with its action, create or reuse. This one reuses a persona and creates an account and the audience:
{
"saved": false,
"creates": 2,
"reuses": 1,
"parts": [
{ "slot": "persona", "action": "reuse", "name": "Marketing leaders", "audience_id": 101 },
{ "slot": "account", "action": "create", "name": "SaaS companies" },
{ "slot": "audience", "action": "create", "name": "Marketing leaders at SaaS researching CDPs" }
],
"estimate": { "supported": false, "reason": "sized without some conditions", "upper_bound": { "reach": 1200 } },
"notices": ["..."]
}When estimate carries an upper_bound, its reach is a ceiling: the real audience can build smaller, and reason says why. Otherwise estimate.reach is the size. notices hold the warnings the person sees before approving. One example is "Without a job title rule, an audience like this mostly selects people in the wrong roles." The agent passes these on.
Approve, build and failure
- One approval creates only the parts that are missing, persona first, then account, then the audience over them.
- The audience starts building as soon as it is created, so its
statusis not yet finished. Callcheck_audience_readinessto see when it is built. - If a step fails, Delivr deletes the parts that call created and reports it. It never deletes a reused part. If a deletion fails, the error names the part so the agent can call
delete_audience.
Tools that bill
These tools count toward your usage. They bill on the same meters as the API, at the rates on your order form. Every other tool is free. To read the published prices, call get_rate_card.
| Tool | What counts | Meter |
|---|---|---|
look_up_person, look_up_people | Each person found. A person not found is free. Quotes first and bills only on confirm. | Contact Records |
look_up_person_intent, look_up_company_intent | Each person or company that returns at least one topic after your topic and strength filters. A match with no topics left is free. Quotes first and bills only on confirm. | Intent Signals |
list_companies_researching | Each company on a page. The call without page_size or cursor is a free preview. | Intent Signals |
list_website_visitors | Each visitor returned, at the tier you ask for | Resolution, at that tier |
query_events | Each row returned, at the tier you ask for | Events / Journey, or Resolution at that tier |
get_audience_records | Each record returned. A record read again on the same UTC day is free. | The audience's own rate |
get_audience_signals, get_audience_signals_history, get_audience_topic_profile, get_audience_signal_members | Each top company, row or member returned. The history counts one record per answer. A repeat read of the same answer is free. | Predictive Signals |
create_file_export, create_webhook_export | Each export run delivers people out of Delivr, and each run bills | The export's meter |
create_dsp_export | An audience or event list sent to DelivrDSP is not billed as data. An audience sent to The Trade Desk bills nothing per run. Delivr bills $2.00 per 1,000 impressions The Trade Desk serves on the audience, or the rate in your agreement. Partner data the audience uses still bills each run. | None per run |
update_export_state | A resume or a run that delivers bills like any other run | The export's meter |
For the exact rules of each meter, see What gets billed. If a budget or a cap stops a charge, the tool refuses and tells the agent why. Nothing is billed for a refused call. To cap spend, set a project budget.
Quote, then confirm
look_up_person, look_up_people, look_up_person_intent and look_up_company_intent never bill on the first call.
- The agent calls the tool without
confirm. Delivr counts the records and runs nothing. Nothing is billed. - The tool returns a
quote. It holdsbillable_count,meter,unit_price,totalin US dollars,rate_band,quote_idandexpires_at.look_up_peoplealso returnsfield_coverage. - The agent shows the quote to the person.
- If the person agrees, the agent calls the same tool again. It sends the same arguments and sets
confirmto thequote_id. - Delivr counts again. If the quote still holds, the lookup runs and bills.
The tool refuses the confirm, runs nothing and returns a new quote in these cases:
- The billable count or the price has risen since the quote.
- The quote was for another organization or project than the call now acts in.
- The quote has expired. A quote lasts 15 minutes.
A quote for other arguments or another tool is refused too. The agent then calls again without confirm to get a quote for this call.
The total is priced at the published bands as if this were your first usage this billing period. Your actual charge is this amount or lower.
See the count before you spend
Each call below shows a count first and bills nothing:
| You want | Use | What you get |
|---|---|---|
| The cost of an identity lookup from an agent | look_up_person or look_up_people without confirm | A quote: the billable count and the price, plus field coverage from look_up_people. Nothing runs. |
| The cost of an intent lookup from an agent | look_up_person_intent or look_up_company_intent without confirm | A quote: the billable count and the price. Nothing runs. |
| The published prices | get_rate_card | Each meter's price per 1,000 records, by volume band and by plan. |
| The cost of an identity lookup over REST | POST /api/v1/lookup/batch with "dry_run": true, or ?dry_run=true on either lookup route | The billable count, estimated_cost, and field coverage. Nothing is billed. Up to 1,000 keys per call. |
| The cost of an intent lookup over REST | POST /api/v1/intent/batch with "dry_run": true | The billable count and estimated_cost. Nothing is billed. |
| The size of an audience before you save it | create_audience with preview set to true | The estimated size. Nothing is created. |
| The parts and size of an audience built from people, companies and a subject | create_audience_plan with preview set to true | Each part as create or reuse, the estimated size and any notices. Nothing is created. |
| The companies researching a topic | list_companies_researching without page_size | The strongest few companies and the match count. Nothing is billed. |
| A look at the people in an audience | get_audience_sample | A capped sample of people, masked to company, department and seniority band, with field coverage. Nothing is billed. |
The REST dry_run calls use your API key and secret, so they work from an API key connection such as Cursor. An agent that can run commands, such as Claude Code, can send them. The identity lookup takes dry_run in the body or in the query string. These two calls are the same request:
curl -X POST "https://api.delivr.ai/api/v1/lookup/batch" \
-H "X-Api-Key: $DELIVR_API_KEY" \
-H "X-Api-Secret: $DELIVR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"keys": [{"email": "[email protected]"}, {"email": "[email protected]"}], "dry_run": true}'curl -X POST "https://api.delivr.ai/api/v1/lookup/batch?dry_run=true" \
-H "X-Api-Key: $DELIVR_API_KEY" \
-H "X-Api-Secret: $DELIVR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"keys": [{"email": "[email protected]"}, {"email": "[email protected]"}]}'See Predict cost before you spend for the response.
Example prompts by lane
Each prompt below works today. The third column shows the tools the agent calls. Replace the names in the prompts with your own.
| You are | Say to your agent | The agent calls | Bills |
|---|---|---|---|
| A brand checking its site | "Is the pixel on example.com sending events?" | list_workspaces, check_pixel_events | No |
| A brand checking its site | "How many people did we name on example.com last week, and out of how many visitors?" | get_resolution_statistics | No |
| A brand checking its site | "Who visited example.com yesterday? Use the cheapest tier that has names." | list_event_fields, list_website_visitors | Yes, per visitor |
| A champion reporting to finance | "What did we use this month, by meter?" | get_usage | No |
| A champion reporting to finance | "Show our invoices for this year." | list_invoices | No |
| An agency | "How many people matched in the list we uploaded for our client?" | list_lists | No |
| An agency | "Build an audience of marketing directors at US retailers researching CRM software. Show me its size before you save it." | list_topics, list_audiences, create_audience_plan with preview | No |
| A brand or an agency | "Find people like my pricing page visitors. Show me what it would target first." | list_audiences, create_lookalike_audience with preview | No. Building a lookalike is free. Its records bill when downloaded or exported. |
| A builder | "What would it cost to look up the 800 emails in customers.csv?" | The REST lookup dry_run | No |
| A builder | "What is jane@acme.com researching?" | look_up_person_intent | Quotes first, bills on confirm |
| A builder | "Which companies are researching data warehouse software?" | list_topics, list_companies_researching (preview) | No |
| A Delivr DSP buyer | "How did campaign 1234 perform last week?" | get_campaign_performance | No |
| A Delivr DSP buyer | "Draft a campaign to my in-market CFO audience for 30 days." | list_audiences, list_campaign_options, create_campaign | No. A person launches it. |
get_resolution_statistics reports counts and rates for the project's own site, not names. A list shows a match count only after Delivr has measured it. If it has not, the agent reports the count as not available.
An agent session: price a list, then run it
This session uses Claude Code with your API key and secret in DELIVR_API_KEY and DELIVR_API_SECRET. The file has 800 emails, so one batch call holds it.
-
You say: "What would it cost to look up the 800 emails in customers.csv?"
-
The agent sends the emails to
POST /api/v1/lookup/batchwith"dry_run": true. -
The response carries
records_to_charge,estimated_cost, andfield_coverage. It carries no records. -
The agent answers with the count, the estimate, and a question.
-
You say "yes". The agent sends the same request without
dry_run. Only the records it returns are billed.
The answer in step 4 reads like this, with the response values filled in:
"
records_to_chargeof the 800 emails would bill as Contact Records, and the misses are free. The estimate isestimated_cost.amount_centsin cents. Nothing has been charged. Run it?"
estimated_cost assumes this is your first usage this billing period. Your actual charge is this amount or lower.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
401 with no credential presented | The request has no credential. Send a bearer token or the X-Api-Key header. |
401 and the X-Api-Key header "arrived empty" | The client sent the header with no value. Check the environment variable that fills it. |
401 and the Authorization header "did not carry a token" | The bearer value is not a Delivr access token. Do not put an API key in Authorization. |
| A tool is refused for a missing scope | The credential lacks the scope. Reconnect with OAuth and approve it. An API key cannot hold it. |
| A tool returns no data for a project | The person has no access to that project. Call list_workspaces to see the projects they can reach. |
| Access stops after 15 minutes | The client does not refresh its token. Make the client use the refresh token. |
Updated 1 day ago
