Skip to main content

Disclosed sponsored slots for MCP servers and AI agent tools. Ships data, never directives. Fail-open by design.

Project description

lulu-ads

The monetization layer for the agent economy.

Monetize your MCP server or agent tool with one labeled sponsored line.

PyPI npm License: MIT Backend Publisher beta Rev share

Quickstart · Integrations · Guarantees · API contract · Hosted docs · Blog · Become a publisher

Lulu, the Lulu Ads narwhal mascot, celebrating on a Tel Aviv billboard — the agent economy has a monetization layer now

70% to publishers · CPA only · 150ms fail-open · 0 prompt injections, by design

Lulu Ads attaches a disclosed, labeled data field to your tool's own result. The host model — Claude, Cursor, any agent — decides on its own judgment whether it's relevant enough to surface. We never instruct it to.

What the SDK ships (a data field) What the host renders (its choice)
{
  "sponsored": {
    "label": "Sponsored",
    "text": "Direct flights TLV–BKK from $412",
    "url": "https://ads.getlulu.dev/c/9f2a1c"
  }
}

Sponsored — Direct flights TLV–BKK from $412 ads.getlulu.dev/c/9f2a1c

Zero-friction start — add the MCP server and let your agent do the rest:

claude mcp add --transport http lulu-ads https://ads.getlulu.dev/mcp

monetize my server

It'll fetch the right integration guide for your stack, register a publisher (with your consent), wire up the one-liner, and verify a slot went live.

If it renders and gets clicked, you earn 70% on CPA. If it doesn't — nobody pays, nothing breaks.

No prompt injection — we ship a data field; the host decides.

Quickstart

Python

pip install lulu-ads
from lulu_ads import LuluAds
ads = LuluAds(publisher_id="pub_123", api_key="lk_...")

result = search_flights("TLV", "BKK", dates)
result["sponsored"] = await ads.sponsored_slot(
    context={"tool": "search_flights", "category": "travel.flights"},
    timeout_ms=150,
)
return result

FastMCP servers get it in one line — credentials come from the environment:

export LULU_ADS_PUBLISHER_ID=pub_123
export LULU_ADS_API_KEY=lk_...
mcp.add_middleware(LuluAdsMiddleware())

TypeScript

npm install lulu-ads
import { LuluAds } from "lulu-ads";
const ads = new LuluAds({ publisherId: "pub_123", apiKey: "lk_..." });
result.sponsored = await ads.sponsoredSlot({ context: { tool: "search_flights" } });

No publisher ID yet? See docs/quickstart.md — three ways to get one, none of them gated on the others.

Framework integrations

Stack One-liner Docs
FastMCP (Python) mcp.add_middleware(LuluAdsMiddleware())
LangChain / LangGraph (Python) middleware=[LuluAdsAgentMiddleware()]
CrewAI (Python) lulu_crewai.install()
MCP TS SDK withLuluAds(server)
Runtime owners (chat bots, WhatsApp/Telegram agents) model_output + format_suffix(sponsored)
Any other runtime / language sponsored_slot(context) over the raw contract

Guarantees (enforced in code, not just promised)

Guarantee How
A tool call can never break because of ads every failure path returns None/null; hard 150ms wall-clock timeout
Always disclosed label: "Sponsored" is set by the SDK, never sourced from the response body
No prompt injection, ever we ship a data field; there is no display instruction anywhere in the contract
No PII leaves your server context is filtered against an allowlist client-side, before any request is built
Quality-gated every creative passes Dali scoring (≥70) before it can fill a slot
Intent, not identity targeting uses this call's stated context only — no user profiles, no cross-session ID
Misconfigured? Still safe missing credentials → client is inert, returns None/null, zero network calls

Why not just…

…tell the model to mention a sponsor in its reply? Display instructions get MCP servers delisted by registries that scan for injected directives. We ship a plain data object — label, text, url — with no field, anywhere in the contract, that tells a model how to render or phrase anything.

…count impressions and charge per view? An "impression" only exists if a model actually rendered it, and that's unverifiable from the server side — easy to game, hard to audit. We charge CPA only, on a click that redeems a signed, server-verified token. Payment maps to a real user action, not a claim.

…scan the conversation to target better? Reading transcripts to target ads is a privacy trap: everything a user says becomes ad-targeting data. We accept six allowlisted context keys — tool, category, query, route, locale, country — stated intent for this call only. No transcripts, no profiles, no PII fields exist in the schema.

How it works

tool call
   │
   ▼
your tool's own result
   │
   ▼
POST /slot  (150ms cap, allowlisted context only)
   │
   ▼
labeled data field  { label: "Sponsored", text, url }   ← attached, never injected
   │
   ▼
host / model judgment   →   renders it, or doesn't — not our call
   │  user clicks
   ▼
GET /c/{token}   →   signed redirect, click recorded
   │
   ▼
advertiser's affiliate rails   →   POST /postback on conversion
   │
   ▼
70% publisher / 30% Lulu, on the ledger. Earnings accrue to your balance from the first audited conversion — cash out from $100.

Full wire-level detail: docs/contract.md.


Docs: https://getlulu.dev/docs · Quickstart · API contract · Integrations · Publisher signup · Quality gate: Dali · MIT

Changelog

  • 0.1.1 — persistent HTTP clients in the Python SDK (per-call client construction could burn the entire slot budget on CPU-constrained containers; clients are now created once per LuluAds instance and reused with keep-alive). Fail-open behavior unchanged.
  • 0.1.0 — initial release: Python + TypeScript clients, FastMCP / LangChain / LangGraph / CrewAI / MCP-TS adapters, suffix helpers, MCP concierge onboarding.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lulu_ads-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lulu_ads-0.1.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file lulu_ads-0.1.1.tar.gz.

File metadata

  • Download URL: lulu_ads-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for lulu_ads-0.1.1.tar.gz
Algorithm Hash digest
SHA256 16d9678fcc7111579663884f1aed62e8f745ecab046916f99d088f27ee7e7d61
MD5 ad385332dde9b554e5b73f1e1adea8e2
BLAKE2b-256 b485ebf5fea2b7ffb2ead6b6fcde1dfe98690a7769d05757dcbe0e13bd8a5b91

See more details on using hashes here.

File details

Details for the file lulu_ads-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lulu_ads-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for lulu_ads-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1fabb23254aac91939d8f9e2414506ba3353cd8c116b94902743113ed7e2187
MD5 104f343804985dd9e4296a6aa9f61a8f
BLAKE2b-256 3d364423fdea8f8a6444927025b82c564712243a14d4f67dfdb8ddd7c99a732f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page