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 confirm set to the quote's quote_id. See Quote, then confirm.
  • get_rate_card returns 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

  1. In Claude, add a custom connector.
  2. Enter the URL https://api.delivr.ai/mcp.
  3. Select Connect. Claude opens the Delivr sign-in page.
  4. 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/mcp

Then 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 delivr

codex 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:

  1. Send a request to https://api.delivr.ai/mcp without a credential. The server answers 401 with a WWW-Authenticate header. The header holds a resource_metadata URL.
  2. Read the protected resource document at https://api.delivr.ai/.well-known/oauth-protected-resource/mcp (RFC 9728). It names the authorization server https://auth.delivr.ai and lists scopes_supported.
  3. 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.
  4. Send the person to the authorization endpoint with the code response type and a PKCE challenge. Only the S256 method is accepted. Name the scopes you need in scope. A request with no scope is refused.
  5. Exchange the code at the token endpoint. Send the PKCE verifier.
  6. Send the access token on each MCP request as Authorization: Bearer <token>.
SettingValue
Issuerhttps://auth.delivr.ai
Grant typesauthorization_code, refresh_token
PKCES256 only
Token endpoint authenticationnone, client_secret_basic, client_secret_post
Resourcehttps://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

  1. In the dashboard, open Account > Apps.
  2. Find the agent under Connected agents. The row shows what it can see and change, and when it was last used.
  3. 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:

  1. Call whoami to see which identity the credential resolves to. An OAuth connection reports kind as agent.
  2. Call list_workspaces to list the projects the person can reach. Most tools need a project_id.
  3. Call list_audiences or get_audience to 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.

AreaTools
Account and helpwhoami, list_workspaces, get_workspace_inventory, get_my_profile, list_announcements, search_help_articles, read_help_article, file_support_ticket
Projects, pixels and domainscreate_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 eventsget_resolution_statistics, list_website_visitors, query_events, list_event_fields
People and intent lookuplook_up_person, look_up_people, look_up_person_intent, look_up_company_intent, list_companies_researching, get_people_coverage
Topics and fieldslist_topics, get_topic, get_topic_activity, list_topic_categories, request_topic, draft_topic_request, list_topic_requests, list_fields, get_field
Audienceslist_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 datasetslist_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 integrationslist_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 campaignslist_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 budgetsget_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 settingslist_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:

  1. A persona for who the people are.
  2. An account for which companies. In the dashboard this is a company list. In the API its kind is account.
  3. 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_plan when a request names two or more of people, companies and a researched subject.
  • Call create_audience for 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 preview set to true to 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 status is not yet finished. Call check_audience_readiness to 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.

ToolWhat countsMeter
look_up_person, look_up_peopleEach person found. A person not found is free. Quotes first and bills only on confirm.Contact Records
look_up_person_intent, look_up_company_intentEach 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_researchingEach company on a page. The call without page_size or cursor is a free preview.Intent Signals
list_website_visitorsEach visitor returned, at the tier you ask forResolution, at that tier
query_eventsEach row returned, at the tier you ask forEvents / Journey, or Resolution at that tier
get_audience_recordsEach 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_membersEach 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_exportEach export run delivers people out of Delivr, and each run billsThe export's meter
create_dsp_exportAn 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_stateA resume or a run that delivers bills like any other runThe 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.

  1. The agent calls the tool without confirm. Delivr counts the records and runs nothing. Nothing is billed.
  2. The tool returns a quote. It holds billable_count, meter, unit_price, total in US dollars, rate_band, quote_id and expires_at. look_up_people also returns field_coverage.
  3. The agent shows the quote to the person.
  4. If the person agrees, the agent calls the same tool again. It sends the same arguments and sets confirm to the quote_id.
  5. 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 wantUseWhat you get
The cost of an identity lookup from an agentlook_up_person or look_up_people without confirmA quote: the billable count and the price, plus field coverage from look_up_people. Nothing runs.
The cost of an intent lookup from an agentlook_up_person_intent or look_up_company_intent without confirmA quote: the billable count and the price. Nothing runs.
The published pricesget_rate_cardEach meter's price per 1,000 records, by volume band and by plan.
The cost of an identity lookup over RESTPOST /api/v1/lookup/batch with "dry_run": true, or ?dry_run=true on either lookup routeThe billable count, estimated_cost, and field coverage. Nothing is billed. Up to 1,000 keys per call.
The cost of an intent lookup over RESTPOST /api/v1/intent/batch with "dry_run": trueThe billable count and estimated_cost. Nothing is billed.
The size of an audience before you save itcreate_audience with preview set to trueThe estimated size. Nothing is created.
The parts and size of an audience built from people, companies and a subjectcreate_audience_plan with preview set to trueEach part as create or reuse, the estimated size and any notices. Nothing is created.
The companies researching a topiclist_companies_researching without page_sizeThe strongest few companies and the match count. Nothing is billed.
A look at the people in an audienceget_audience_sampleA 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 areSay to your agentThe agent callsBills
A brand checking its site"Is the pixel on example.com sending events?"list_workspaces, check_pixel_eventsNo
A brand checking its site"How many people did we name on example.com last week, and out of how many visitors?"get_resolution_statisticsNo
A brand checking its site"Who visited example.com yesterday? Use the cheapest tier that has names."list_event_fields, list_website_visitorsYes, per visitor
A champion reporting to finance"What did we use this month, by meter?"get_usageNo
A champion reporting to finance"Show our invoices for this year."list_invoicesNo
An agency"How many people matched in the list we uploaded for our client?"list_listsNo
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 previewNo
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 previewNo. 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_runNo
A builder"What is jane@acme.com researching?"look_up_person_intentQuotes 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_performanceNo
A Delivr DSP buyer"Draft a campaign to my in-market CFO audience for 30 days."list_audiences, list_campaign_options, create_campaignNo. 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.

  1. You say: "What would it cost to look up the 800 emails in customers.csv?"

  2. The agent sends the emails to POST /api/v1/lookup/batch with "dry_run": true.

  3. The response carries records_to_charge, estimated_cost, and field_coverage. It carries no records.

  4. The agent answers with the count, the estimate, and a question.

  5. 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_charge of the 800 emails would bill as Contact Records, and the misses are free. The estimate is estimated_cost.amount_cents in 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

SymptomCause and fix
401 with no credential presentedThe 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 scopeThe credential lacks the scope. Reconnect with OAuth and approve it. An API key cannot hold it.
A tool returns no data for a projectThe person has no access to that project. Call list_workspaces to see the projects they can reach.
Access stops after 15 minutesThe client does not refresh its token. Make the client use the refresh token.

Did this page help you?