Agentic Ads
Agentic Ads
AIエージェント向けGoogle AdSense。 MCPサーバーに3行のコードを追加するだけで、広告クリックごとに70%の収益を得られます。
ライブデモ · クイックスタート · MCPツール · セルフホスト
クイックスタート
ステップ1 — 登録してAPIキーを取得(30秒):
Webフォームにアクセス: https://agentic-ads-production.up.railway.app/dev/register
またはAPIを直接使用:
curl -X POST https://agentic-ads-production.up.railway.app/api/register \
-H "Content-Type: application/json" \
-d '{"name": "My MCP Bot", "email": "me@example.com", "project_description": "A coding assistant that recommends dev tools"}'
# Returns: { "api_key": "aa_dev_...", "mcp_url": "https://agentic-ads-production.up.railway.app/mcp" }ステップ2 — MCPクライアント設定に追加:
{
"mcpServers": {
"agentic-ads": {
"url": "https://agentic-ads-production.up.railway.app/mcp",
"transport": "http"
}
}
}ステップ3 — エージェント内でsearch_adsを呼び出し、クリックごとに収益:
// In your agent logic — when context is relevant
const ads = await mcp.callTool({
name: 'search_ads',
arguments: { query: 'best running shoes for marathon', max_results: 1 }
});
// Report events to get paid
await mcp.callTool({
name: 'report_event',
arguments: { ad_id: ads[0].ad_id, event_type: 'impression' }
});
// User clicks → report 'click' → you earn $0.35 on a $0.50 CPC ad以上です。収益化が始まります。
Related MCP server: superhighway-mcp
なぜこれが必要か
あなたは素晴らしいMCPサーバーを構築しました。ユーザーは気に入っています。しかし、収益は上がっていません。
agentic-ads は、MCPエコシステムに欠けていた収益化レイヤーです。Google AdSenseのようなものですが、ウェブサイトではなくAIエージェント向けです。
問題点
16,000以上のMCPサーバーが存在しますが、収益化しているものはほとんどありません。
開発者は役立つツールを構築するのに何週間も費やしますが、収入はゼロです。
ユーザーがエージェントに製品の推薦を求めると、エージェントはウェブをスクレイピングしますが、ブランドは彼らにリーチできません。
解決策
プライバシーを尊重したコンテキスト広告をMCPツールを通じて配信します。開発者は70%の収益シェア(業界トップクラス)を得られます。広告主はAIエージェントユーザーにリーチできます。全員が利益を得ます。
収益計算機
例: あなたのMCPサーバーが月に10,000回のクエリを受け、その中で広告が適切なケースを想定します。
シナリオ | 月間インプレッション数 | CTR | 月間クリック数 | CPC | あなたの収益 |
控えめ | 10,000 | 2% | 200 | $0.50 | $70/月 |
現実的 | 10,000 | 5% | 500 | $0.50 | $175/月 |
好調 | 10,000 | 8% | 800 | $0.75 | $420/月 |
月間10万クエリ、CTR5%の場合: 月額$1,750のパッシブインカム。
MCPサーバーに3行のコードを追加するだけで、年間$21,000 の収益です。
詳細な統合ガイド
MCP開発者向け(収益を得る)
ライブサーバーに接続してツールの呼び出しを開始するだけです。承認プロセスや最低条件はありません。
// 1. When user asks about products/services
const ads = await mcp.callTool({
name: 'search_ads',
arguments: {
query: 'best running shoes for marathon',
max_results: 2
}
});
// 2. Show relevant ad in your response (if it adds value)
// 3. Report impression
await mcp.callTool({
name: 'report_event',
arguments: { ad_id: 'ad_xyz', event_type: 'impression' }
});
// 4. If user clicks → report 'click' event
// You earn $0.35 on a $0.50 CPC click (70% revenue share)広告主向け(AIユーザーにリーチ)
# Create campaign + ad via MCP tools
mcp.callTool({
name: 'create_campaign',
arguments: {
name: 'Q1 Running Shoes',
total_budget: 500,
pricing_model: 'cpc',
bid_amount: 0.50
}
});
mcp.callTool({
name: 'create_ad',
arguments: {
campaign_id: 1,
creative_text: 'Ultraboost 24 — 30% off! Free shipping.',
link_url: 'https://adidas.com/ultraboost',
keywords: ['running shoes', 'sneakers', 'marathon'],
category: 'footwear'
}
});
# Monitor analytics
mcp.callTool({ name: 'get_campaign_analytics', arguments: { campaign_id: 1 } });仕組み
┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
│ Advertiser │────────────────────│ Agentic Ads MCP │────────────────────│ Your MCP │
│ (Brand/API) │ create_campaign │ Server │ search_ads │ Server │
│ │ create_ad │ │ report_event │ │
│ │ get_analytics │ - Matching │ get_guidelines │ Shows ads │
└─────────────┘ │ - Billing │ │ to users │
│ - Auth & Rate │ └──────────────┘
│ - Analytics │
└──────────────────┘フローの例:
ユーザーがエージェントに「マラソンに最適なランニングシューズ」と尋ねる
エージェントが
search_adsを呼び出し → 入札額×関連性でランク付けされた関連広告を取得エージェントが広告を自然に表示: 「Ultraboost 24 — $126(30%オフ) Adidas.com(スポンサー)」
ユーザーがクリック →
clickイベントを報告 → $0.35($0.50 CPCの70%)を獲得
プライバシー: ユーザー追跡、プロファイリング、クッキーは一切なし。コンテキストキーワードマッチングのみ。
MCP開発者がこれを気に入る理由
1. 業界トップクラスの収益シェア
70% があなたに、30%がプラットフォームに。比較:
プラットフォーム | 開発者シェア |
agentic-ads | 70% |
Google AdSense | 68% |
Amazon Associates | 1-10% |
アフィリエイトネットワーク | 5-30% |
2. ゼロセットアップの手軽さ
契約不要、最低条件なし、承認待ちなし
POST /api/registerで数秒で登録 → APIキーを取得MCPサーバーを設定に1つ追加 → 5分で収益開始
3. プライバシーを尊重
ユーザー追跡やプロファイリングなし
クッキーなし、ブラウザフィンガープリンティングなし
コンテキストキーワードマッチングのみ(初期のGoogle AdWordsのように)
ユーザーのプライバシーはそのまま維持
4. 表示する広告を自分でコントロール
エージェントがどの広告を表示するか(表示する場合)を決定
ユーザーコンテキストはすべてローカルに保持(広告サーバーに送信されない)
関連性のしきい値はあなたの手に
ユーザーはオプトアウト可能(「広告なしでお願いします」)
5. 透明な分析
リアルタイムの収益追跡
いつ、なぜ、どれだけ稼いだかを正確に確認
ブラックボックスアルゴリズムや隠れた手数料なし
MCPツール(全8個)
開発者向け(コンシューマー側) — 3ツール
ツール | 認証 | 説明 |
| 公開 | クエリ/キーワード/カテゴリ/地域で広告を検索。関連性スコア付きのランク付け結果を返します。 |
| 開発者キー | インプレッション/クリック/コンバージョンイベントを報告。収益計算をトリガーします。 |
| 公開 | 広告をユーザーに自然に表示するためのフォーマットガイドラインを取得します。 |
広告主向け(パブリッシャー側) — 5ツール
ツール | 認証 | 説明 |
| 広告主キー | 予算、目的、価格モデル(CPC/CPM/CPA)でキャンペーンを作成。 |
| 広告主キー | クリエイティブテキスト、キーワード、ターゲティング、リンクURLで広告を作成。 |
| 広告主キー | パフォーマンス指標(インプレッション、クリック、コンバージョン、支出、ROI)を取得。 |
| 広告主キー | キャンペーンを更新(一時停止/再開、予算調整、ターゲティング変更)。 |
| 広告主キー | すべてのキャンペーンをサマリー統計付きで一覧表示。オプションでステータスフィルター。 |
価格モデル
支払い方法(広告主)または収益方法(開発者)を選択:
モデル | 広告主の支払い | 開発者の収益(70%) | 課金タイミング |
CPC(クリック) | クリックあたり$0.50 | $0.35 | ユーザーが広告リンクをクリック |
CPM(インプレッション) | 1,000表示あたり$5.00 | $3.50 | 広告がユーザーに表示されたとき |
CPA(コンバージョン) | コンバージョンあたり$10.00 | $7.00 | ユーザーがアクションを完了(購入、サインアップなど) |
予算管理: 総予算+日次上限を設定。予算が尽きると自動一時停止。
APIキーの取得
report_eventや広告主ツールを呼び出すには、APIキーが必要です。
オプションA — Webフォーム(最も簡単):
https://agentic-ads-production.up.railway.app/dev/register にアクセスし、詳細を入力してください。APIキーがすぐに表示されます。
オプションB — API:
curl -X POST https://agentic-ads-production.up.railway.app/api/register \
-H "Content-Type: application/json" \
-d '{"name": "My MCP Bot", "email": "me@example.com", "project_description": "A coding assistant"}'レスポンス:
{
"developer_id": "...",
"api_key": "aa_dev_...",
"mcp_url": "https://agentic-ads-production.up.railway.app/mcp"
}フィールド | 必須 | 説明 |
| はい | プロジェクト名またはボット名 |
| はい | 連絡先メールアドレス |
| いいえ | MCPサーバーの簡単な説明(最大500文字) |
Authorization ヘッダーで api_key を使用: Authorization: Bearer aa_dev_...
Railwayに永続ストレージ付きでデプロイ:
agentic-ads-production.up.railway.appのライブサーバーはRailway上で動作し、永続ボリュームを使用 — データはデプロイや再起動をまたいで保持されます。セルフホストする場合は、マウントされたボリュームを指すDATABASE_PATH=/data/ads.dbを使用してください。
インストール
オプション1: ライブサーバーに接続(最も簡単)
MCPクライアント設定(Claude Desktop、Cursor、Windsurfなど)に追加:
{
"mcpServers": {
"agentic-ads": {
"url": "https://agentic-ads-production.up.railway.app/mcp",
"transport": "http"
}
}
}ヘルスチェック: https://agentic-ads-production.up.railway.app/health
オプション2: ローカル stdio(開発用)
npm install -g agentic-ads
# Add to MCP config
{
"mcpServers": {
"agentic-ads": {
"command": "npx",
"args": ["agentic-ads", "--stdio"]
}
}
}オプション3: セルフホスト(本番環境)
git clone https://github.com/nicofains1/agentic-ads.git
cd agentic-ads
npm install && npm run build
# Start HTTP server
PORT=19877 npm run start:http
# Or stdio
npm run start:stdioフラグ:
node dist/server.js --http --port 19877 --db ./ads.dbフラグ | デフォルト | 説明 |
| — | HTTPサーバーを起動(デフォルトはstdio) |
|
| HTTPポート |
|
| SQLiteデータベースパス |
| — | stdioセッションを事前認証 |
環境変数:
PORT=19877 # HTTP server port (alternative to --port)
DATABASE_PATH=/data/ads.db # SQLite database path (default: agentic-ads.db)
AGENTIC_ADS_API_KEY=aa_dev_... # Developer API key for stdio modeDBの永続性: DATABASE_PATH を永続ボリューム上のパスに設定します。空のDBで初回実行時、デモキャンペーンが自動的にシードされます。完全なデプロイガイドは DEPLOY.md を参照(無料の永続ストレージにはRailway推奨)。
統合例
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json に追加:
{
"mcpServers": {
"agentic-ads": {
"command": "npx",
"args": ["agentic-ads", "--stdio"]
}
}
}Cursor / Windsurf
{
"mcpServers": {
"agentic-ads": {
"url": "https://agentic-ads-production.up.railway.app/mcp",
"transport": "http"
}
}
}カスタムTypeScriptエージェント
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'npx',
args: ['agentic-ads', '--stdio']
});
const client = new Client({ name: 'my-agent', version: '1.0.0' });
await client.connect(transport);
// Search for ads
const result = await client.callTool({
name: 'search_ads',
arguments: {
query: 'best laptops for coding',
keywords: ['laptop', 'programming'],
category: 'electronics',
max_results: 3
}
});
console.log(result.content[0].text);
// Returns: { "ads": [ { "ad_id": "...", "creative_text": "...", "relevance_score": 0.87 } ] }Streamable HTTPセッション管理
ライブサーバーをHTTP経由で呼び出す場合、MCPセッションを手動で管理する必要があります。以下は生の fetch を使用した完全な例です:
const BASE = "https://agentic-ads-production.up.railway.app";
const API_KEY = "aa_dev_..."; // from /api/register
const headers = {
"Content-Type": "application/json",
"Accept": "application/json, text/event-stream",
"Authorization": `Bearer ${API_KEY}`,
};
// 1. Initialize — get a session ID
const initRes = await fetch(`${BASE}/mcp`, {
method: "POST",
headers,
body: JSON.stringify({
jsonrpc: "2.0", id: 1, method: "initialize",
params: {
protocolVersion: "2024-11-05",
capabilities: {},
clientInfo: { name: "my-agent", version: "1.0.0" },
},
}),
});
const sessionId = initRes.headers.get("mcp-session-id");
// 2. Send initialized notification (required by MCP spec)
await fetch(`${BASE}/mcp`, {
method: "POST",
headers: { ...headers, "mcp-session-id": sessionId },
body: JSON.stringify({
jsonrpc: "2.0", method: "notifications/initialized", params: {},
}),
});
// 3. Call tools — pass session ID on every request
const res = await fetch(`${BASE}/mcp`, {
method: "POST",
headers: { ...headers, "mcp-session-id": sessionId },
body: JSON.stringify({
jsonrpc: "2.0", id: 2, method: "tools/call",
params: { name: "search_ads", arguments: { query: "running shoes", max_results: 2 } },
}),
});
// 4. Parse response (SSE format: "event: message\ndata: {...}")
const text = await res.text();
const dataLine = text.split("\n").find((l) => l.startsWith("data:"));
const result = JSON.parse(dataLine.slice(5));
console.log(result.result.content[0].text);重要なポイント:
mcp-session-idヘッダーはinitializeで返され、以降のすべてのリクエストで送信する必要があります認証(
Authorization: Bearer ...)はセッションごとに設定 — そのセッション内のすべてのツール呼び出しが継承しますサーバーはSSE(Server-Sent Events)形式を使用 — レスポンスの
data:行を解析します完全な動作例については
examples/demo-mcp-serverを参照
アーキテクチャ
┌─────────────────────────────────────────────────────────────┐
│ MCP Server (Node.js 22 + TypeScript) │
│ ┌───────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ Tool Registry │ │ Auth & Rate │ │ Matching Engine │ │
│ │ (8 tools) │ │ Limiting │ │ (relevance² │ │
│ │ │ │ (SHA-256) │ │ × bid × quality)│ │
│ └───────────────┘ └──────────────┘ └─────────────────┘ │
│ ┌───────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ SQLite (WAL) │ │ Revenue │ │ Analytics │ │
│ │ - Campaigns │ │ Split Engine │ │ (real-time) │ │
│ │ - Ads │ │ (70/30) │ │ │ │
│ │ - Events │ │ │ │ │ │
│ └───────────────┘ └──────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│ │
│ │
Streamable HTTP (remote) stdio (local)主な機能:
プライバシー: ユーザー追跡なし、コンテキストマッチングのみ
関連性:
score = relevance² × bidFactor × quality_score(関連性が支配的)原子性: イベント挿入+統計更新+収益分割を単一のSQLiteトランザクションで実行
レート制限: キーごとのスライディングウィンドウ(ツールにより60〜120 req/min)
認証: SHA-256ハッシュ化APIキー、ロールベースアクセス制御
テスト: 13ファイルで270テスト、すべて合格
デモ: 完全なフロー
# Clone repo
git clone https://github.com/nicofains1/agentic-ads.git
cd agentic-ads
# Install + build
npm install && npm run build
# Seed a local DB with demo data (generates real API keys)
tsx scripts/seed.ts --db test.db
# Note: seed.ts prints the generated dev/adv keys — use them below
# Run smoke test with real keys from seed output
tsx scripts/smoke-test.ts --db test.db --dev-key aa_dev_... --adv-key aa_adv_...出力:
✅ Created advertiser: Adidas
✅ Created campaign: Q1 Running Shoes ($500 budget, CPC $0.50)
✅ Created ad: "Ultraboost 24 — 30% off!"
✅ Created developer: TestBot
✅ Searched ads for "running shoes" → 1 result (relevance 0.95)
✅ Reported impression → $0.00 charged (CPC model)
✅ Reported click → $0.50 charged, developer earned $0.35
✅ Analytics: 1 impression, 1 click, $0.50 spent, $0.35 developer revenue開発者の支払い方法
MCPサーバーがCPC広告のクリックイベントを報告すると、入札額の70%があなたに支払われます — データベース内で原子的に追跡されます。残高が**$10**に達したら、payouts@agentic-ads.com にあなたの developer_id と希望する支払い方法(PayPalまたはPolygon上のUSDC)をメールで送信してください。残高を確認後、5営業日以内に支払いを送金します。ネットワークが拡大した際の自動Stripe支払いはロードマップに含まれています。
FAQ
開発者向け
Q: APIキーを取得するにはどうすればいいですか? A: RESTエンドポイント経由で登録:
curl -X POST https://agentic-ads-production.up.railway.app/api/register \
-H "Content-Type: application/json" \
-d '{"name": "Your Name", "email": "you@example.com"}'
# Returns: { "developer_id": "...", "api_key": "aa_dev_...", "mcp_url": "..." }返された api_key をMCPリクエストの Authorization: Bearer aa_dev_... として使用します。
Q: 広告を表示しなければなりませんか? A: いいえ。表示する広告を自分でコントロールできます。ユーザーに真に価値を提供する場合にのみ広告を表示してください。エージェントの自律性は機能の一部です。
Q: ユーザーが広告を嫌がったらどうしますか?
A: get_ad_guidelines のガイドラインに従ってください: レスポンスあたり最大1〜2個の広告、常に「スポンサー」と明示、オプトアウト(「広告なしでお願いします」)を尊重。
Q: これは本番環境で使えますか? A: はい。270のテストに合格、https://agentic-ads-production.up.railway.app でライブ稼働中、MITライセンス。
Q: どのMCPクライアントをサポートしていますか? A: stdioまたはStreamable HTTPをサポートする任意のMCPクライアント。Claude Desktop、Cursor、Windsurf、カスタムエージェントでテスト済み。
広告主向け
Q: 広告を作成するにはどうすればいいですか?
A: 広告主APIキーを使用して create_campaign および create_ad MCPツールを使用します。例については smoke-test.ts を参照。
Q: 予算はどのように保護されますか? A: 予算追跡は原子的(SQLiteトランザクション)。予算が尽きるとキャンペーンは自動一時停止。超過支出はありません。
Q: コンバージョンを追跡できますか?
A: はい。CPA価格モデルと event_type: 'conversion' の report_event を使用します。リンクURLにUTMパラメータを追加してアトリビューションを行います。
Q: どのようなターゲティングオプションがありますか? A: MVPでは、キーワード(完全一致+部分一致)、カテゴリ、地域(国レベル)、言語に対応しています。セマンティックマッチングはフェーズ2で追加予定です。
一般
Q: ユーザーを追跡しますか? A: いいえ。エージェントから匿名化されたキーワードクエリのみを受け取ります。ユーザーID、Cookie、プロファイリングは一切行いません。プライバシーファーストです。
Q: 不正をどのように防止しますか? A: MVPでは、APIキー認証+レート制限+信頼ベースの報告を使用します。フェーズ2では異常検出ヒューリスティックを追加予定です(issue #47参照)。
Q: これはオープンソースですか? A: はい、MITライセンスです。フォークして、セルフホストして、コントリビュートしてください。
ロードマップ
MVP — 8つのMCPツール、キーワードマッチング、課金、認証、270のテスト
デプロイ済み — https://agentic-ads-production.up.railway.app で公開中
マーケットプレイス掲載 — Anthropic Registry、Smithery、Glama、PulseMCPに提出(第1週)
ダッシュボードREST API — 広告主/開発者向けWeb UI(#40)
不正検出 — 異常ヒューリスティック(#47)
セマンティックマッチング — 埋め込みベースの関連性(フェーズ2)
A/Bテスト — 広告クリエイティブのバリエーション(#41)
Stripe支払い — 開発者への自動支払い(フェーズ3)
コントリビューション
GitHub Issuesのワークフローに従います:
あなたのアイデアに関するIssueが存在するか確認する
存在しない場合:
gh issue create --title "あなたのアイデア"作業開始前に承認を得る
ブランチ:
feature/#N-descriptionコミット:
feat(#N): descriptionmainへのPR
詳細なガイドラインはCLAUDE.mdを参照してください。
ドキュメント
CLAUDE.md — 開発ガイドライン
bulloak.md — 動作仕様(テストの信頼できる情報源)
docs/PRD.md — 完全な製品要件ドキュメント
scripts/smoke-test.ts — リファレンス実装
サポート
GitHub Issues: https://github.com/nicofains1/agentic-ads/issues
Discussions: (近日公開)
Discord: (近日公開 — MCP Developersコミュニティに参加)
ライセンス
MIT — 詳細はLICENSEを参照してください。
これが重要な理由
AIエージェントがウェブを席巻しています。ユーザーはGoogleを検索する代わりにエージェントに質問します。エージェントはウェブサイトの代わりに回答します。
旧来のインターネット: ユーザーがウェブサイトを閲覧 → 広告を表示 → 広告主がユーザーにリーチ
新しいインターネット: ユーザーがエージェントに質問 → エージェントがウェブサイトをスクレイピング → 広告主がユーザーにリーチできない
agentic-adsがこれを解決します。 エージェント経済のための広告レイヤーです。
そして、あなた — MCP開発者 — は仲介者として収益の70%を得られます。
チャンス: 16,000以上のMCPサーバーがあり、ほとんどが収益化されていません。あなたが最初になれます。
Built with Model Context Protocol (MCP) — AIエージェントをツールに接続するためのオープンスタンダード。
ライブデモ: https://agentic-ads-production.up.railway.app
始め方: MCPサーバーを設定に追加し、今週中に最初の収益を得ましょう。
This server cannot be deployed
Maintenance
Related MCP Connectors
Website monetization for AI agents: apply, integrate ads, reporting, and payouts — all over MCP.
MCP-native ad server. Monetize AI chatbots and agents with conversational ads.
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for AI agents to manage ad campaigns across Google, Meta, LinkedIn, Microsoft, Reddit, TikTok, and more21116 npm17MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides real-time web search to AI agents via a pay-per-search USDC microtransaction system.567 npm1MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that gives Claude Desktop direct access to your Google AdSense account. Ask plain English questions about your revenue — no dashboard required.1013 npmMIT
- AlicenseAqualityDmaintenanceMCP server for Google AdSense management. Create ad units, generate framework-specific ad code, manage earnings reports, and automate ads.txt — all from your AI assistant.1213 npmMIT